Group job reads contract v2: libraries from several repositories, the tested pull request's repository as the checkout (MQ-10) #341

Merged
merge-queue merged 2 commits from anvil-group-v2 into main 2026-12-01 01:08:51 -08:00
Owner

Work package: https://openproject.home.romaine.life/wp/MQ-10 (anvil stage 5: lines). Held: it lands with merge-queue's stage 5 change, which starts sending version 2.

The go group job (suites/go/group.yml, suites/go/group.mjs) now reads group contract version 2 as well as version 1, so a pull request in a line can be tested with the library changes ahead of it from several repositories, and the dispatched repository is the tested pull request's (which may be an app's).

Version 2

{"version":2,"repo","sha","libraries":[{"repo","sha","module","dir"}],"members":[{"repo","sha","topics","modules":[{"path","dir"}]}]}

  • repo/sha: the tested pull request's repository and head, the job's checkout (plan still requires GITHUB_REPOSITORY == repo and GITHUB_SHA == sha).
  • Each library carries its repository and commit. One repository is one checkout: a library in repo must be at sha, and a repository listed by several libraries must name one commit.
  • A member in repo must be at sha; a member in a library's repository must be at that library's commit and shares its clone.
  • repo must hold a library or be a member, otherwise the tested change wouldn't be in the workspace. An app's pull request appears as a member at sha and reuses the job checkout.
  • Every other repository is fetched once, at its commit, under _group/<owner>/<name> with the job's read token, even when several modules share it.
  • Package selection is unchanged: the member packages that build any package of any library module.

Removed

  • cloneMembers(group, members), replaced by fetches(group, plan, platform) (which repositories, once each) and cloneRepositories(repos).
  • The "library pull request" wording in the workflow's inputs and comments.

Added

  • parseGroup accepts versions 1 and 2, with the commit rules above enforced through one repository-to-commit map. libraries(group) gives every library as {repo, sha, module, dir} (version 1's are repo at sha).
  • The workspace puts each library module in its repository's checkout: the job's checkout for repo, a clone otherwise.
  • The plan step's log lists each library with its repository and commit; prepare's log counts the repositories fetched.
  • Tests for version 2: validation (commit consistency, duplicate modules and folders, a library repository listed at two commits, an app pull request missing as a member), the workspace layout with libraries from two repositories plus the job checkout, prepare run against local git repositories (each fetched once at its commit, the go.work written), and package selection and results across library repositories.

Left alone

  • Version 1 is accepted exactly as before: same fields (a v1 library naming repo/sha is still refused), same checks, same workspace and fetches. A code comment says it goes once merge-queue sends version 2; a follow-up removes it then.
  • The result line (ANVIL_GROUP_V1), the job and output names, platform planning, services, vet and test.
  • suites/go/dependencies.mjs and modules.mjs (the held mq-8-remove-go-take-up branch).

Verified: pull-request check passed (suite tests 301 passed, 2 skipped, 0 failed; fleet align). group.mjs plan was also run by hand on a version 2 app-PR group (its outputs came out right, and a wrong GITHUB_REPOSITORY was refused).

🤖 Generated with Claude Code

Work package: https://openproject.home.romaine.life/wp/MQ-10 (anvil stage 5: lines). Held: it lands with merge-queue's stage 5 change, which starts sending version 2. The go group job (`suites/go/group.yml`, `suites/go/group.mjs`) now reads group contract version 2 as well as version 1, so a pull request in a line can be tested with the library changes ahead of it from several repositories, and the dispatched repository is the tested pull request's (which may be an app's). ## Version 2 `{"version":2,"repo","sha","libraries":[{"repo","sha","module","dir"}],"members":[{"repo","sha","topics","modules":[{"path","dir"}]}]}` - `repo`/`sha`: the tested pull request's repository and head, the job's checkout (plan still requires GITHUB_REPOSITORY == repo and GITHUB_SHA == sha). - Each library carries its repository and commit. One repository is one checkout: a library in `repo` must be at `sha`, and a repository listed by several libraries must name one commit. - A member in `repo` must be at `sha`; a member in a library's repository must be at that library's commit and shares its clone. - `repo` must hold a library or be a member, otherwise the tested change wouldn't be in the workspace. An app's pull request appears as a member at `sha` and reuses the job checkout. - Every other repository is fetched once, at its commit, under `_group/<owner>/<name>` with the job's read token, even when several modules share it. - Package selection is unchanged: the member packages that build any package of any library module. ## Removed - `cloneMembers(group, members)`, replaced by `fetches(group, plan, platform)` (which repositories, once each) and `cloneRepositories(repos)`. - The "library pull request" wording in the workflow's inputs and comments. ## Added - `parseGroup` accepts versions 1 and 2, with the commit rules above enforced through one repository-to-commit map. `libraries(group)` gives every library as `{repo, sha, module, dir}` (version 1's are `repo` at `sha`). - The workspace puts each library module in its repository's checkout: the job's checkout for `repo`, a clone otherwise. - The plan step's log lists each library with its repository and commit; prepare's log counts the repositories fetched. - Tests for version 2: validation (commit consistency, duplicate modules and folders, a library repository listed at two commits, an app pull request missing as a member), the workspace layout with libraries from two repositories plus the job checkout, `prepare` run against local git repositories (each fetched once at its commit, the go.work written), and package selection and results across library repositories. ## Left alone - Version 1 is accepted exactly as before: same fields (a v1 library naming `repo`/`sha` is still refused), same checks, same workspace and fetches. A code comment says it goes once merge-queue sends version 2; a follow-up removes it then. - The result line (`ANVIL_GROUP_V1`), the job and output names, platform planning, services, vet and test. - `suites/go/dependencies.mjs` and `modules.mjs` (the held mq-8-remove-go-take-up branch). Verified: `pull-request check` passed (suite tests 301 passed, 2 skipped, 0 failed; fleet align). `group.mjs plan` was also run by hand on a version 2 app-PR group (its outputs came out right, and a wrong GITHUB_REPOSITORY was refused). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Group job reads contract v2: libraries from several repositories, the tested pull request's repository as the checkout (MQ-10)
Some checks failed
CI / cache-save (windows-latest) (pull_request) Has been skipped
CI / manifest-check-linux (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Has been skipped
Suite default / check-rules (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 12s
Suite release / scope (pull_request) Successful in 12s
Suite release / module (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
CI / home-cache-windows (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
Suite release / check-manifest (pull_request) Has been skipped
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
CI / service-runtime (two) (pull_request) Successful in 34s
CI / actionlint (pull_request) Successful in 11s
CI / service-runtime (one) (pull_request) Successful in 36s
CI / suite-tests-windows (pull_request) Successful in 1m55s
CI / service-cancellation (pull_request) Successful in 42s
Suite default / check-logs (pull_request) Successful in 15s
CI / suite-tests-linux (pull_request) Successful in 58s
CI / setup-linux (cluster) (pull_request) Has been cancelled
CI / setup-windows (pull_request) Has been cancelled
Suite default / reused-checks (pull_request) Has been cancelled
389cc8d0e6
Version 2 gives each library module its repository and commit, so a pull request in a line is tested with the library changes ahead of it from any repository; the dispatched repository is the tested pull request's, which may hold no library and then is a member at its head. One fetch per repository, shared by its libraries and its member. Version 1 stays accepted unchanged until merge-queue sends version 2.
CI again: pipeline-templates now runs the release suite, which its main requires
All checks were successful
Suite release / reserve (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
CI / manifest-check-linux (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
CI / cache-save (windows-latest) (pull_request) Has been skipped
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite default / check-rules (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / check-manifest (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Tofu providers / lock (pull_request) Successful in 12s
Suite default / scope (pull_request) Successful in 25s
Suite default / check-fetches (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 26s
Suite release / deploy-image (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
CI / suite-tests-windows (pull_request) Successful in 2m11s
Suite default / reused-checks (pull_request) Successful in 20s
CI / service-runtime (two) (pull_request) Successful in 1m6s
Suite default / check-logs (pull_request) Successful in 32s
CI / setup-windows (pull_request) Successful in 3m48s
CI / actionlint (pull_request) Successful in 27s
CI / service-runtime (one) (pull_request) Successful in 1m11s
CI / service-cancellation (pull_request) Successful in 1m26s
CI / suite-tests-linux (pull_request) Successful in 1m48s
CI / setup-linux (cluster) (pull_request) Successful in 4m13s
merge-queue landed on main
1fc738c6b4
merge-queue deleted branch anvil-group-v2 2026-12-01 01:08:52 -08:00
Sign in to join this conversation.
No description provided.