Skip to content

fix: wrap boolean parameters in eq(...,true) before and() - #89

Merged
NickGraham101 merged 1 commit into
mainfrom
FixAndFunctionBooleanParameterCoercion
Oct 2, 2026
Merged

NickGraham101 merged 1 commit into
mainfrom
FixAndFunctionBooleanParameterCoercion

Conversation

@NickGraham101

@NickGraham101 NickGraham101 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • and(parameters.RunRenovateManually, parameters.RunMergePRManually) only evaluates True if both params are truthy, and both default false with no schedule-level override. templateParameters were RunRenovateManually: false, RunMergePRManually: false, reason schedule, on paper this should've compiled to False but evaluated to True
  • Root cause isolated with the pipeline Preview API (POST _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)
    • Also verified true/true → True, true/false and false/true → False with the eq(...)-wrapped form.
  • Whatever the parameter's actual runtime type is at that point, and() treats it as truthy regardless of value unless it's first forced through an eq(..., true) comparison. This is the same template parameter in both callers (azure-pipelines.yml top-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.
  • Checked the rest of the repo (and(parameters.) — this is the only place with this pattern.

Test plan

  • Next Tuesday scheduled run (Weekly Redeployment): WaitForBuilds/Delay should skip in seconds.
  • Next Thursday scheduled run (Weekly Renovate) where schedule matches: Delay still runs the full MergeDelayMinutes, MergePRs runs after.
  • Manual run with both RunRenovateManually and RunMergePRManually true: Delay should still run (forced wait path).

🤖 Generated with Claude Code

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>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Unit Test Results

1 136 tests  ±0   1 136 ✔️ ±0   38s ⏱️ +15s
       3 suites ±0          0 💤 ±0 
       1 files   ±0          0 ❌ ±0 

Results for commit 76ad546. ± Comparison against base commit e8ba3ae.

@NickGraham101
NickGraham101 merged commit 04e279d into main Oct 2, 2026
4 checks passed
@NickGraham101
NickGraham101 deleted the FixAndFunctionBooleanParameterCoercion branch October 2, 2026 11:39
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.

1 participant