Skip to content

ci: let PR Hygiene post its verdicts to the dashboard - #1634

Merged
shumkov merged 1 commit into
devfrom
shumkov/pr-hygiene-id-token-dev
Nov 23, 2026
Merged

shumkov merged 1 commit into
devfrom
shumkov/pr-hygiene-id-token-dev

Conversation

@shumkov

@shumkov shumkov commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Grants id-token: write to the PR Hygiene caller workflow. That's the only change.

Why: the shared workflow (dashpay/stale_prs_are_bad's pr-review-reusable.yml@master) now posts each run's verdicts to the dashboard at https://pr-hygiene.services.dash.org. The dashboard then shows the new state within about a minute instead of after its next periodic refresh. The post is authenticated with the job's GitHub OIDC token, and a job can mint one only when its caller grants id-token: write.

Effect on the gate: none. The post runs after every status is written, never fails the job, and without this permission only logs a warning, which is what happens today. The token gives no access to GitHub. Note that id-token: write lets any step of this job mint an OIDC token for any audience. The only code in the job is the shared PR Hygiene workflow from dashpay/stale_prs_are_bad master, a protected branch, and it asks only for the dashboard's audience. No pull request code runs in it. A cloud role that trusts this repository's OIDC subject with a wildcard would be reachable by that code, so such roles should pin the exact workflow or environment.

The caller template in pr_review/rollout.py already includes this line, so the generated caller and this file agree.

🤖 Generated with Claude Code

PR Hygiene · 0f319f5

  • Bots — thepastaclaw requested changes — dismiss the review or push a fix, 1 thread unresolved — resolve it
  • Self-review — post /self-reviewed
  • Build failed
  • Approvals
    • github (.github/workflows/pr-review-policy.yml) — ktechmidas or lklimek

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

The shared PR Hygiene workflow now posts each run's verdicts to the
dashboard service at pr-hygiene.services.dash.org, signed with the job's
GitHub OIDC token. A job can mint that token only when its caller grants
id-token: write. Nothing else changes: the review gate runs as before, and
without the token the post only warns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 21, 2026
@thepastaclaw

thepastaclaw commented Nov 21, 2026 •

Copy link
Copy Markdown

⛔ Final review complete — 1 blocking finding(s) (commit 0f319f5) · triage: low

@thepastaclaw thepastaclaw 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.

Final validation — Phase 1 + Phase 2

The OIDC grant enables dashboard updates without changing the GitHub merge gate, but it can make the dashboard show a PR as Mergeable after reconciliation deliberately left its GitHub check pending. Build, test, lint, and both reconciliation runs passed on 0f319f5; PR Hygiene and PastaClaw review were still pending.

🔴 1 blocking

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.2-sol (effort low) — The one-line CI permission change enables OIDC authentication for dashboard posting without changing the PR gate, so it has a real but well-contained effect.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 92% left, weekly 36% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `.github/workflows/pr-review-policy.yml`:
- [BLOCKING] .github/workflows/pr-review-policy.yml:33: Do not push a mergeable verdict that reconciliation withheld
  This grant enables a push that can contradict the GitHub check. In `dashpay/stale_prs_are_bad`, `pr_review/main.py:749–774` posts `pending` and returns normally when review or admission evidence changes after evaluation, such as when an approval is dismissed without a new commit. The export at `:1128–1144` excludes only rows that raised `GitHubError`, so it still sends the original `ready-to-merge` verdict. For a PR already in the dashboard snapshot, a newer push can replace its stage with Mergeable while GitHub requires another reconciliation. Before enabling the grant, have the shared engine report whether it posted the evaluated status, separately from its controller-state return, and export only confirmed verdicts. Add a regression test that verifies a verdict is omitted when revalidation posts `pending`.

Comment thread .github/workflows/pr-review-policy.yml Resolved
@github-actions

Copy link
Copy Markdown

Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 21, 2026
@shumkov
shumkov merged commit 7c26a2a into dev Nov 23, 2026
25 of 27 checks passed
@shumkov
shumkov deleted the shumkov/pr-hygiene-id-token-dev branch November 23, 2026 02:05
@github-actions github-actions Bot added this to the v2.0 milestone Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants