Skip to content

fix(gate): use '.' separator in build tags so ADO doesn't reject ':' in REST path#917

Merged
jamesadevine merged 2 commits into
mainfrom
copilot/fix-gate-js-build-tag
Jun 8, 2026
Merged

fix(gate): use '.' separator in build tags so ADO doesn't reject ':' in REST path#917
jamesadevine merged 2 commits into
mainfrom
copilot/fix-gate-js-build-tag

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

ADO puts build tags in the REST request path (PUT …/builds/<id>/tags/<tag>), and ASP.NET's request-path validator rejects : with "A potentially dangerous Request.Path value was detected". The gate emitted tags like pr-gate:passed, so every PR-gated pipeline failed on the addBuildTag step.

Switch the tag separator from : to . at all gate call sites:

  • bypass.ts${tag_prefix}.passed
  • selfcancel.ts${tag_prefix}.skipped
  • predicates.ts (failed-check path) → ${tag_prefix}.${tag_suffix}
- addBuildTag(`${spec.context.tag_prefix}:passed`);
+ addBuildTag(`${spec.context.tag_prefix}.passed`);
  • Regression tests in bypass.test.ts / selfcancel.test.ts assert the emitted ##vso[build.addbuildtag] line contains no :; existing gate-tag expectations updated to the dot form.
  • Defensive Rust test (test_tag_prefix_has_no_colon) confirms tag_prefix itself is colon-free for both PullRequest and PipelineCompletion.

Blast radius: consumers filtering on the old colon-form tags (pr-gate:passed, etc.) must update to the dot form. The format is internal to the gate, so impact is expected to be near-zero.

Test plan

  • npm test (ado-script): 251 tests pass; tsc --noEmit clean
  • cargo test --bin ado-aw test_tag_prefix_has_no_colon passes

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review June 8, 2026 20:59
Copilot AI changed the title [WIP] Fix gate.js to avoid colons in emitted build tags fix(gate): use '.' separator in build tags so ADO doesn't reject ':' in REST path Jun 8, 2026
Copilot AI requested a review from jamesadevine June 8, 2026 20:59
@jamesadevine jamesadevine merged commit 4122a64 into main Jun 8, 2026
20 of 22 checks passed
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.

gate.js emits addBuildTag(\"pr-gate:passed\"); ADO server rejects the colon

2 participants