Address review nits after validation feedback

Agent-Logs-Url: https://github.com/microsoft/regorus/sessions/f964122b-5af3-41a7-bc51-d87b7271a455

Co-authored-by: anakrish <35780660+anakrish@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-14 20:11:51 +00:00
committed by GitHub
parent 196b6d68aa
commit 4cc82e2fda
2 changed files with 17 additions and 13 deletions

View File

@@ -1127,8 +1127,6 @@ impl Engine {
self.interpreter.set_traces(enable_tracing);
#[cfg(feature = "azure_policy")]
let was_prepared = self.prepared;
#[cfg(not(feature = "azure_policy"))]
let _ = for_target;
// if the data/policies have changed or the interpreter has never been prepared
if !self.prepared {
@@ -1166,17 +1164,23 @@ impl Engine {
}
#[cfg(feature = "azure_policy")]
if for_target {
// Resolve and validate target specifications across all modules.
// This must run for target-aware compilation even if generic prepare()
// was already called.
crate::interpreter::target::resolve::resolve_and_apply_target(&mut self.interpreter)?;
// Infer resource types
crate::interpreter::target::infer::infer_resource_type(&mut self.interpreter)?;
} else if !was_prepared {
// Check if any module specifies a target and warn if so.
self.warn_if_targets_present();
{
if for_target {
// Resolve and validate target specifications across all modules.
// This must run for target-aware compilation even if generic prepare()
// was already called.
crate::interpreter::target::resolve::resolve_and_apply_target(
&mut self.interpreter,
)?;
// Infer resource types
crate::interpreter::target::infer::infer_resource_type(&mut self.interpreter)?;
} else if !was_prepared {
// Check if any module specifies a target and warn if so.
self.warn_if_targets_present();
}
}
#[cfg(not(feature = "azure_policy"))]
let _ = for_target;
Ok(())
}

View File

@@ -163,7 +163,7 @@ fn prepare_then_compile_for_target() -> Result<()> {
default allow := false
allow if {
input.type == "test_resource"
input.type == "test_resource"
}
"#
.to_string(),