Skip to content

fix(ci): grant pull-requests write to comment-gateway feedback jobs - #2720

Merged
guapisolo merged 7 commits into
mainfrom
jiajun/fix-gateway-ack-403
Aug 23, 2026
Merged

fix(ci): grant pull-requests write to comment-gateway feedback jobs#2720
guapisolo merged 7 commits into
mainfrom
jiajun/fix-gateway-ack-403

Conversation

@guapisolo

@guapisolo guapisolo commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make /rerun-test report a real test run from running state through final result in one PR comment.

Motivation

/rerun-test feedback was not trustworthy: the PR comment linked a seconds-long permission probe rather than the dispatched test, showed no in-progress state or elapsed time, and did not update with the test result. The old comment linked run 32637432938, whose jobs only exercised feedback permissions.

Usage

Post /rerun-test tests/fast/backends/test_fsdp_routing_replay.py. The command receives a success reaction, and a status comment shows the exact run as running. At completion, that same comment ID changes to passed, failed, or cancelled with the suite and elapsed time.

Design Notes

  • Mental model: The default-branch gateway authorizes the command before dispatching run-ci-file.yml against the exact PR head. The run creates a status comment whose ID flows through resolver/execution into an always() finalizer; the finalizer maps job results to a terminal state, reads run_started_at, then patches that ID.
  • Boundary: PR-targeted reaction/status calls use issues: write plus pull-requests: write, while the finalizer adds actions: read. Removing the gateway's static reply-command leaves one status owner; /rerun-failed-ci, label commands, PR-head checkout, and fork secret withholding are unchanged.
  • Reference: The ID-based state ownership follows SGLang's slash_command_handler.py, with updates from update_rerun_test_status.py. Miles uses one run-owned comment with whole-workflow elapsed time instead of per-batch lines.

Verification

  • tests/ci/test/test_comment_ci_command.py + tests/ci/test/test_file_run.py: 298 passed; Black and Ruff passed.
  • run 32658550696 at 8a29d8366d: executed pytest tests/fast/backends/test_fsdp_routing_replay.py -v -x, collected 27 tests, and passed all 27.
  • comment 5387769462: retained the same ID from running to passed on stage-a-cpu in 3m10s.

Review Focus

  • run-ci-file.yml: the test waits for the status comment ID, and every terminal path reaches the finalizer.
  • comment_ci_command.py: only execution success reports passed; invalid status inputs fail closed.

The acknowledge-command and reply-command jobs call the issues API
against comments that always live on pull requests, and GitHub gates
issues-API calls whose target issue is a PR on the pull-requests scope,
so issues: write alone returned HTTP 403 on both feedback POSTs
(evidence: run 32630924734 — dispatch succeeded, both feedback jobs
failed). Grant pull-requests: write to the two jobs, pin the new
permission blocks in the workflow invariant test, and record the
scope rule in the command-identity doc.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@guapisolo

Copy link
Copy Markdown
Collaborator Author

/rerun-test tests/fast/backends/test_fsdp_routing_replay.py

guapisolo and others added 3 commits August 23, 2026 04:39
Temporary evidence workflow, removed before merge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Started /rerun-test tests/fast/backends/test_fsdp_routing_replay.py.

View workflow run

guapisolo and others added 3 commits August 23, 2026 04:47
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Evidence captured in runs 32637432938 (A/B on a same-repository comment)
and 32637525392 (fork PR comment reactions).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

tests/fast/backends/test_fsdp_routing_replay.py passed on stage-a-cpu in 3m10s — workflow run

@guapisolo

Copy link
Copy Markdown
Collaborator Author

quick merge to unblock

@guapisolo
guapisolo merged commit dfb4dfa into main Aug 23, 2026
30 checks passed
@guapisolo
guapisolo deleted the jiajun/fix-gateway-ack-403 branch August 23, 2026 19:27
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.

1 participant