Fix positional arg bug in ExpressionParser.CreateTree#4279
Merged
ericsciple merged 1 commit intomainfrom Mar 5, 2026
Merged
Conversation
7772cef to
627937f
Compare
allowCaseFunction was passed positionally into the allowUnknownKeywords parameter of ParseContext, causing the legacy parser to silently accept any named-value in expressions during schema validation.
627937f to
2c8827e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a positional-argument mixup in ExpressionParser.CreateTree that caused allowCaseFunction to incorrectly toggle allowUnknownKeywords, letting invalid named-values slip through schema validation.
Changes:
- Pass
allowCaseFunctionintoParseContextvia a named argument to avoid the incorrect parameter binding. - Add regression tests for expression parsing and for action manifest parsing (legacy/new/wrapper) to ensure invalid contexts are rejected.
- Add new action manifest test data covering invalid env expression context usage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Sdk/DTExpressions2/Expressions2/ExpressionParser.cs | Fixes the root cause by using a named argument for allowCaseFunction when constructing ParseContext. |
| src/Test/L0/Sdk/ExpressionParserL0.cs | Adds regression tests ensuring unknown named-values are rejected and case() behavior doesn’t affect keyword validation. |
| src/Test/L0/Worker/ActionManifestParserComparisonL0.cs | Adds a wrapper-level test asserting both parsers reject invalid expression context in container env. |
| src/Test/L0/Worker/ActionManifestManagerLegacyL0.cs | Adds legacy parser tests for rejecting invalid env contexts and accepting valid ones. |
| src/Test/L0/Worker/ActionManifestManagerL0.cs | Adds new parser tests for rejecting invalid env contexts and accepting valid ones. |
| src/Test/TestData/dockerfileaction_env_invalid_context.yml | Adds a manifest fixture that contains a valid and an invalid expression context in runs.env. |
salmanmkc
approved these changes
Mar 5, 2026
AllanGuigou
approved these changes
Mar 5, 2026
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.
allowCaseFunctionwas passed positionally into theallowUnknownKeywords, causing the legacy parser to silently accept any named-value in expressions during schema validation.