Skip to content

Remove AllowCaseFunction feature flag#4316

Merged
ericsciple merged 1 commit intomainfrom
users/ericsciple/26-03-clean
Mar 27, 2026
Merged

Remove AllowCaseFunction feature flag#4316
ericsciple merged 1 commit intomainfrom
users/ericsciple/26-03-clean

Conversation

@ericsciple
Copy link
Copy Markdown
Collaborator

The case() expression function is now unconditionally available. Remove all gating logic, the feature flag constant, and related test scaffolding across both SDK copies and the Runner layer.

The case() expression function is now unconditionally available.
Remove all gating logic, the feature flag constant, and related
test scaffolding across both SDK copies and the Runner layer.
@ericsciple ericsciple marked this pull request as ready for review March 27, 2026 16:39
@ericsciple ericsciple requested a review from a team as a code owner March 27, 2026 16:39
Copilot AI review requested due to automatic review settings March 27, 2026 16:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the AllowCaseFunction feature-flag gating so the case() expression function is always available across the Runner and both SDK/parser copies.

Changes:

  • Removed AllowCaseFunction from TemplateContext and stopped threading it through template evaluation/parsing paths.
  • Updated expression parser(s) to always recognize case() (removed the conditional rejection logic).
  • Adjusted/added L0 tests to reflect unconditional case() availability.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Test/L0/Worker/ActionManifestManagerL0.cs Adds L0 coverage ensuring case() works when evaluating default inputs (comment needs update).
src/Test/L0/Sdk/ExpressionParserL0.cs Updates SDK parser regression tests to reflect unconditional case() support.
src/Sdk/WorkflowParser/ObjectTemplating/Tokens/TemplateToken.cs Stops passing AllowCaseFunction into the parser during template evaluation.
src/Sdk/WorkflowParser/ObjectTemplating/TemplateContext.cs Removes AllowCaseFunction from workflow parser template context.
src/Sdk/WorkflowParser/Conversion/WorkflowTemplateConverter.cs Updates CreateTree calls to the new signature (no case gating).
src/Sdk/Expressions/ExpressionParser.cs Removes allowCaseFunction from the public CreateTree API and related parsing logic.
src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateConverter.cs Updates CreateTree call sites to no longer pass AllowCaseFunction.
src/Sdk/DTObjectTemplating/ObjectTemplating/Tokens/TemplateToken.cs Stops passing AllowCaseFunction into the parser for DT templating.
src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateContext.cs Removes AllowCaseFunction from DT templating context.
src/Sdk/DTExpressions2/Expressions2/ExpressionParser.cs Removes allowCaseFunction from the public CreateTree API and related parsing logic (DT copy).
src/Runner.Worker/ActionManifestManagerLegacy.cs Removes explicit disabling of case() in legacy action manifest templating context.
src/Runner.Worker/ActionManifestManager.cs Removes explicit disabling of case() in the new action manifest templating context.

_ec.Object.ExpressionFunctions.Add(new LegacyExpressions.FunctionInfo<GitHub.Runner.Worker.Expressions.HashFilesFunction>("hashFiles", 1, 255));

// Act — evaluate a case() expression as a default input value.
// The feature flag is set, so this should succeed.
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test comment references a feature flag being set, but this PR removes the AllowCaseFunction flag/gating. Update the comment to reflect the new behavior (case() is unconditionally available) to avoid misleading future readers.

Suggested change
// The feature flag is set, so this should succeed.
// case() is unconditionally available, so this should succeed.

Copilot uses AI. Check for mistakes.
@ericsciple ericsciple merged commit f0c2286 into main Mar 27, 2026
45 of 52 checks passed
@ericsciple ericsciple deleted the users/ericsciple/26-03-clean branch March 27, 2026 16:45
@@ -1,4 +1,4 @@
using System;
using System;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you added a BOM to this file?
ef bb bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants