Skip to content

ci: the merge queue runs the affected package set, not the full list (maintainer-directed, part A of the test-cost programme) #16453

Description

@claude

Filed by the skills lane seat (session session_019RfFHiRCSs3JXLK4cwcfox, os-steve) on the maintainer's direction, 2026-09-07T02:1xZ, and dispatched by the same seat on that direction. Surface owner stays domain:devx.

Authority (maintainer, verbatim, live PM chat 2026-09-07): the question 「我想的是测试会不会太多,是否都是必要的,是不是应该砍,每次修改都要完整的测试吗」, then on the seat's three-part answer (A queue runs the affected set · B tiers + slowest-files report · C contract obligations narrowed): 「同意,这几个都处理,你现在就负责派发」. This card is part A.

What

merge_group runs of the CI workflow compute the Test Core package set with turbo's --affected against the merge group's base, unioned with the same cross-package scans the pull_request branch already applies, instead of the full package list. push runs on main keep the full list: they gate nobody and they are the ground truth the shard-timings refresh reads.

Measured

  • .github/workflows/ci.yml, step "Compute this shard's package set": the --affected branch is reachable only on pull_request; push and merge_group take the full-list else path by design (the step's own comment says so). Cross-package scans are unioned only on the pull_request branch.
  • Cost: a full Test Core run is ~85–90 minutes of test compute (six shards on main at 23:22Z / 00:15Z / 00:45Z: 12.1 / 7.5 / 10.8 / 9.8 / 27.7 / 22.1 min and similar). The four governed PRs merged at 01:18Z touched only .claude/** and still ran 15–20-minute shards in their queue builds. At ~120 merges a day the queue spends on the order of 150 machine-hours a day verifying packages the merge did not touch.
  • The affected-set machinery on PRs is measured to work: docs-only PRs run six ~1-minute shards.

Ruling

  1. On merge_group, TURBO_SCM_BASE is the group's base (github.event.merge_group.base_sha), and the changed-file list for the cross-package scan union is git diff --name-only BASE_SHA HEAD. Any failure to resolve the base or to run the scans falls back to the full list, loudly, exactly as the PR branch does.
  2. An EMPTY selection on merge_group is legitimate (a docs-only group has nothing to test) and must produce an honest green through the existing "no packages on this shard" path and the attestation roster; it is not the [finding] Nothing distinguishes "zero packages affected" from "the affected-set computation silently produced nothing" — an empty changed-files.txt is never checked #10057 case, which is PR-only. State this in the step's comment and prove it (see acceptance).
  3. push on main: unchanged, full list.
  4. Clause-②: yes — the required Test Core check verifies a narrower set at merge time. Contract tier.

Acceptance

Refs #16173.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions