Repository navigation
fix: wrap boolean parameters in eq(...,true) before and() - #89
Merged
Merged
Conversation
PR #87/#88's fixes to the WaitForBuilds gate didn't work: build 12586 (Weekly Redeployment, both manual params false) still ran the Delay task. Isolated with the pipeline preview API against a scratch branch: ${{ and(parameters.RunRenovateManually, parameters.RunMergePRManually) }} compiled to True even with both params false, and and(param, true) compiled True regardless of the param's value -- the ADO expression engine isn't treating a boolean-typed parameter as boolean when it's an argument to and(), only when it's the sole value of a ${{ }} block. Wrapping each operand as eq(parameters.X, true) forces a real boolean comparison before and() sees it. Verified all four combinations (false/false, true/true, true/false, false/true) compile correctly via the preview API. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
and(parameters.RunRenovateManually, parameters.RunMergePRManually)only evaluatesTrueif both params are truthy, and both defaultfalsewith no schedule-level override.templateParameterswereRunRenovateManually: false,RunMergePRManually: false, reasonschedule, on paper this should've compiled toFalsebut evaluated toTruePOST _apis/pipelines/31/preview) against a disposable scratch branch, bypassing the real schedule entirely:${{ parameters.RunRenovateManually }}alone →False(correct)${{ and(parameters.RunRenovateManually, true) }}→True(wrong — first operand is false,and()is documented to short-circuit to False here)${{ and(parameters.RunRenovateManually, parameters.RunMergePRManually) }}→True(wrong)${{ and(eq(parameters.RunRenovateManually, true), eq(parameters.RunMergePRManually, true)) }}→False(correct)True, true/false and false/true →Falsewith theeq(...)-wrapped form.and()treats it as truthy regardless of value unless it's first forced through aneq(..., true)comparison. This is the same template parameter in both callers (azure-pipelines.ymltop-level, boolean-typed) and callee (renovate-run.yml, also explicitly boolean-typed — tried that too, no change), so this looks like an actual Azure Pipelines expression-engine quirk rather than a declaration mistake on our side.and(parameters.) — this is the only place with this pattern.Test plan
WaitForBuilds/Delay should skip in seconds.MergeDelayMinutes, MergePRs runs after.RunRenovateManuallyandRunMergePRManuallytrue: Delay should still run (forced wait path).🤖 Generated with Claude Code