Thanks to visit codestin.com
Credit goes to github.com

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

Reduce rate limiting and reduce time taken for acceptance tests#14320
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 Outdated
@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

Comment thread .github/skills/writing-acceptance-tests/SKILL.md Outdated
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

Comment thread acceptance/testdata/release/release-upload-download.txtar
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
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