Skip to content

Commit b841998

Browse files
fix(compile): default non-1es vmImage to ubuntu-22.04 (#578)
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/5e8d9cb1-410b-4f30-92d5-1c4468e92ef6 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
1 parent 562ff7f commit b841998

8 files changed

Lines changed: 20 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ the service connections. Approve the permissions and the pipeline is ready.
238238
| `target` | `standalone` \| `1es` \| `job` \| `stage` | `standalone` | Pipeline output format. `job` and `stage` generate reusable ADO YAML templates rather than complete pipelines. |
239239
| `engine` | string or object | `copilot` | Engine identifier or object with `id`, `model`, `timeout-minutes`, etc. |
240240
| `on` | object | — | Unified trigger configuration (`schedule`, `pipeline` completion, `pr` triggers). See [schedule syntax](#schedule-syntax). |
241-
| `pool` | string or object | `vmImage: ubuntu-latest` (standalone) / `AZS-1ES-L-MMS-ubuntu-22.04` (1ES) | Agent pool |
241+
| `pool` | string or object | `vmImage: ubuntu-22.04` (standalone) / `AZS-1ES-L-MMS-ubuntu-22.04` (1ES) | Agent pool |
242242
| `workspace` | `root` \| `repo` \| `self` \| *alias* | auto | Working directory mode. `self` is an alias for `repo`; any checked-out repo alias is also accepted. |
243243
| `repos` | list | — | Compact repository declarations (replaces legacy `repositories:` + `checkout:`) |
244244
| `mcp-servers` | map | — | MCP server configuration |

docs/front-matter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ engine: copilot # Engine identifier. Defaults to copilot. Currently only 'copilo
1818
# timeout-minutes: 30
1919
workspace: repo # Optional: "root", "repo" (alias: "self"), or a checked-out repository alias. If not specified, defaults to "root" when no additional repositories are listed in `repos:`, and to "repo" when one or more additional repos are checked out. See "Workspace Defaults" below.
2020
pool: # Optional pool configuration
21-
vmImage: ubuntu-latest # Microsoft-hosted (default for non-1ES targets)
21+
vmImage: ubuntu-22.04 # Microsoft-hosted (default for non-1ES targets)
2222
# pool: # Self-hosted pool
2323
# name: MySelfHostedPool
2424
# pool: # 1ES pool format

docs/targets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The output contains the same 3-job chain (Agent → Detection → SafeOutputs) a
4242
`standalone`, with:
4343
- Job names prefixed with the agent name for uniqueness (e.g., `DailyReview_Agent`)
4444
- No triggers, pipeline name, or resource declarations (the parent pipeline owns those)
45-
- Pool baked in from the front matter `pool:` field (`vmImage` or `name`; defaults to `vmImage: ubuntu-latest`)
45+
- Pool baked in from the front matter `pool:` field (`vmImage` or `name`; defaults to `vmImage: ubuntu-22.04`)
4646

4747
Example front matter:
4848
```yaml

docs/template-markers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Used by all templates under a `pool:` block and expands to:
217217
- 1ES target: two lines (`name: <pool>` and `os: <linux|windows>`)
218218

219219
Defaults:
220-
- non-1ES: `vmImage: ubuntu-latest`
220+
- non-1ES: `vmImage: ubuntu-22.04`
221221
- 1ES: `name: AZS-1ES-L-MMS-ubuntu-22.04` + `os: linux`
222222

223223
## {{ setup_job }}

prompts/create-ado-agentic-workflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ repos:
153153

154154
### Step 6 — Pool
155155

156-
Default depends on target: standalone uses `vmImage: ubuntu-latest` (Microsoft-hosted); 1ES uses `name: AZS-1ES-L-MMS-ubuntu-22.04`. Only include if overriding the default.
156+
Default depends on target: standalone uses `vmImage: ubuntu-22.04` (Microsoft-hosted); 1ES uses `name: AZS-1ES-L-MMS-ubuntu-22.04`. Only include if overriding the default.
157157

158158
String form (self-hosted pool by name):
159159
```yaml
@@ -163,7 +163,7 @@ pool: MyCustomPool
163163
Object form (Microsoft-hosted or explicit OS):
164164
```yaml
165165
pool:
166-
vmImage: ubuntu-latest # Microsoft-hosted (standalone default)
166+
vmImage: ubuntu-22.04 # Microsoft-hosted (standalone default)
167167
168168
# 1ES pool with explicit OS:
169169
pool:

src/compile/codemods/0002_pool_object_form.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! When the pool field is **absent** and the compiler version is at or
99
//! above `INTRODUCED_IN` (the release that changed the implicit
10-
//! default from the 1ES self-hosted pool to `vmImage: ubuntu-latest`),
10+
//! default from the 1ES self-hosted pool to `vmImage: ubuntu-22.04`),
1111
//! the codemod pins the legacy default explicitly so existing
1212
//! pipelines are not silently broken.
1313
@@ -18,7 +18,7 @@ use super::{Codemod, CodemodContext};
1818
use crate::compile::common::DEFAULT_ONEES_POOL;
1919

2020
/// Version where the pool default changed from the legacy self-hosted
21-
/// pool to `vmImage: ubuntu-latest`.
21+
/// pool to `vmImage: ubuntu-22.04`.
2222
const INTRODUCED_IN: &str = "0.30.0";
2323

2424
pub static CODEMOD: Codemod = Codemod {
@@ -48,7 +48,7 @@ fn apply_codemod(fm: &mut Mapping, ctx: &CodemodContext) -> Result<bool> {
4848
// Pool absent — only inject the legacy default for 1ES
4949
// targets where the old implicit default was the self-hosted
5050
// pool. Non-1ES (standalone/job/stage) targets now default to
51-
// `vmImage: ubuntu-latest`, which is the desired behaviour
51+
// `vmImage: ubuntu-22.04`, which is the desired behaviour
5252
// for new pipelines that omit `pool:`.
5353
if !version_gte(ctx.compiler_version, INTRODUCED_IN) {
5454
return Ok(false);
@@ -104,13 +104,13 @@ mod tests {
104104
#[test]
105105
fn noops_when_pool_is_already_mapping() {
106106
let mut fm: Mapping =
107-
serde_yaml::from_str("name: x\ndescription: y\npool:\n vmImage: ubuntu-latest")
107+
serde_yaml::from_str("name: x\ndescription: y\npool:\n vmImage: ubuntu-22.04")
108108
.unwrap();
109109
let changed = apply_codemod(&mut fm, &ctx("0.30.0")).expect("apply");
110110
assert!(!changed);
111111
assert_eq!(
112112
fm.get(Value::String("pool".into())).cloned(),
113-
Some(serde_yaml::from_str::<Value>("vmImage: ubuntu-latest").unwrap())
113+
Some(serde_yaml::from_str::<Value>("vmImage: ubuntu-22.04").unwrap())
114114
);
115115
}
116116

@@ -129,7 +129,7 @@ mod tests {
129129
#[test]
130130
fn noops_when_pool_absent_standalone_and_version_gte() {
131131
// Standalone pipelines without pool should get the new
132-
// vmImage: ubuntu-latest default, not the legacy 1ES pool.
132+
// vmImage: ubuntu-22.04 default, not the legacy 1ES pool.
133133
let mut fm: Mapping = serde_yaml::from_str("name: x\ndescription: y").unwrap();
134134
let changed = apply_codemod(&mut fm, &ctx("0.30.0")).expect("apply");
135135
assert!(!changed);

src/compile/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ pub fn yaml_double_quoted(s: &str) -> String {
10701070
/// Default self-hosted pool for 1ES templates.
10711071
pub const DEFAULT_ONEES_POOL: &str = "AZS-1ES-L-MMS-ubuntu-22.04";
10721072
/// Default Microsoft-hosted VM image for non-1ES templates.
1073-
pub const DEFAULT_VM_IMAGE_POOL: &str = "ubuntu-latest";
1073+
pub const DEFAULT_VM_IMAGE_POOL: &str = "ubuntu-22.04";
10741074

10751075
/// Resolve the `{{ pool }}` replacement block.
10761076
///
@@ -7073,7 +7073,7 @@ safe-outputs:
70737073
#[test]
70747074
fn test_resolve_pool_block_non_onees_defaults_to_vm_image() {
70757075
let block = resolve_pool_block(CompileTarget::Standalone, None).expect("pool block");
7076-
assert_eq!(block, "vmImage: ubuntu-latest");
7076+
assert_eq!(block, "vmImage: ubuntu-22.04");
70777077
}
70787078

70797079
#[test]
@@ -7114,7 +7114,7 @@ safe-outputs:
71147114
});
71157115
let block =
71167116
resolve_pool_block(CompileTarget::Standalone, Some(&pool)).expect("pool block");
7117-
assert_eq!(block, "vmImage: ubuntu-latest");
7117+
assert_eq!(block, "vmImage: ubuntu-22.04");
71187118
}
71197119

71207120
#[test]

src/compile/types.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub enum CompileTarget {
3232
///
3333
/// # Object format (recommended)
3434
/// pool:
35-
/// vmImage: ubuntu-latest # Microsoft-hosted
35+
/// vmImage: ubuntu-22.04 # Microsoft-hosted
3636
///
3737
/// # Object format (self-hosted)
3838
/// pool:
@@ -56,7 +56,7 @@ impl Default for PoolConfig {
5656
fn default() -> Self {
5757
PoolConfig::Full(PoolConfigFull {
5858
name: None,
59-
vm_image: Some("ubuntu-latest".to_string()),
59+
vm_image: Some("ubuntu-22.04".to_string()),
6060
os: None,
6161
})
6262
}
@@ -1357,19 +1357,19 @@ mod tests {
13571357

13581358
#[test]
13591359
fn test_pool_config_object_vm_image_form() {
1360-
let yaml = "pool:\n vmImage: ubuntu-latest";
1360+
let yaml = "pool:\n vmImage: ubuntu-22.04";
13611361
let fm: serde_yaml::Value = serde_yaml::from_str(yaml).unwrap();
13621362
let pool: PoolConfig = serde_yaml::from_value(fm["pool"].clone()).unwrap();
13631363
assert_eq!(pool.name(), None);
1364-
assert_eq!(pool.vm_image(), Some("ubuntu-latest"));
1364+
assert_eq!(pool.vm_image(), Some("ubuntu-22.04"));
13651365
assert_eq!(pool.os(), "linux");
13661366
}
13671367

13681368
#[test]
13691369
fn test_pool_config_default_is_vm_image() {
13701370
let pool = PoolConfig::default();
13711371
assert_eq!(pool.name(), None);
1372-
assert_eq!(pool.vm_image(), Some("ubuntu-latest"));
1372+
assert_eq!(pool.vm_image(), Some("ubuntu-22.04"));
13731373
assert_eq!(pool.os(), "linux");
13741374
}
13751375

0 commit comments

Comments
 (0)