Repository navigation
Add /dashboard API for the dashboard's rerun GitHub writes - #151
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a small, non-task API that lets the transformers-ci dashboard request GitHub writes for its "Re-run failed tests" button. The writes use serge's existing GitHub App, so the dashboard never holds an App key.
Endpoints (
reviewbot/dashboard_api.py). They return 404 unlessDASHBOARD_API_TOKENis set:POST /dashboard/permission{repository, actor}→{role, can_write}, read with the App and cached briefly.POST /dashboard/runs/cancel{repository, actor, run_id}: only runs whose workflow is inDASHBOARD_CANCEL_WORKFLOWS(defaultpr-ci-caller.yml,self-comment-ci.yml).POST /dashboard/workflows/dispatch{repository, actor, workflow, inputs}: only workflows inDASHBOARD_DISPATCH_WORKFLOWS(defaultrerun-failed-cpu.yml,rerun-failed-gpu.yml), always on the default branch, with string inputs of bounded size.Every call needs
Authorization: Bearer <DASHBOARD_API_TOKEN>(compared in constant time). The repository must be inDASHBOARD_REPOSITORIES(defaulthuggingface/transformers), and the acting user must have write access, which serge checks itself./tasksis unchanged. A test checks that the dashboard token is refused there and that OIDC is still required.Deploy: the token reaches the pod through the existing
envFromofserge-secrets, so the only new piece is aDASHBOARD_API_TOKENkey in Infisical. The chart doesn't change. The dashboard side is transformers-citarek/rerun-failed-preview.🤖 Generated with Claude Code