Repository navigation
Engine enforces the project variables policy - #1256
Merged
futurepastori merged 1 commit intoOct 7, 2026
Merged
Conversation
Task: Engine enforces the project variables policy Attempt 2 of 3
futurepastori
deleted the
victor/engine-enforces-the-project-variables-policy
branch
October 7, 2026 17:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
diff_variables(src/iac/change_set.rs) only skipped when both sides lackedvariables: a desired service with noenvdeleted every remote variable, andpreserve()is per key, so variables synced by an external secret manager got deleted. This adds an explicit project-level variables policy so users can say "IaC does not own these variables".Python:
project("example", resources=[...], variables={"managed": True, "ignore": [...]}). Go: the project'sVariablesfield. The policy is read from the evaluatedproject.variablesinnormalize_project/project_definition_to_graphand carried onRailwayGraph. Absent →{ managed: true, ignore: [] }, flagged as default.Semantics
KEY_GLOBmatches that key on every service;service/KEY_GLOBonly on the named resource. Only*is special, case-sensitive, full-key match. Ignored keys are removed from both sides before diffing: never set, never deleted.managed: false: novariable.set/variable.delete. A service declaringenv/variablesis an error.managed: true, service with novariableskey while Railway has non-ignored variables → error, no deletes. An explicitenv: {}stays authoritative. Database behaviour is unchanged.service/prefix naming an unknown resource, are errors.variables: managed · 23 ignored on Railway (SECRETS_* 21, web/* 2).--jsongets a top-levelvariablePolicy{ managed, ignore, default, ignoredCount, byPattern }.--out/--plan) keep working; the policy is part of the evaluated input.Tests
One test per rule in
src/iac/tests.rs.