feat(compile): unify pool front-matter replacement across targets#538
Conversation
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/ae57b6df-ffaf-4666-9284-28c65c7f2ced Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/ae57b6df-ffaf-4666-9284-28c65c7f2ced Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
@copilot Rename pool_block -> pool and apply the same config+replacement to 1ES template. |
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/a32e578f-2dbe-490f-b52c-2380cf007de9 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Done in f167cc5. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| apply: apply_codemod, | ||
| }; | ||
|
|
||
| fn apply_codemod(fm: &mut Mapping, _ctx: &CodemodContext) -> Result<bool> { |
There was a problem hiding this comment.
@copilot - we need to translate the previous default
There was a problem hiding this comment.
Fixed in a4e68da. The codemod now translates the legacy default pool: AZS-1ES-L-MMS-ubuntu-22.04 to pool: { vmImage: ubuntu-latest } for non-1ES sources, while preserving name-based translation for target: 1es. Screenshot: N/A (no UI change; compiler/codemod logic only).
There was a problem hiding this comment.
@copilot sorry, should have been cleaer: pool: AZS-1ES-L-MMS-ubuntu-22.04 -> pool: { name:AZS-1ES-L-MMS-ubuntu-22.04 }
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/43e0b1b8-982d-4e55-915d-95a8474898ab Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/ba1c7870-b00a-4daa-9761-7f9f369222a6 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…ct_form codemod
When pool is absent from front matter and the binary version is at or
above 0.30.0 (the release that changed the implicit default from the
1ES self-hosted pool to vmImage: ubuntu-latest), the codemod now injects
pool: { name: AZS-1ES-L-MMS-ubuntu-22.04 } to prevent silent breakage
of existing pipelines.
- Add compiler_version field to CodemodContext
- Gate absent-pool injection on version >= introduced_in
- Add version_gte helper for semver comparison
- Add tests for version-gated and version-ungated behaviour
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: needs changes — one real YAML-corruption bug and one codemod logic issue Findings🐛 Bugs / Logic Issues
os: linux # ← wrong indent, invalid YAML |
Summary
poolfront matter was effectively self-hosted-only (name), which did not model Microsoft-hosted pools correctly for non-1ES targets. This change introduces explicitvmImagesupport and makes non-1ES default tovmImage: ubuntu-latest, while also unifying pool replacement behavior across all templates (including 1ES).Pool schema + compile-time resolution
PoolConfignow supportsnameandvmImagein object form.name:orvmImage:).vmImage: ubuntu-latest.name+os(defaulting toAZS-1ES-L-MMS-ubuntu-22.04andlinux).pool.vmImageis rejected fortarget: 1es.Template wiring
pool_blocktopooland use{{ pool }}consistently across templates.base.yml,job-base.yml,stage-base.yml) now consume{{ pool }}underpool:.{{ pool }}as a block underextends.parameters.pool.Codemod
pool_object_formcodemod for scalar syntax normalization.pool: <string>is rewritten to explicit object form as:pool: { name: <string> }pool: AZS-1ES-L-MMS-ubuntu-22.04→pool: { name: AZS-1ES-L-MMS-ubuntu-22.04 }Docs/tests updates
{{ pool }}semantics and defaults.Test plan
Validated via existing automated suites and updated tests covering pool parsing, template emission, codemod rewrite behavior, unified marker replacement (
{{ pool }}) across targets, and scalar pool codemod normalization to{ name: ... }.