Skip to content

feat(compile): add compact repos: front-matter syntax with codemod auto-rewrite#478

Merged
jamesadevine merged 13 commits intomainfrom
copilot/compact-repositories-setup
May 9, 2026
Merged

feat(compile): add compact repos: front-matter syntax with codemod auto-rewrite#478
jamesadevine merged 13 commits intomainfrom
copilot/compact-repositories-setup

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

Summary

Declaring N additional repositories currently requires writing each one twice — once under repositories: and again under checkout:. This gets verbose and error-prone at scale. Borrowing from gh-aw's "one block per repo" principle, this adds a single repos: field that unifies both with sensible defaults (checkout: true, type: git, ref: refs/heads/main).

Before (10 lines for 3 repos):

repositories:
  - repository: tools
    type: git
    name: my-org/tools
  - repository: schemas
    type: git
    name: my-org/schemas
  - repository: docs
    type: git
    name: my-org/docs
checkout: [tools, schemas, docs]

After (4 lines):

repos:
  - my-org/tools
  - my-org/schemas
  - my-org/docs

Changes

  • src/compile/types.rsRepoEntry struct, ReposItem enum (string shorthand or object) with custom Deserialize, new repos field on FrontMatter. The legacy repositories: and checkout: fields are removed from the typed deserializer (now #[serde(skip)] Rust-only fields populated by lower_repos).
  • src/compile/common.rslower_repos(), parse_shorthand(), derive_alias() for lowering repos: into the existing (Vec<Repository>, Vec<String>) internal representation. resolve_repos is a thin lowering call now that the codemod owns mixing/legacy concerns.
  • src/compile/codemods/0001_repos_unified.rs — new front-matter codemod (registered in the CODEMODS registry introduced in feat(compile): autorewrite front matter via detection-based codemods #476) that auto-rewrites old sources from repositories: + checkout: into the new repos: shape in raw YAML before typed deserialization. Maps repository:alias:, preserves name/type/ref, emits explicit checkout: false only for entries that weren't in the original checkout: list, and carries unknown repository keys forward for forward-compat. Idempotent on already-current sources, rejects mixing repos: with the legacy fields, and rejects dangling checkout: aliases. Returns a true no-op (Ok(false)) when both repositories: and checkout: are trivially empty, so the caller does not surface a "deprecated shapes" warning or rewrite the file just to drop empty stubs.
  • src/compile/codemods/mod.rs / helpers.rs — wire the new codemod into the CODEMODS registry; remove the TODO(codemods) placeholder annotations now that a real codemod has shipped; update helper docs to refer to "codemods".
  • src/compile/mod.rs / src/main.rs — wire lower_repos(&fm.repos) into both compile paths and the execute command (which now uses parse_markdown_detailed so Stage 3 benefits from in-memory codemod fixes when a source has deprecated shapes). run_execute now calls front_matter.sanitize_config_fields() before resolve_repos(), mirroring compile_pipeline_inner and check_pipeline, so unsanitized repo.name values cannot flow into ctx.allowed_repositories.
  • docs/front-matter.md — document the new syntax, object fields, examples, and a back-compat note pointing at docs/codemods.md.
  • Existing tests updatedtest_fixture_complete_agent now asserts repos:; the complete-agent.md fixture is normalized to the unified repos: shape (the codemod rewrites it on first compile).

Supported forms

repos:
  - my-org/tools                    # shorthand, alias="tools"
  - schemas=my-org/internal-schemas # explicit alias
  - name: my-org/templates          # object form
    ref: refs/heads/release/2.x
    checkout: false                 # resource-only, not cloned

Back-compat

Old sources are auto-rewritten by the front-matter codemod framework on the next ado-aw compile — users see a warning, the file is updated in place, and the build moves on. The typed deserializer no longer accepts the legacy fields directly (the codemod runs first against the raw YAML mapping).

Test plan

  • 18 unit tests for the repos: lowering covering shorthand, object form, checkout: false, alias= syntax, duplicate alias rejection, reserved name rejection, trailing slash handling, and empty-name/empty-alias errors.
  • 11 unit tests for the 0001_repos_unified codemod plus an explicit idempotency test, covering full conversion, resource-only entries (repositories: without checkout:), preserved ref, mixing rejection, dangling checkout: aliases, no-op on already-current shapes, trivially-empty repositories: returning a no-op, non-mapping rejection, and forward-compat carry-over of unknown keys.
  • Full suite passes (cargo test, 1419 tests).

Copilot AI and others added 2 commits May 8, 2026 19:57
Replace the verbose `repositories:` + `checkout:` pair with a single
`repos:` block. Each entry can be a string shorthand ("org/repo" or
"alias=org/repo") or an object with name/alias/type/ref/checkout fields.
Checkout defaults to true. Legacy fields remain supported with a
deprecation warning; mixing the two is rejected at compile time.

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/c9ae0fbb-1f1c-4874-b990-16fd3b4bc3e3

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
- Handle trailing slash in derive_alias (trim before splitting)
- Add tests for reserved alias via explicit alias (shorthand & object)
- Add test for empty name after '=' in shorthand
- Add test for trailing slash alias derivation

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/c9ae0fbb-1f1c-4874-b990-16fd3b4bc3e3

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot rebase on feat/frontmatter-migrations and implement a front matter migration for this breaking change.

jamesadevine and others added 5 commits May 8, 2026 21:38
Introduces a Django/Rails-style schema-version field on FrontMatter and a
registered migration framework so breaking grammar changes auto-migrate
existing user sources during compile rather than hard-failing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Address code review finding: the runner did `1 + registry.len() as u32`
and `m.to_version == current + 1` without overflow checks. With
realistic registries this is unreachable, but rust panics on overflow
in debug mode and wraps in release. Switch to checked_add so we
surface a clear error either way; preserves existing behavior on all
realistic inputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Four findings from the Rust PR Reviewer bot:

1. check_pipeline's bail message had a redundant "error:" prefix that
   produced "Error: error: ..." once anyhow's top-level handler added
   its own "Error:" wrapper. Drop the prefix and reformat the hint
   onto an indented continuation line.

2. compile_pipeline_inner did a redundant serde_yaml::from_value
   round-trip just to satisfy ParsedSource.front_matter, even though
   perform_source_rewrite_if_needed never reads that field. Refactor
   the helper to take the four primitive fields it actually uses
   (mapping, body_raw, source_sha256, migrations) instead of the full
   struct. reconstruct_source likewise takes individual fields now.

3. Misleading comment in tests/migration_tests.rs claimed a
   "thread-local counter" was used; only a nanosecond timestamp was.
   Replaced rand_suffix() with timestamp + AtomicU64 monotonic seq so
   parallel tests scheduled in the same nanosecond always get
   distinct dirs.

4. Leading whitespace before the opening `---` was silently stripped
   on migration rewrite. parse_markdown_detailed already tolerates it
   on read; capture it as a new ParsedSource.leading_whitespace field
   and emit it from reconstruct_source so byte-faithful preservation
   extends to whitespace prefixes (BOM-stripped editor blank lines,
   etc.).

All 1369 tests still pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
…gration framework

Rebased on feat/frontmatter-migrations and added 0001_repos_unified
migration so existing sources are auto-rewritten to the new compact
`repos:` shape on compile. With the migration in place, the legacy
fields are removed from FrontMatter; the typed deserializer now only
accepts `repos:`. The migration runner ensures any source that still
declares `repositories:`/`checkout:` is converted (and stamped to
schema-version 2) before typed deserialization runs.

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/c4473df6-4e6d-4a84-9fa7-74f55749dc78

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

@copilot rebase on feat/frontmatter-migrations and implement a front matter migration for this breaking change.

Done in 9c0c7ba. Rebased onto feat/frontmatter-migrations and added migration 0001_repos_unified that auto-converts old repositories: + checkout: blocks into the new compact repos: shape on compile. With the migration in place, the legacy fields are gone from FrontMatter (typed deserializer only accepts repos:) — any unmigrated source goes through the migration runner first, gets rewritten in place, and the build moves on.

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:

  • spsprodeus21.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw_derive-200f38d8081bcd5a/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/migration_tests-438e8e1762438f14.2u2o29i9078l09xm73oy4dpjd.10jtekb.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw_derive-200f38d8081bcd5a/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/migration_tests-438e8e1762438f14.2ufhgd5elerbyrtb589xfnhyp.10jtekb.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw_derive-200f38d8081bcd5a/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/migration_tests-438e8e1762438f14.30zzyuc0tulcxfz9rfei0xnm3.10jtekb.rcgu.o g/de�� ib a.00igun306yv9ds3ti0xkv5rp3.0zqgk2u.rcgu.o a.02kk1nq6rea7fdmau7eyzi3xh.0zqgk2u.rcgu.o a.04kj5yr08kg3lyc9qj8jnv6hi.0zqgk2u.rcgu.o a.07h4p0dbej4bzcy6d7e9w2jgn.0zqgk2u.rcgu.o a.0a35cat0rllqjh95wgkorbn18.0zqgk2u.rcgu.o a.0f844ebank2zpfzk0ahujc2ct.0zqgk2u.rcgu.o a.0iy2zj4q7vhxa5idkfbsfu4l0.0zqgk2u.rcgu.o a.0js196oqo8nxxy3r1nv1rdbxi.0zqgk2u.rcgu.o a.0t8199d1usqxf5010a01gtire.0zqgk2u.rcgu.o a.0u7509smcuwo5os4ju77q7jeo.0zqgk2u.rcgu.o a.0zzv2mhl9y0uspvvkk1en9z6h.0zqgk2u.rcgu.o a.123w8riw2xk2gb4akpd78tyy0.0zqgk2u.rcgu.o a.1ipnyscq7xzqct01izgeqc668.0zqgk2u.rcgu.o a.1jflsllpbaz4ftramkubaw55h.0zqgk2u.rcgu.o (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb l5vcio89xw6jdd2q2p1sa7s.0x4ols9.rcgu.o f42a2m5jyhitpfu9kgr012w.0x4ols9.rcgu.o yxvbdnrlypihiyfq2lv3ytl.0x4ols9.rcgu.o 0o7d2rxa7fela81eo3j0qkh.0x4ols9.rcgu.o ktmth2x38v6om1xugkqljh6.0x4ols9.rcgu.o oactqqzp7tm83av8o1iran5.0x4ols9.rcgu.o vephsnrn4m5011pitkzcd84.0x4ols9.rcgu.o 20kqdunqvvv3rxbuhwogw5o.0x4ols9.rcgu.o xnfjge4nc6y5x5qexb8rczk.0x4ols9.rcgu.o nuwp5lg9zar58c4o4o47prq.0x4ols9.rcgu.o 57ipg36au9tczmjr1fwql24.0x4ols9.rcgu.o kpuq�� x7wy5ahhzc2fhnac8c1gl26.0x4ols9.rcgu.o p25uopmgtrxrgtyln0xdlko.0x4ols9.rcgu.o known-linux-gnu//home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/mcp_http_tests-c4d61c568188294--noprofile c1063f.rlib build.4f5c4c2236remote 0bv3qx8g5buv.rcgget-url -f6d12dc65cce50corigin (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb 6i13k5gzyzpbiay4remote f/similar-3.1.0/get-url git remo�� get-url origin k/_temp/ghcca-node/node/bin/git mbols.o 56537b23e1e8.0j6remote 56537b23e1e8.0saget-url git remo�� get-url origin -aw 56537b23e1e8.203/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw 56537b23e1e8.20wcompile lib/rustlib/x86_/tmp/agentic-pipeline-wiki-pass-14652/wiki-agent.md -aw (dns block)
  • spsprodweu4.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw_derive-200f38d8081bcd5a/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/migration_tests-438e8e1762438f14.2u2o29i9078l09xm73oy4dpjd.10jtekb.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw_derive-200f38d8081bcd5a/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/migration_tests-438e8e1762438f14.2ufhgd5elerbyrtb589xfnhyp.10jtekb.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw_derive-200f38d8081bcd5a/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/migration_tests-438e8e1762438f14.30zzyuc0tulcxfz9rfei0xnm3.10jtekb.rcgu.o g/de�� ib a.00igun306yv9ds3ti0xkv5rp3.0zqgk2u.rcgu.o a.02kk1nq6rea7fdmau7eyzi3xh.0zqgk2u.rcgu.o a.04kj5yr08kg3lyc9qj8jnv6hi.0zqgk2u.rcgu.o a.07h4p0dbej4bzcy6d7e9w2jgn.0zqgk2u.rcgu.o a.0a35cat0rllqjh95wgkorbn18.0zqgk2u.rcgu.o a.0f844ebank2zpfzk0ahujc2ct.0zqgk2u.rcgu.o a.0iy2zj4q7vhxa5idkfbsfu4l0.0zqgk2u.rcgu.o a.0js196oqo8nxxy3r1nv1rdbxi.0zqgk2u.rcgu.o a.0t8199d1usqxf5010a01gtire.0zqgk2u.rcgu.o a.0u7509smcuwo5os4ju77q7jeo.0zqgk2u.rcgu.o a.0zzv2mhl9y0uspvvkk1en9z6h.0zqgk2u.rcgu.o a.123w8riw2xk2gb4akpd78tyy0.0zqgk2u.rcgu.o a.1ipnyscq7xzqct01izgeqc668.0zqgk2u.rcgu.o a.1jflsllpbaz4ftramkubaw55h.0zqgk2u.rcgu.o (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb l5vcio89xw6jdd2q2p1sa7s.0x4ols9.rcgu.o f42a2m5jyhitpfu9kgr012w.0x4ols9.rcgu.o yxvbdnrlypihiyfq2lv3ytl.0x4ols9.rcgu.o 0o7d2rxa7fela81eo3j0qkh.0x4ols9.rcgu.o ktmth2x38v6om1xugkqljh6.0x4ols9.rcgu.o oactqqzp7tm83av8o1iran5.0x4ols9.rcgu.o vephsnrn4m5011pitkzcd84.0x4ols9.rcgu.o 20kqdunqvvv3rxbuhwogw5o.0x4ols9.rcgu.o xnfjge4nc6y5x5qexb8rczk.0x4ols9.rcgu.o nuwp5lg9zar58c4o4o47prq.0x4ols9.rcgu.o 57ipg36au9tczmjr1fwql24.0x4ols9.rcgu.o kpuq�� x7wy5ahhzc2fhnac8c1gl26.0x4ols9.rcgu.o p25uopmgtrxrgtyln0xdlko.0x4ols9.rcgu.o known-linux-gnu//home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/mcp_http_tests-c4d61c568188294--noprofile c1063f.rlib build.4f5c4c2236remote 0bv3qx8g5buv.rcgget-url -f6d12dc65cce50corigin (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb 6i13k5gzyzpbiay4remote f/similar-3.1.0/get-url git remo�� get-url origin k/_temp/ghcca-node/node/bin/git mbols.o 56537b23e1e8.0j6remote 56537b23e1e8.0saget-url git remo�� get-url origin -aw 56537b23e1e8.203/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw 56537b23e1e8.20wcompile lib/rustlib/x86_/tmp/agentic-pipeline-wiki-pass-14652/wiki-agent.md -aw (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title feat(compile): add compact repos: front-matter syntax feat(compile): add compact repos: front-matter syntax with auto-migration May 8, 2026
Copilot AI requested a review from jamesadevine May 8, 2026 21:40
@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot Undo that last change, then rebase on feat/frontmatter-migrations and implement a front matter codemod for this breaking change.

@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot Undo that last change, then rebase on feat/frontmatter-migrations and implement a front matter codemod for this breaking change.

@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot Undo that last change, then rebase on main and implement a front matter codemod for this breaking change.

Copilot AI and others added 4 commits May 9, 2026 07:23
Replace the verbose `repositories:` + `checkout:` pair with a single
`repos:` block. Each entry can be a string shorthand ("org/repo" or
"alias=org/repo") or an object with name/alias/type/ref/checkout fields.
Checkout defaults to true. Legacy fields remain supported with a
deprecation warning; mixing the two is rejected at compile time.

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/c9ae0fbb-1f1c-4874-b990-16fd3b4bc3e3

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
- Handle trailing slash in derive_alias (trim before splitting)
- Add tests for reserved alias via explicit alias (shorthand & object)
- Add test for empty name after '=' in shorthand
- Add test for trailing slash alias derivation

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/c9ae0fbb-1f1c-4874-b990-16fd3b4bc3e3

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
…heckout: rewrite

Replaces the previous front-matter migration framework approach with the
codemod framework merged in #476. The new 0001_repos_unified codemod
detects the legacy repositories: + checkout: shape in raw YAML and
rewrites it in place to the unified repos: shape before typed
deserialization. Idempotent on already-current sources.

Drops the typed repositories: / checkout: fields from FrontMatter (now
#[serde(skip)] Rust-only fields populated by lower_repos); the codemod
runs first so user YAML never reaches typed deserialization with legacy
keys. resolve_repos is simplified accordingly — the codemod owns the
mixing/legacy concerns.

Updates docs/front-matter.md to point at docs/codemods.md.

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot Undo that last change, then rebase on main and implement a front matter codemod for this breaking change.

Done in 6058baa. Reset onto main (which has the codemod framework from #476), replayed the repos: feature on top, and added 0001_repos_unified codemod that rewrites legacy repositories: + checkout: blocks to the unified repos: shape in place on the next compile. Idempotent on already-current sources; mixing the legacy fields with repos: is rejected. The previous migration framework approach is gone.

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:

  • spsprodeus21.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb q7yhkqtwd1wzuylijnl.0nsu2hy.rcgu.o dkfhr3gyvs7mdowyrx7.0nsu2hy.rcgu.o 0kz7folhyytheiuifxk.0nsu2hy.rcgu.o c2kmnx1ivhjag4aso1y.0nsu2hy.rcgu.o gdkgetw0tcjgdvft4aj.0nsu2hy.rcgu.o .0gqkochn7we10rou8mw21r90d.0fti3cz.rcgu.o .0jd4zj8vefh5p5o96fxz37q3w.0fti3cz.rcgu.o .0qb2gykddmt5brzwuwcbd0247.0fti3cz.rcgu.o .11j7ks6n1ivd60poddhjt2e2x.0fti3cz.rcgu.o .1kxdzpd5ys8tnyobzx39opwyy.0fti3cz.rcgu.o .1ldj7wk0knk7830w9m79v3915.0fti3cz.rcgu.o .1n298hzzyws4rhcdsb6xggltd.0fti3cz.rcgu.o .2icbsajqr04t6jur9gh87p8cq.0fti3cz.rcgu.o .2z59sjgbrtppmrtaoayis4yo7.0fti3cz.rcgu.o .32ve5ix0smukzf7d4vmxme0iw.0fti3cz.rcgu.o .347q30renxh0dm6wd3nshtz7z.0fti3cz.rcgu.o .3d3dx08ydzvlpmt1axac7eapc.0fti3cz.rcgu.o .3r7sw012yzlgj9odgczciui70.0fti3cz.rcgu.o .3ud900p8b5pfwdj935p76vc02.0fti3cz.rcgu.o (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb k/ado-aw/ado-aw/remote k/ado-aw/ado-aw/get-url stup/toolchains/origin k/ad�� target/debug/deps/rustcxFOIYH/symbols.o target/debug/deps/codemod_tests-205480007c8b16a3.0gqkochn7we10rou8mw21r90d.0fti3cz.rcgu.o -aw target/debug/depgit target/debug/depremote ld.lld -aw targ�� ipeline-trigger-agent.md ld.lld e-trigger-agent.yml target/debug/depgit target/debug/depremote target/debug/depget-url target/debug/deporigin (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb u5hqo361ey62ur7fremote qqbd3cersmtofqseget-url git remo�� get-url origin tnet/tools/git 8raxrkeqy0m45w7sgit 6i13k5gzyzpbiay4remote -1949cf8c6b5b557get-url git remo�� get-url origin de/node/bin/git mbols.o 56537b23e1e8.0j6remote 56537b23e1e8.0saget-url git (dns block)
  • spsprodweu4.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb q7yhkqtwd1wzuylijnl.0nsu2hy.rcgu.o dkfhr3gyvs7mdowyrx7.0nsu2hy.rcgu.o 0kz7folhyytheiuifxk.0nsu2hy.rcgu.o c2kmnx1ivhjag4aso1y.0nsu2hy.rcgu.o gdkgetw0tcjgdvft4aj.0nsu2hy.rcgu.o .0gqkochn7we10rou8mw21r90d.0fti3cz.rcgu.o .0jd4zj8vefh5p5o96fxz37q3w.0fti3cz.rcgu.o .0qb2gykddmt5brzwuwcbd0247.0fti3cz.rcgu.o .11j7ks6n1ivd60poddhjt2e2x.0fti3cz.rcgu.o .1kxdzpd5ys8tnyobzx39opwyy.0fti3cz.rcgu.o .1ldj7wk0knk7830w9m79v3915.0fti3cz.rcgu.o .1n298hzzyws4rhcdsb6xggltd.0fti3cz.rcgu.o .2icbsajqr04t6jur9gh87p8cq.0fti3cz.rcgu.o .2z59sjgbrtppmrtaoayis4yo7.0fti3cz.rcgu.o .32ve5ix0smukzf7d4vmxme0iw.0fti3cz.rcgu.o .347q30renxh0dm6wd3nshtz7z.0fti3cz.rcgu.o .3d3dx08ydzvlpmt1axac7eapc.0fti3cz.rcgu.o .3r7sw012yzlgj9odgczciui70.0fti3cz.rcgu.o .3ud900p8b5pfwdj935p76vc02.0fti3cz.rcgu.o (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb k/ado-aw/ado-aw/remote k/ado-aw/ado-aw/get-url stup/toolchains/origin k/ad�� target/debug/deps/rustcxFOIYH/symbols.o target/debug/deps/codemod_tests-205480007c8b16a3.0gqkochn7we10rou8mw21r90d.0fti3cz.rcgu.o -aw target/debug/depgit target/debug/depremote ld.lld -aw targ�� ipeline-trigger-agent.md ld.lld e-trigger-agent.yml target/debug/depgit target/debug/depremote target/debug/depget-url target/debug/deporigin (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb u5hqo361ey62ur7fremote qqbd3cersmtofqseget-url git remo�� get-url origin tnet/tools/git 8raxrkeqy0m45w7sgit 6i13k5gzyzpbiay4remote -1949cf8c6b5b557get-url git remo�� get-url origin de/node/bin/git mbols.o 56537b23e1e8.0j6remote 56537b23e1e8.0saget-url git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

…migrations)

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/32568271-c9c7-4a9c-a0f8-37d10b112446

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot AI changed the title feat(compile): add compact repos: front-matter syntax with auto-migration feat(compile): add compact repos: front-matter syntax with codemod auto-rewrite May 9, 2026
@jamesadevine
Copy link
Copy Markdown
Collaborator

/rust-review

@jamesadevine jamesadevine marked this pull request as ready for review May 9, 2026 07:36
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Rust PR Reviewer completed successfully!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

🔍 Rust PR Review

Summary: Looks good overall — solid design and strong test coverage. One missing sanitization call and a minor codemod edge case worth addressing.

Findings

🐛 Bugs / Logic Issues

  • src/main.rs:250run_execute skips sanitization before lowering repos

    compile_pipeline_inner (mod.rs:147) and check_pipeline (mod.rs:536) both call front_matter.sanitize_config_fields() before resolve_repos(). The run_execute path does not. Unsanitized repo.name values flow into ctx.allowed_repositories via build_execution_context (main.rs:305). Add front_matter.sanitize_config_fields() before line 250, mirroring the compile/check paths.

    // main.rs, after line 247
    use crate::sanitize::SanitizeConfig;
    front_matter.sanitize_config_fields();
    
    let (resolved_repos, resolved_checkout) = compile::resolve_repos(&front_matter)
  • src/compile/codemods/0001_repos_unified.rs:~200 — empty repositories: [] produces changed=true

    When repositories: is an empty sequence the codemod removes the key, sets repos_seq = [], skips inserting repos:, and returns Ok(true). The changed=true signal causes the caller to warn the user about deprecated shapes and rewrite the source file, even though the semantic content is unchanged. Return Ok(false) when repositories_seq is empty (before processing any entries), to keep the no-op guarantee for trivially empty sources.

✅ What Looks Good

  • Custom Deserialize for ReposItem (types.rs) is clean — handles both string shorthand and object form idiomatically via deserialize_any.
  • split_once('=') in parse_shorthand is the right tool; avoids splitting on = within a repo name.
  • Codemod idempotency is explicitly tested (idempotent_when_run_twice) — this is the most important invariant for codemods and it's good to see it as a first-class test case.
  • Forward-compat unknown-key carry-over prevents data loss when users have undocumented ADO resources.repositories fields.
  • BTreeSet for matched-alias tracking gives deterministic iteration order in error messages.
  • Sanitization is wired into ReposItem::sanitize() and called from FrontMatter::sanitize_config_fields() before lowering in the compile and check paths.
  • 30 total unit tests with good coverage of edge cases (duplicate aliases, reserved names, trailing slashes, empty alias/name rejection, dangling checkout aliases).

Generated by Rust PR Reviewer for issue #478 · ● 1.2M ·

@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot implement bug fixes

…ing, no-op on empty repositories:)

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/512194bf-d86b-457b-b919-752efb1eff3d

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot implement bug fixes

Addressed rust-review bugs in da9d474:

  • run_execute now calls front_matter.sanitize_config_fields() before resolve_repos(), mirroring compile_pipeline_inner and check_pipeline, so unsanitized repo.name values cannot flow into ctx.allowed_repositories.
  • 0001_repos_unified codemod now returns Ok(false) when both repositories: and checkout: are trivially empty — the vacuous keys still get cleaned up but no rewrite warning fires. Test updated to use run_noop.

Full suite (1419 tests) passes.

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:

  • https://api.github.com/repos/githubnext/ado-aw/issues/comments/4411906752
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/repos/githubnext/ado-aw/issues/comments/4411935476
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • spsprodeus21.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb sync_trait.a0ce32b56b003c25-cgu.01.rcgu.o sync_trait.a0ce32b56b003c25-cgu.02.rcgu.o sync_trait.a0ce32b56b003c25-cgu.03.rcgu.o sync_trait.a0ce32b56b003c25-cgu.04.rcgu.o sync_trait.a0ce32b56b003c25-cgu.05.rcgu.o .0gqkochn7we10rou8mw21r90d.00uuplu.rcgu.o .0jd4zj8vefh5p5o96fxz37q3w.00uuplu.rcgu.o .0qb2gykddmt5brzwuwcbd0247.00uuplu.rcgu.o .11j7ks6n1ivd60poddhjt2e2x.00uuplu.rcgu.o .1kxdzpd5ys8tnyobzx39opwyy.00uuplu.rcgu.o .1ldj7wk0knk7830w9m79v3915.00uuplu.rcgu.o .1n298hzzyws4rhcdsb6xggltd.00uuplu.rcgu.o .2icbsajqr04t6jur9gh87p8cq.00uuplu.rcgu.o .2z59sjgbrtppmrtaoayis4yo7.00uuplu.rcgu.o .32ve5ix0smukzf7d4vmxme0iw.00uuplu.rcgu.o .347q30renxh0dm6wd3nshtz7z.00uuplu.rcgu.o .3d3dx08ydzvlpmt1axac7eapc.00uuplu.rcgu.o .3r7sw012yzlgj9odgczciui70.00uuplu.rcgu.o .3ud900p8b5pfwdj935p76vc02.00uuplu.rcgu.o (dns block)
  • spsprodweu4.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-9143a4cd0b5c71cb sync_trait.a0ce32b56b003c25-cgu.01.rcgu.o sync_trait.a0ce32b56b003c25-cgu.02.rcgu.o sync_trait.a0ce32b56b003c25-cgu.03.rcgu.o sync_trait.a0ce32b56b003c25-cgu.04.rcgu.o sync_trait.a0ce32b56b003c25-cgu.05.rcgu.o .0gqkochn7we10rou8mw21r90d.00uuplu.rcgu.o .0jd4zj8vefh5p5o96fxz37q3w.00uuplu.rcgu.o .0qb2gykddmt5brzwuwcbd0247.00uuplu.rcgu.o .11j7ks6n1ivd60poddhjt2e2x.00uuplu.rcgu.o .1kxdzpd5ys8tnyobzx39opwyy.00uuplu.rcgu.o .1ldj7wk0knk7830w9m79v3915.00uuplu.rcgu.o .1n298hzzyws4rhcdsb6xggltd.00uuplu.rcgu.o .2icbsajqr04t6jur9gh87p8cq.00uuplu.rcgu.o .2z59sjgbrtppmrtaoayis4yo7.00uuplu.rcgu.o .32ve5ix0smukzf7d4vmxme0iw.00uuplu.rcgu.o .347q30renxh0dm6wd3nshtz7z.00uuplu.rcgu.o .3d3dx08ydzvlpmt1axac7eapc.00uuplu.rcgu.o .3r7sw012yzlgj9odgczciui70.00uuplu.rcgu.o .3ud900p8b5pfwdj935p76vc02.00uuplu.rcgu.o (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@jamesadevine jamesadevine merged commit 3e67cfd into main May 9, 2026
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.

2 participants