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

Skip to content

Run acceptance tests in Actions with a GitHub App token - #14356

Merged
williammartin merged 3 commits into
trunkfrom
williammartin-acceptance-app-workflow
Sep 10, 2026
Merged

Run acceptance tests in Actions with a GitHub App token#14356
williammartin merged 3 commits into
trunkfrom
williammartin-acceptance-app-workflow

Conversation

@williammartin

@williammartin williammartin commented Sep 4, 2026

Copy link
Copy Markdown
Member

Description

The live acceptance suite is currently manual to assemble and depends on a maintainer supplying a user OAuth token. This adds a manually dispatched workflow that mints a GitHub App installation token for gh-acceptance-testing and runs either the complete suite or one selected command group on Linux, macOS, Windows, or all three. A small dispatch helper discovers command groups from the testdata directories and dispatches the workflow from the selected branch or tag in cli/cli, without requiring maintainers to expose a user token.

This is the top layer of a three-layer native PR stack. It depends on #14354, which depends on #14320. The lower layers retain responsibility for token-capability policy and fixture repository/clone reductions; this layer does not change fixture classification or capability policy. The outcome is that maintainers can run the installation-compatible suite across all supported runner platforms while user-capability tests are skipped by the middle layer.

How did you test this change?

I ran script/run-acceptance groups and saw the discovered testdata groups, exercised its help and invalid platform paths, and replaced gh with a recording test double to confirm a Windows PR-group dispatch selects the requested branch with --ref and sends the command and operating-system inputs to acceptance.yml. With a recorded in-progress run, I saw a warning before a non-interactive dispatch continued. In a pseudo-terminal, I answered n to the confirmation prompt and saw that no dispatch occurred. I did not dispatch the live workflow because it must first exist on the selected branch or tag.

Key points

The workflow uses an installation-wide token because the suite dynamically creates repositories in the dedicated test organization. Each platform job mints its own one-hour token. The helper warns when another acceptance workflow is in flight and asks interactive users to confirm another dispatch because overlapping or closely spaced runs can exhaust the App installation's rate-limit buckets. Non-interactive callers receive the warning and continue.

The workflow is dispatched from the branch or tag being tested, so GitHub limits the selectable revision to refs in cli/cli rather than accepting an arbitrary checkout ref. Before App credentials become available, the gh-acceptance-testing environment requires approval from cli/code-reviewers; self-review and administrator bypass are disabled.

Notes for reviewers

Start with .github/workflows/acceptance.yml, then review script/run-acceptance and the incremental workflow guidance in acceptance/README.md.

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 8, 2026 14:33
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 8ab3a6e to e6759b8 Compare September 8, 2026 14:33

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 helper validates groups against the current checkout rather than the selected test revision.

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

Review tier: Balanced
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity script/​run-acceptance — 🛑 Requirement: Validate command groups against the revision being tested When REF names a…
What changed in this PR

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

Changes:

  • Adds the multi-platform acceptance workflow.
  • Adds a dispatch helper with group and OS selection.
  • Documents workflow operation and test-authoring guidance.
File Description
.github/​workflows/​acceptance.yml Defines the App-token acceptance workflow.
script/​run-acceptance Dispatches selected refs, groups, and platforms.
acceptance/​README.md Documents workflow usage and App setup.
.github/​skills/​writing-acceptance-tests/​SKILL.md Clarifies dynamic group discovery.

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

Comment thread script/run-acceptance Outdated
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from e6759b8 to dd0891c Compare September 8, 2026 15:01
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from dd0891c to 59914ac Compare September 8, 2026 15:28
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 59914ac to a74882f Compare September 8, 2026 15:50
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from a74882f to b9f80d8 Compare September 8, 2026 17:50
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from b9f80d8 to 4887fc9 Compare September 8, 2026 18:29
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 4887fc9 to fb27f6d Compare September 8, 2026 18:43
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from fb27f6d to d5fb2b8 Compare September 8, 2026 19:04
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from d5fb2b8 to 6790be4 Compare September 8, 2026 19:31
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 6790be4 to 11e54f3 Compare September 9, 2026 08:08
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 11e54f3 to 15a621b Compare September 9, 2026 09:02
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 15a621b to 87b84ca Compare September 9, 2026 09:58
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 87b84ca to be33098 Compare September 9, 2026 10:37
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from be33098 to ae10cca Compare September 9, 2026 11:22
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from ae10cca to 46bca95 Compare September 9, 2026 14:15
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 46bca95 to 85737a3 Compare September 9, 2026 14:37
Base automatically changed from williammartin-acceptance-token-capabilities to trunk September 9, 2026 17:52
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f67f4129-93de-45b1-a68d-702334aa7fe9
@williammartin
williammartin force-pushed the williammartin-acceptance-app-workflow branch from 85737a3 to ca0e191 Compare September 9, 2026 17:52
@williammartin
williammartin requested a balanced review from Copilot September 10, 2026 10:13
@williammartin
williammartin marked this pull request as ready for review September 10, 2026 10:15
@williammartin
williammartin requested a review from a team as a code owner September 10, 2026 10:15

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

Ref validation uses the wrong checkout, and the documented dispatch and environment protections are contradictory.

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

Review tier: Balanced
Findings: 2 Medium severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
Medium severity script/​run-acceptance — 🛑 Requirement: Correct the claimed dispatch-ref behavior The helper always passes trunk to `gh…
Low severity acceptance/​README.md — 🛑 Requirement: Reconcile the environment protection description This says the environment has no…
Pre-existing issues (1)
Severity Finding
Medium severity script/​run-acceptance — 🛑 Requirement: Validate command groups against the revision being tested When REF names a… View comment
Suppressed comments (1)

script/run-acceptance:67

  • 🛑 Requirement: Validate command groups against the revision being tested

This list comes from the helper's local checkout, not from ref. Running the helper from trunk to test a branch that adds a new group rejects that valid group before dispatch; the reverse accepts a group that the target revision does not contain and only fails in Actions. Please either resolve groups from the selected revision or defer this validation to the acceptance harness after checkout.

command_values=()
while IFS= read -r group; do
  command_values+=("$group")
done < <(test_groups)
if ! contains "$command" "${command_values[@]}"; then

Comment thread script/run-acceptance Outdated
Comment thread acceptance/README.md Outdated
@williammartin williammartin changed the title Run acceptance tests with a GitHub App token Run acceptance tests in Actions with a GitHub App token Sep 10, 2026

@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; just one question.

GH_ACCEPTANCE_ORG: gh-acceptance-testing
GH_ACCEPTANCE_TOKEN: ${{ steps.acceptance-token.outputs.token }}
GH_ACCEPTANCE_GROUP: ${{ inputs.command }}
run: go test -tags=acceptance ./acceptance

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.

question: do we want an explicit timeout other than go's default (10m)?

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.

I'm gonna start with saying no because if this takes more than 10 mins I want to know 🤣

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: bb46ae80-3bec-4092-bb94-65698edd9833
@williammartin
williammartin requested a balanced review from Copilot and removed request for sergiou87 September 10, 2026 11:21

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

Back-to-back runs can exceed the hourly repository limit, and group validation can differ from the dispatched revision.

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

Review tier: Balanced
Findings: 3 Medium severity

New issues introduced by this change (2)
Severity Finding
Medium severity .github/​workflows/​acceptance.yml — 🛑 Requirement: Add rate-limit pacing between full runs A three-platform run creates about 138…
Medium severity .github/​workflows/​acceptance.yml — 🛑 Requirement: Preserve every dispatched run With the default concurrency queue,…
Pre-existing issues (1)
Severity Finding
Medium severity script/​run-acceptance — 🛑 Requirement: Validate command groups against the revision being tested When REF names a… View comment
Issues resolved since last review (2)
Severity Finding
Low severity acceptance/​README.md — 🛑 Requirement: Reconcile the environment protection description This says the environment has no… View resolved comment
Medium severity script/​run-acceptance — 🛑 Requirement: Correct the claimed dispatch-ref behavior The helper always passes trunk to `gh… View resolved comment
Suppressed comments (1)

script/run-acceptance:66

  • 🛑 Requirement: Validate command groups against the dispatched revision

The allowed groups are read from this local checkout, but ref may select a different branch or tag. When the target revision adds or removes a group, this helper either rejects a valid target group or dispatches a group that the target harness rejects. Resolve the ref before validation and discover groups from that revision, or verify and document that the local checkout must match the requested ref.

command_values=()
while IFS= read -r group; do
  command_values+=("$group")
done < <(test_groups)
if ! contains "$command" "${command_values[@]}"; then

Comment thread .github/workflows/acceptance.yml Outdated
Comment thread .github/workflows/acceptance.yml Outdated
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: bb46ae80-3bec-4092-bb94-65698edd9833

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

🔵 Needs a closer look

The workflow performs broad live organization mutations with new credentials and has not been exercised end to end.

Review tier: Balanced
Findings: None

Issues resolved since last review (3)
Severity Finding
Medium severity .github/​workflows/​acceptance.yml — 🛑 Requirement: Preserve every dispatched run With the default concurrency queue,… View resolved comment
Medium severity .github/​workflows/​acceptance.yml — 🛑 Requirement: Add rate-limit pacing between full runs A three-platform run creates about 138… View resolved comment
Medium severity script/​run-acceptance — 🛑 Requirement: Validate command groups against the revision being tested When REF names a… View resolved comment

@williammartin
williammartin merged commit c265dd8 into trunk Sep 10, 2026
10 checks passed
@williammartin
williammartin deleted the williammartin-acceptance-app-workflow branch September 10, 2026 11:55
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.

3 participants