Skip to content

Reduce rate limiting and reduce time taken for acceptance tests - #14320

Merged
williammartin merged 19 commits into
trunkfrom
williammartin-workflow-run-acceptance
Sep 9, 2026
Merged

williammartin merged 19 commits into
trunkfrom
williammartin-workflow-run-acceptance

Conversation

@williammartin

@williammartin williammartin commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Part of #14353

Description

With these changes, a safe-from-limiting run of the acceptance tests drops from around 40 minutes to 6 minutes.

See Key Points for flake concerns, but in manually burning down flakes I haven't seen another rate limit

The acceptance suite has historically created a fresh repository for almost every test. That gives each script strong isolation, but it also makes the suite slow and puts sustained pressure on GitHub's repository-creation limits. The tests that can run with a GitHub App installation token created about 97 repositories per operating system. Running the same suite on Linux, macOS, and Windows would therefore attempt roughly 291 repository creations against one installation whose repository-creation limit is 150 per hour.

This change separates test isolation from repository isolation. Every acceptance script now explicitly chooses one of three repository modes:

  • shared reuses one initialized private repository when a test can coexist with concurrent and accumulated state.
  • isolated creates one private repository when a test needs clean state, changes repository-wide behavior, or performs multiple coordinated Git ref updates.
  • none leaves repository ownership to the script when it needs multiple repositories, public visibility, special creation options, or lifecycle coverage.

A process-scoped fixture manager creates and cleans up managed repositories. The harness statically validates that every script makes exactly one choice and rejects direct gh repo create calls from managed scripts. Shared tests use unique resource names, commit contents, or commit messages; captured IDs; filtered and paginated queries; and explicit $ORG/$REPO targeting so that concurrent or unrelated resources cannot affect their assertions. Related repository-scoped operations that perform multiple Git ref updates are consolidated into one isolated script so they can run sequentially without contending with shared-repository traffic.

The migration also removes 27 clones that existed only to give gh repository context; those tests now use GH_REPO instead. Discussions are enabled while the shared repository is created, avoiding repeated configuration requests. Tests that require public repositories, including organization-secret and ruleset coverage on GitHub Free, continue to create and clean up their own repositories.

The resulting suite creates about 46 repositories per operating system, or 138 across a three-platform run. That is about 153 fewer repository creations than before and keeps one complete matrix below an installation's hourly repository-creation limit. Live Code Search coverage is consolidated from nine HTTP requests across three concurrent scripts to four requests in one script, leaving headroom in its 10 requests-per-minute token bucket. Workflow-producing tests poll for run registration with a bounded timeout. The repository includes a writing-acceptance-tests skill so future test changes preserve these isolation, synchronization, and performance properties.

How did you test this change?

➜  williammartin-automatic-waffle git:(williammartin-workflow-run-acceptance) time env \
  GH_ACCEPTANCE_HOST=github.com \
  GH_ACCEPTANCE_ORG=gh-acceptance-testing \
  GH_ACCEPTANCE_TOKEN="$(gh auth token --hostname github.com)" \
  go test -tags=acceptance -count=1 ./acceptance
ok      github.com/cli/cli/v2/acceptance        348.250s
env GH_ACCEPTANCE_HOST=github.com GH_ACCEPTANCE_ORG=gh-acceptance-testing  go  57.86s user 33.58s system 26% cpu 5:50.12 total

I intentionally added one script without fixture metadata and one managed-fixture script that ran gh repo create, then ran:

$ go test ./acceptance -run '^TestAcceptanceScriptsDeclareFixtureRepository$' -count=1
--- FAIL: TestAcceptanceScriptsDeclareFixtureRepository (0.03s)
    --- FAIL: TestAcceptanceScriptsDeclareFixtureRepository/testdata/pr/zzz-linter-direct-create.txtar (0.00s)
        user_capability_test.go:82:
            Error:       Received unexpected error:
                         testdata/pr/zzz-linter-direct-create.txtar: scripts using a managed fixture repository must not run gh repo create; either remove gh repo create or use:
                           fixture-repo none
            Test:        TestAcceptanceScriptsDeclareFixtureRepository/testdata/pr/zzz-linter-direct-create.txtar
    --- FAIL: TestAcceptanceScriptsDeclareFixtureRepository/testdata/pr/zzz-linter-missing.txtar (0.00s)
        user_capability_test.go:82:
            Error:       Received unexpected error:
                         testdata/pr/zzz-linter-missing.txtar: script must contain exactly one fixture-repo declaration; choose one:
                           fixture-repo shared REPO
                           fixture-repo isolated REPO
                           fixture-repo none

                         Use shared when concurrent scripts can safely reuse the repository, isolated
                         when the script needs clean or repository-global state, and none when the
                         script creates its own repositories or does not need one.
                         See acceptance/README.md#script-metadata for details.
            Test:        TestAcceptanceScriptsDeclareFixtureRepository/testdata/pr/zzz-linter-missing.txtar
FAIL
FAIL    github.com/cli/cli/v2/acceptance    0.375s
FAIL

Key points

This is the bottom layer of a stack.

The shared repository is deliberately limited to tests whose resources can coexist. Tests that rename, archive, transfer, delete, or globally reconfigure a repository remain isolated or own their repositories. Managed repository creation and deletion through fixture isolated is serialized inside the fixture manager. This avoids trading GitHub rate-limit pressure for a burst of concurrent requests.

I sort of expect that there will be a follow up of burning down flakes, and we should introduce an automated triage flow for that. I have manually addressed a number of them already.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @williammartin will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted.
  • Nobody has explicitly committed to replying.

Copilot AI balanced review requested due to automatic review settings September 2, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new capability-based filtering branches lack focused tests, risking silent execution of an incorrect test subset.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity acceptance/​acceptance_test.go — 🛑 Requirement: Cover the capability-based script-selection branches. The existing tests validate…
What changed in this PR

Adds a manually dispatched, cross-platform acceptance-test workflow using a GitHub App installation token.

Changes:

  • Adds OS and command-group workflow selection.
  • Filters tests by user-token requirements.
  • Updates documentation and token-log redaction support.
File Description
.github/​workflows/​acceptance.yml Adds the manual acceptance workflow.
acceptance/​acceptance_test.go Groups and filters acceptance tests.
acceptance/​user_capability_test.go Adds token and metadata validation.
acceptance/​README.md Documents workflow and metadata.
go.mod Updates token-redaction dependency.
go.sum Records updated checksums.
acceptance/​testdata/​api/​basic-graphql.txtar Uses an installation-compatible API query.
acceptance/​testdata/​api/​basic-rest.txtar Uses an installation-compatible API request.
acceptance/​testdata/​auth/​auth-login-logout.txtar Declares token capability requirement.
acceptance/​testdata/​auth/​auth-setup-git.txtar Declares token capability requirement.
acceptance/​testdata/​auth/​auth-status.txtar Declares token capability requirement.
acceptance/​testdata/​auth/​auth-token.txtar Declares token capability requirement.
acceptance/​testdata/​discussion/​discussion-comment.txtar Declares token capability requirement.
acceptance/​testdata/​discussion/​discussion-create.txtar Declares token capability requirement.
acceptance/​testdata/​discussion/​discussion-edit.txtar Declares token capability requirement.
acceptance/​testdata/​discussion/​discussion-list.txtar Declares token capability requirement.
acceptance/​testdata/​discussion/​discussion-view.txtar Declares token capability requirement.
acceptance/​testdata/​extension/​extension-env.txtar Declares token capability requirement.
acceptance/​testdata/​extension/​extension.txtar Declares token capability requirement.
acceptance/​testdata/​gpg-key/​gpg-key.txtar Requires user authentication.
acceptance/​testdata/​issue/​issue-comment-edit-last-with-comments.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-comment-edit-last-without-comments-creates.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-comment-edit-last-without-comments-errors.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-comment-new.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-create-basic.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-create-edit-with-project.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-create-with-metadata.txtar Requires user authentication.
acceptance/​testdata/​issue/​issue-develop-worktree-cross-repo.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-develop-worktree.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-list.txtar Declares token capability requirement.
acceptance/​testdata/​issue/​issue-view.txtar Declares token capability requirement.
acceptance/​testdata/​issues-2.0/​issue-create-and-edit-issue-type.txtar Declares token capability requirement.
acceptance/​testdata/​issues-2.0/​issue-create-and-edit-parent.txtar Declares token capability requirement.
acceptance/​testdata/​issues-2.0/​issue-create-and-edit-relationships.txtar Declares token capability requirement.
acceptance/​testdata/​issues-2.0/​issue-edit-sub-issues.txtar Declares token capability requirement.
acceptance/​testdata/​issues-2.0/​issue-list-filter-by-type.txtar Declares token capability requirement.
acceptance/​testdata/​issues-2.0/​issue-view-issues-2.0-fields.txtar Declares token capability requirement.
acceptance/​testdata/​label/​label.txtar Declares token capability requirement.
acceptance/​testdata/​org/​org-list.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-checkout-by-number.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-checkout-with-url-from-fork.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-checkout-worktree-detach.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-checkout-worktree-from-fork.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-checkout-worktree.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-checkout.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-comment-edit-last-with-comments.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-comment-edit-last-without-comments-creates.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-comment-edit-last-without-comments-errors.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-comment-new.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-create-basic.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-create-edit-with-project.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-create-from-issue-develop-base.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-create-from-manual-merge-base.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-create-guesses-remote-from-sha-with-branch-name-slash.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-guesses-remote-from-sha.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-no-local-repo.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-create-push-default-upstream-no-merge-ref-fork.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-push-default-upstream-no-merge-ref.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-remote-ref-with-branch-name-slash.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-respects-branch-pushremote.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-respects-push-destination.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-respects-remote-pushdefault.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-respects-simple-pushdefault.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-create-respects-user-colon-branch-syntax.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-with-metadata.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-create-without-upstream-config.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-list.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-merge-merge-strategy.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-merge-rebase-strategy.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-status-respects-cross-org.txtar Requires user authentication.
acceptance/​testdata/​pr/​pr-view-outside-repo.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-view-same-org-fork.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-view-status-respects-branch-pushremote.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-view-status-respects-push-destination.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-view-status-respects-remote-pushdefault.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-view-status-respects-simple-pushdefault.txtar Declares token capability requirement.
acceptance/​testdata/​pr/​pr-view.txtar Declares token capability requirement.
acceptance/​testdata/​project/​project-create-delete.txtar Declares token capability requirement.
acceptance/​testdata/​release/​release-create.txtar Declares token capability requirement.
acceptance/​testdata/​release/​release-delete.txtar Declares token capability requirement.
acceptance/​testdata/​release/​release-list.txtar Declares token capability requirement.
acceptance/​testdata/​release/​release-upload-download.txtar Declares token capability requirement.
acceptance/​testdata/​release/​release-view.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-archive-unarchive.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-autolink.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-clone.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-create-bare.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-create-view.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-delete.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-deploy-key.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-edit.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-fork-sync.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-list-rename.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-read-dir.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-read-file.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-rename-transfer-ownership.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-set-default.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-sync-worktree.txtar Declares token capability requirement.
acceptance/​testdata/​repo/​repo-sync.txtar Declares token capability requirement.
acceptance/​testdata/​ruleset/​ruleset.txtar Declares token capability requirement.
acceptance/​testdata/​search/​search-issues.txtar Declares token capability requirement.
acceptance/​testdata/​secret/​secret-org-with-selected-visibility.txtar Declares token capability requirement.
acceptance/​testdata/​secret/​secret-org.txtar Declares token capability requirement.
acceptance/​testdata/​secret/​secret-repo-env.txtar Declares token capability requirement.
acceptance/​testdata/​secret/​secret-repo.txtar Declares token capability requirement.
acceptance/​testdata/​secret/​secret-require-remote-disambiguation.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-force.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-from-local.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-invalid-agent.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-invalid-repo.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-namespaced.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-nested-files.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-nonexistent-skill.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-pin.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install-scope.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-install.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-preview-noninteractive.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-preview.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-publish-dir-remote.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-publish-dry-run.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-publish-lifecycle.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-search-noresults.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-search-page.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-search.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-update-inplace.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-update-noinstalled.txtar Declares token capability requirement.
acceptance/​testdata/​skills/​skills-update.txtar Declares token capability requirement.
acceptance/​testdata/​ssh-key/​ssh-key.txtar Requires user authentication.
acceptance/​testdata/​telemetry/​accessibility-dimensions-disabled.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​accessibility-dimensions.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​agent-dimensions.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​command-invocation.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​no-telemetry-for-alias.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​no-telemetry-for-completion.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​no-telemetry-for-extension.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​no-telemetry-for-ghes-user.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​no-telemetry-for-send-telemetry.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​telemetry-failure-does-not-break-command.txtar Declares token capability requirement.
acceptance/​testdata/​telemetry/​telemetry-for-official-extension-stub.txtar Declares token capability requirement.
acceptance/​testdata/​variable/​variable-org.txtar Declares token capability requirement.
acceptance/​testdata/​variable/​variable-repo-env.txtar Declares token capability requirement.
acceptance/​testdata/​variable/​variable-repo.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​cache-list-delete.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​cache-list-empty.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​run-cancel.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​run-delete.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​run-download.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​run-rerun.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​run-view-log-escape-sequences.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​run-view.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​workflow-enable-disable.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​workflow-list.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​workflow-run.txtar Declares token capability requirement.
acceptance/​testdata/​workflow/​workflow-view.txtar Declares token capability requirement.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread acceptance/acceptance_test.go Resolved
ondrajodas added a commit to ondrajodas/PRism that referenced this pull request Sep 2, 2026
`DiffMarginWheelProbe` measures a scene the probe built itself — one file of
2000 lines — so it cannot answer whether switching to `Změněné soubory` lags in
practice. `DiffMarginSharpProbe` measures real diffs (PRism#499, cli/cli#14104,
cli/cli#14320) and adds the gesture the lag was reported on: switching the tab,
where the content is thrown away and laid out again.

Findings on one of them are real: a review over PRism#499 ran through the same
path the app uses and reported two findings, so the eleven the probe scatters
are an upper bound, not a picture.

The margin costs the same as bubbles, i.e. as the state before #503 (+2 % on two
PRs, and on the third its lower series is below bubbles). What costs is having
findings drawn at all (+19/24/40 % over no findings), and the dominant term is
the number of files: 850 → 1184 → 1657 ms for 45 → 71 → 158 files with no
findings at all.

Wheel scrolling over sharp data stayed unmeasured: the session had a locked
screen, so the gesture was not delivered and the probe refused to record it.
ondrajodas added a commit to ondrajodas/PRism that referenced this pull request Sep 2, 2026
…540)

* feat(diff): stand finding cards in a margin beside their rows (#503)

Pravý sloupec v tabu `Změněné soubory` se stal okrajem: karta nálezu stojí
na výšce svého řádku, řádek s kartou má na pravé hraně 3bodový pruh
závažnosti a mezi nimi vede spojnice. Dvě karty na sousedních řádcích se
odstrkují a spojnice se zalomí do `L`. Kód zůstal souvislý — bubliny pod
řádky se přestěhovaly za přepínač `Nálezy pod řádky`, aby šlo obojí měřit.

Karta vzniká z dat (`Policy.marginCards`), poloha z geometrie
(`DiffMarginAnchors`); nález bez řádku v okraji není a zůstává jako bublina
u hlavičky souboru. Karty se nasazují stejným pásem jako bloky kódu
a posun s výřezem dělá jediný modifikátor, který čte `DiffViewport.top`.
Panel vpravo se pod okrajem složí na proužek, `⌘2` ho vrátí.

* test(diff): measure the margin on real pull request diffs

`DiffMarginWheelProbe` measures a scene the probe built itself — one file of
2000 lines — so it cannot answer whether switching to `Změněné soubory` lags in
practice. `DiffMarginSharpProbe` measures real diffs (PRism#499, cli/cli#14104,
cli/cli#14320) and adds the gesture the lag was reported on: switching the tab,
where the content is thrown away and laid out again.

Findings on one of them are real: a review over PRism#499 ran through the same
path the app uses and reported two findings, so the eleven the probe scatters
are an upper bound, not a picture.

The margin costs the same as bubbles, i.e. as the state before #503 (+2 % on two
PRs, and on the third its lower series is below bubbles). What costs is having
findings drawn at all (+19/24/40 % over no findings), and the dominant term is
the number of files: 850 → 1184 → 1657 ms for 45 → 71 → 158 files with no
findings at all.

Wheel scrolling over sharp data stayed unmeasured: the session had a locked
screen, so the gesture was not delivered and the probe refused to record it.

* fix(diff): subtract the side columns instead of negotiating them

Reported from clicking through the slot build: in `Změněné soubory` the diff
content slid under the collapsed panel strip on the right, with `+347 −0`
bitten off in the file header.

`Policy.diffSideColumns` decided from the layout alone, so the tree (210), the
code and the margin (300) met in one `HStack` whose flexible child sits in the
middle — and an `HStack` tips the part that does not fit to the right, i.e.
under the strip. `DiffView` never read its own slot width at all, which is the
same class as #220, one column over.

Measured in a 700 pt window (the `RootView` floor): 35 pt of overflow with the
margin, 16 pt without, in both layouts. Across the whole grid (width band ×
layout × margin × manual ⌘1/⌘2, 64 cases) the overflow is now 0.

The width is now an input and the columns are subtracted: the code never gives
way, the tree goes first (⌘1 brings it back), and the margin only after that —
and never so that a finding is left with nowhere to show, so dropping the margin
expands the panel that takes the cards over. That feedback is monotone, so it
settles on the first pass. Column widths moved to `Policy`, because the same
numbers decide whether a column fits.

* test(diff): measure the column intersection, not just the sum

The sum-based measurement cannot see a strip painted over the content: the
scroller frame is the same for "works" and "fails". The probe therefore reads
the strip edges from the bitmap and reports the intersection, and the width band
now reaches 1792 — the width that follows from inverting `charactersPerSide`
over the `72 znaků na stranu` in the report.

Ondra's scene (1100 x 700, side by side, tree and panel collapsed) does not
reproduce: the columns sit next to each other (code 86..762, margin 763..1062,
strip 1063..1100), the sum is exactly 1100 and the file header draws in full.
What does not match is the number in the toolbar - 31 characters per side here
against 72 there, which implies a code column of ~1349 pt and a window of
~1780 pt.

No test comes out of this round, deliberately: the margin and the collapsed
strip share the same fill, so a run from the window edge is both of them at once
and cards break it. A green test over that instrument would assert nothing.
Written down as a gap, together with the four small intersections that the grid
did find at the 700 floor.

* test(diff): ask charactersPerSide instead of inverting it

The live slot window is 1303 x 860, not 1100 x 700, and the band sampled
700/1100/1400 - so that width fell between samples and was never tested. The
height was not either, and cards in the margin stack by height.

At that width the reported scene (side by side, tree and panel collapsed, PR
with findings) is clean: code 86..965, margin 965..1265, strip 1265..1303, the
sum lands on the point and the intersection is -36 left and -301 right. Only the
four small ones at the 700 floor stay positive.

Asking the function settles the number in the toolbar: at 1303 side by side
takes 44 characters per side with the margin and 62 without, while stacked takes
70 and 74. The reported 72 is therefore a stacked number, and 62 is the ceiling
side by side. `charactersPerSide` itself is healthy; the inversion was wrong
twice - 8.2 instead of 8.036 per character, and assuming the margin was drawn.

The gauge does not keep the previous view's number either: a scene built stacked
(703 pt, 70 characters) and switched to side by side shows 44. That hypothesis is
a paid dead end and is written down as one.

* fix(diff): give the code column air before the right-hand column

Measured on the live window (1303 x 860, side by side, tree and panel
collapsed): the code column ends at 1264.5, the divider sits at 1265.0 and the
panel strip starts at 1266.0. The divider is there and is visible (29303D
against 23262E code and 1E222D strip) - what was missing is air. The text was
clipped flat against it, and half a glyph pushed onto the edge reads as "the
text goes under the strip" rather than "the text continues and is clipped".

Six points, applied outside `fillingSlot` so the gap comes off the slot and
`contentWidth` still measures the area that is actually typeset. Six is less
than one character (8.036), so the gap costs no column of text.

The edge assertion is deliberately absent and written down as a gap: comparing
"space left" against "margin + strip + gap" passed with a gap of zero, because
the scene the probe builds is not the view handed to it - it came out stacked
with the tree open, where the remainder lands on the bound exactly. The
constant is pinned instead, and that one does fail with a zero gap.

* docs(diff): write down the unresolved gauge reading as a gap

The live window reports 71 characters per side where the measured column is
1178.5 and the formula gives 62. Neither hosted scene reproduces it: main's
toolbar prints 62 for its 1179 column and the #503 branch prints 44 and 62 for
its own, all read off renders rather than derived. So it is neither a regression
from #503 nor a defect of main, and what is left is an undemonstrated
hypothesis with arithmetic behind it - contentWidth holding the whole window
width, the 130 point difference matching rail plus tree plus strip.

Deciding it needs contentWidth in the drawing diagnostics, not a guess, so it is
recorded as a gap instead of blocking a finished branch.
@williammartin
williammartin force-pushed the williammartin-workflow-run-acceptance branch from 1e2a71e to 154e974 Compare September 4, 2026 09:12
@oscar544-cmyk

This comment was marked as spam.

@williammartin
williammartin force-pushed the williammartin-workflow-run-acceptance branch 5 times, most recently from 9b00307 to 5f0dc84 Compare September 4, 2026 15:42
@williammartin williammartin changed the title Add manual acceptance test workflow Reduce acceptance test repository creation Sep 4, 2026
# Basic graphql request
exec gh api graphql -f query='query { viewer { login } }'
stdout '"login":' No newline at end of file
exec gh api graphql -f query='query { rateLimit { limit } }' --jq .data.rateLimit.limit

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually for a follow up in the stack that avoids needing a user capability, but it's simple enough for now I think

# Basic REST request
exec gh api /user
stdout '"login":' No newline at end of file
exec gh api /rate_limit --jq .rate.limit

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually for a follow up in the stack that avoids needing a user capability, but it's simple enough for now I think

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new contributor skill’s mandatory cleanup rule conflicts with both the README and multiple migrated scripts.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity .github/​skills/​writing-acceptance-tests/​SKILL.md — 🛑 Requirement: Align this cleanup rule with the migrated scripts. This says every none script…
Issues resolved since last review (1)
Severity Finding
Low severity acceptance/​acceptance_test.go — 🛑 Requirement: Cover the capability-based script-selection branches. The existing tests validate… View resolved comment

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Make concurrent merge commits distinct and keep live Code Search coverage within a token-wide request budget.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Poll for workflow run registration and serialize pull request merge strategy coverage within the shared repository.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
@williammartin
williammartin force-pushed the williammartin-workflow-run-acceptance branch from ea80f6f to dcef13b Compare September 8, 2026 19:01
@williammartin
williammartin marked this pull request as ready for review September 8, 2026 19:01
@williammartin
williammartin requested a review from a team as a code owner September 8, 2026 19:01
@williammartin williammartin changed the title Reduce acceptance test repository creation Reduce rate limiting and reduce time taken for acceptance tests Sep 8, 2026
@williammartin
williammartin requested review from BagToad and removed request for sergiou87 September 8, 2026 19:02
@williammartin
williammartin marked this pull request as draft September 8, 2026 19:02
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The release archive test expects a filename that retains the stripped leading v, causing its new assertion to fail.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity

New issues introduced by this change (1)
Severity Finding
High severity acceptance/​testdata/​release/​release-upload-download.txtar — 🛑 Requirement: The expected archive name retains the tag's leading v, but GitHub's codeload…
Issues resolved since last review (1)
Severity Finding
Low severity .github/​skills/​writing-acceptance-tests/​SKILL.md — 🛑 Requirement: Align this cleanup rule with the migrated scripts. This says every none script… View resolved comment

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
@williammartin
williammartin marked this pull request as ready for review September 9, 2026 11:08

@babakks babakks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! As long as tests are passing and faster, I'm super happy with this. Great job! 🎉

Just added a nit, but that's just it.

Comment thread acceptance/acceptance_test.go Resolved
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
@williammartin
williammartin merged commit 9b6585b into trunk Sep 9, 2026
11 checks passed
@williammartin
williammartin deleted the williammartin-workflow-run-acceptance branch September 9, 2026 14:37
blackhorseya added a commit to blackhorseya/git-why that referenced this pull request Sep 13, 2026
## Summary

- v0.2.1 收尾時記下的已知缺口:`reviewThreads(first: 100)` 沒分頁,超過 100 個 thread 的 PR
會靜默少掉後面的,目標檔案的 thread 若排在後面就不會出現在「Review discussion」。
- `pullRequestQuery` 多取 `reviewThreads.pageInfo.hasNextPage`;只有 `pick`
選出的 PR 回報還有下一頁時,`Client.threads` 才做第二次呼叫:`gh api graphql --paginate` 跑
`threadsQuery`,由 gh 自己追 `endCursor`,抓齊該 PR 全部 thread
並整批取代第一頁(分頁從頭開始,不接續,避免重複)。
- `--paginate` 的 stdout 是多份 JSON
文件直接串接、無分隔(`}}}}}{"data"…`),`parseThreads` 用 `json.Decoder`
迴圈解;`hasGraphQLError` 同步改成迴圈,中途失敗的那一頁也能被歸類。
- `$number` 是 GraphQL `Int!`,用 `-F` 傳 typed 值;`-f` 送字串會被 API 以 `Could
not coerce value to Int` 拒絕(實際打 API 確認)。
- 第二次呼叫失敗或輸出不可解 → 整個 lookup 失敗變成 note,不會靜默退回第一頁(靜默缺 thread 正是這次要修的 bug)。
- `testrepo.StubGHCalls(t, first, second, …)` 依呼叫次序回不同 stdout,`Calls()`
計數;`StubGH` 行為不變。
- CLAUDE.md:invariant 從「一次 `gh api graphql`」改成「一次,外加被選中 PR 有下一頁時的一次
`--paginate`」,並記下 `-F` 與串接輸出兩點;testing notes 補 `StubGHCalls`。

兩個刻意的取捨:

- `githubTimeout` 十秒涵蓋兩次呼叫;thread 極多又網路慢時,會從「PR 有顯示、thread 缺一些」變成「GitHub
lookup timed out」。選 fail-loud。
- `associatedPullRequests(first: 5)` 與 `closingIssuesReferences(first:
5)` 維持不分頁。

## Test plan

- [x] `task test`(`go test -race`)、`task lint` 全綠;`go mod tidy -diff`
無變更
- [x]
新測試:`TestParsePullRequestsMoreThreads`、`TestParseThreads`、`TestParseThreadsErrors`、`TestPullRequestFetchesAllThreads`(兩次呼叫、`--paginate`、`-F
number=42`)、`TestPullRequestThreadPagesFail`、e2e
`TestRunShowsThreadsBeyondFirstPage`(第二頁的 thread 出現在 Review discussion)
- [x] 真實 gh:built binary 對本 repo 跑第一段查詢正常(顯示 #10)
- [x] 真實 gh:`threadsQuery` 原文對 cli/cli#14320 跑 `first: 100`(單頁)與 `first:
1`(六頁串接),餵進 `parseThreads` 都正確解出 6 個 thread
- [ ] 未驗到:真實 GitHub 上超過 100 個 thread 的 PR
觸發兩段呼叫的接合(cli/cli、vscode、kubernetes 近百筆 merged PR 裡沒找到);這段接合由 stub e2e
覆蓋

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012CY2X5HUN5fwT3NXScTwUa
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.

4 participants