Skip to content

fix(ci): recognize ruleset-backed PR approvals - #13111

Merged
DariuszPorowski merged 4 commits into
mainfrom
dariuszporowski-pr-approval-labels
Sep 25, 2026
Merged

DariuszPorowski merged 4 commits into
mainfrom
dariuszporowski-pr-approval-labels

Conversation

@DariuszPorowski

Copy link
Copy Markdown
Member

Summary

Correct approval lifecycle labels when GitHub returns a null reviewDecision on a ruleset-protected branch. Infer approval only from current-head reviews that satisfy the effective review count and shared CODEOWNER team attribution. Required checks still gate pr:ready-for-queue for BEHIND branches.

Reason for change

Before a later head update dismissed its approval, #12852 had an approved CODEOWNER review but retained pr:waiting-for-review: GraphQL reported reviewDecision: null despite the effective ruleset requiring one approval from either listed CODEOWNER team. The fallback remains conservative for stale approvals, outstanding changes requests, unverified ownership, and unsupported required-team policies.

Related: #12852

How to test

File change summary

File Summary of change
.github/scripts/pr-status-labels.mjs Infer a null review decision from current ruleset requirements, current-head reviews, and shared CODEOWNER teams while preserving existing handoff and queue gates.

DariuszPorowski and others added 2 commits September 24, 2026 13:59
Infer null review decisions from current-head reviews only when the effective ruleset's approval count and shared CODEOWNERS team are satisfied. Preserve required-check gating for merge-queue readiness.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Remove incidental formatter churn so the ruleset approval change stays focused.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
@DariuszPorowski
DariuszPorowski requested review from a team as code owners September 24, 2026 23:32
Copilot AI lite review requested due to automatic review settings September 24, 2026 23:32
@github-actions github-actions Bot added the pr:waiting-for-review A reviewer owns the next action; required approval is pending or unverifiable label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@DariuszPorowski DariuszPorowski added the pr:standard Ongoing maintenance, minor improvements, documentation updates, and routine development work label Sep 24, 2026

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 fallback does not safely handle last-push approval, unattributed changes, or required reviewer policies.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates PR status labeling to infer approvals for ruleset-protected branches when GitHub returns a null reviewDecision.

Changes:

  • Evaluates current-head reviews and CODEOWNER teams.
  • Preserves required-check gating for queue readiness.
  • Adds ruleset-backed approval inference.
File Summary
.github/​scripts/​pr-status-labels.mjs Implements ruleset-based approval inference and label handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/scripts/pr-status-labels.mjs Resolved
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Unit Tests

    2 files  ±0    459 suites  ±0   7m 7s ⏱️ -57s
6 635 tests ±0  6 633 ✅ ±0  2 💤 ±0  0 ❌ ±0 
7 943 runs  ±0  7 941 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 1e433cd. ± Comparison against base commit b25d99b.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.52%. Comparing base (b25d99b) to head (1e433cd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13111      +/-   ##
==========================================
- Coverage   59.53%   59.52%   -0.01%     
==========================================
  Files         772      772              
  Lines       45060    45060              
==========================================
- Hits        26825    26823       -2     
- Misses      18235    18237       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DariuszPorowski DariuszPorowski self-assigned this Sep 25, 2026
@DariuszPorowski

Copy link
Copy Markdown
Member Author

@copilot fix lint issues

Co-authored-by: DariuszPorowski <3431813+DariuszPorowski@users.noreply.github.com>

Copilot AI commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

@copilot fix lint issues

Addressed in 9a93794 by applying the repository Prettier config to .github/scripts/pr-status-labels.mjs. Validated with node --check, make format-check, git diff --check, secret scanning, and parallel validation.

Comment thread .github/scripts/pr-status-labels.mjs Resolved
@github-actions github-actions Bot added pr:needs-reviewer No pending review request or active submitted human review and removed pr:waiting-for-review A reviewer owns the next action; required approval is pending or unverifiable labels Sep 25, 2026
Leave inferred approval unknown when any effective ruleset requires approval from someone other than the last pusher. Preserve changes-requested handoffs and authoritative GitHub review decisions rather than guessing push identity.

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@radius-functional-tests

radius-functional-tests Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository radius-project/radius
Commit ref 1e433cd
Unique ID func7135917971
Image tag pr-func7135917971
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func7135917971
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func7135917971
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func7135917971
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func7135917971
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func7135917971
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details
⌛ Starting corerp-cloud functional tests...
✅ corerp-cloud functional tests succeeded

@github-actions github-actions Bot added pr:waiting-for-review A reviewer owns the next action; required approval is pending or unverifiable and removed pr:needs-reviewer No pending review request or active submitted human review labels Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Functional Tests - corerp-cloud

32 tests  ±0   31 ✅ ±0   19m 18s ⏱️ - 1m 15s
 2 suites ±0    1 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 1e433cd. ± Comparison against base commit b25d99b.

♻️ This comment has been updated with latest results.

@github-actions github-actions Bot removed the pr:waiting-for-review A reviewer owns the next action; required approval is pending or unverifiable label Sep 25, 2026
@github-actions github-actions Bot added the pr:review-approved Required reviews are approved; checks may still be pending label Sep 25, 2026
@DariuszPorowski
DariuszPorowski added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 1893519 Sep 25, 2026
95 of 96 checks passed
@DariuszPorowski
DariuszPorowski deleted the dariuszporowski-pr-approval-labels branch September 25, 2026 18:04
@github-actions github-actions Bot removed the pr:review-approved Required reviews are approved; checks may still be pending label Sep 25, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Sep 29, 2026
<!--
Thank you for contributing to Radius! Please fill out each section below
so
reviewers have the context they need. Sections marked optional can be
removed
if they do not apply.
-->

## Summary

<!-- Provide a concise description of what this PR does. -->

Treat unresolved, submitted inline feedback from human reviewers other
than the PR author as `pr:waiting-for-author`. Qualifying feedback takes
precedence over pending review requests and approvals, suppressing
`pr:review-approved` and `pr:ready-for-queue` until it is resolved,
deleted, or dismissed.

Paginate both review threads and comments. Exclude Bots, author-only
notes, pending reviews/comments, dismissed or deleted feedback, and
general top-level discussion. Replies, pushes, and outdated diff
positions do not resolve feedback.

Preserve formal changes-requested/re-review behavior, ruleset approval
fallback and the last-push guard, required-check safety, manual merge
holds, unrelated/release-impact labels, stale policy, and global
reconciliation concurrency. No new labels, dependencies, or checked-in
test workflow are introduced.

## Reason for change

<!--
Explain why this change is needed. If it addresses a GitHub issue, link
it
below so it is automatically closed when this PR merges (optional).
-->

Follow-up to #13106 and #13111. The existing policy deliberately ignores
comment-only reviews, so submitted human inline feedback can leave the
handoff with reviewers even when the author has the next action. This
implements the approved human-inline-feedback rule; it does not
interpret comment wording or modify #13139's feature code.

The read-only `PR Review Signal` workflow now relays supported
inline-comment creation, editing, and deletion events. The trusted
downstream retains its source-event allow-list and
PR-number/current-commit validation; it never executes PR code with
elevated permissions.

GitHub Actions does not support a thread resolution/unresolution
trigger. Resolving or reopening threads is reconciled by the existing
nominal 15-minute schedule, which GitHub may delay, another supported
signal, or a manual run. The contributor guide documents this limitation
rather than promising an immediate transition.

<!-- issue number (optional) -->

## How to test

<!-- Describe the steps a reviewer can take to verify these changes. -->

Passed locally with Node.js 24.16.0:

```powershell
node --check .github\scripts\pr-status-labels.mjs
pnpm exec prettier --config .github\linters\.prettierrc.yml --check .github\scripts\pr-status-labels.mjs .github\workflows\pr.review-signal.yml .github\workflows\pr.status-labels.yml
actionlint .github\workflows\pr.review-signal.yml .github\workflows\pr.status-labels.yml
pnpm exec markdownlint-cli2 docs\contributing\contributing-pull-requests\README.md --config .github\linters\.markdownlint-cli2.yaml
pnpm exec markdown-table-formatter docs\contributing\contributing-pull-requests\README.md --check
pnpm dlx cspell lint --config .github\linters\.cspell.yml --no-progress --dot .github\workflows\pr.review-signal.yml .github\workflows\pr.status-labels.yml docs\contributing\contributing-pull-requests\README.md
```

Additionally, 76 bounded one-off mocked checks passed, including
human/bot/author feedback, approval suppression, resolution/deletion,
pending/dismissed reviews, old/outdated feedback, replies/pushes, more
than 100 threads/comments, exhaustive negative pagination, invalid
cursors, source-signal validation, manual holds, approval fallback,
required checks, and unrelated-label preservation. The temporary harness
was removed; no dedicated test file or workflow is checked in.

A read-only dry run executed the actual reconciler against open #13139
at head `c901510675e53b46982ff21192ff4204d3cc73f4`, with
`reviewDecision=REVIEW_REQUIRED`. It identified the submitted human
`COMMENTED` feedback and proposed only replacing `pr:waiting-for-review`
with `pr:waiting-for-author`, preserving `pr:standard`. A subsequent
live read confirmed the labels and head were unchanged. No live label,
review, or queue mutations were performed during validation.

For behavioral verification in a test repository, submit human inline
feedback and reconcile; confirm the author handoff even with approval.
Resolve the qualifying threads and manually reconcile to confirm normal
review rules return. Bot-only comments, author notes, and general PR
discussion must not change the handoff.

## File change summary

<!-- Summarize the change made in each file that was modified. -->

| File | Summary of change |
| ---- | ----------------- |
| `.github/scripts/pr-status-labels.mjs` | Add paginated submitted-human
inline-feedback classification and author-handoff precedence; allow
verified inline-comment workflow signals. |
| `.github/workflows/pr.review-signal.yml` | Add supported
review-comment creation/edit/deletion triggers without granting
permissions. |
| `.github/workflows/pr.status-labels.yml` | Accept the additional
verified source event while preserving trusted checkout, schedule, and
global concurrency. |
| `docs/contributing/contributing-pull-requests/README.md` | Document
feedback eligibility, return-to-review behavior, unchanged manual holds,
and delayed resolution reconciliation. |

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
crewletbot pushed a commit to crewlet/crewlet that referenced this pull request Oct 4, 2026
The comment on the approve step, CONTRIBUTING.md and RELEASING.md said
the approval stacked up on every bundle push and that the job ran on
every push to a bump's branch. The actor guard skips every run that a
bundle push triggers, because that push is made by another account, so
approvals only ever stacked on what Dependabot itself does: it opens the
pull request, then rebases or recreates it each time main moves.

They also gave a dismissed approval as the case a count of reviews cannot
see, which is wrong: a dismissed review's state is DISMISSED and a count
of APPROVED reviews already leaves it out. What a count cannot see is how
many approvals the rule requires, an approval that does not count because
of who pushed last, and a required reviewer.

The reason for approving on an empty decision now says what is known and
where it comes from: GitHub leaves reviewDecision empty when nothing
requires a review, and it has been reported to stay empty while a
requirement that comes from a ruleset still blocks the merge
(radius-project/radius#13111). Whether main's own ruleset does has not
been observed. RELEASING.md also stops claiming that every way of
weakening the approval step fails by running more: narrowing the skip
silently stops it approving.

No behaviour changes.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
clwluvw added a commit to crewlet/crewlet that referenced this pull request Oct 4, 2026
…174)

* ci(dependabot-dashboard): push the rebuilt bundle onto dashboard bumps

static/dashboard is committed and ci.yml's dashboard job rebuilds and
diffs it, but Dependabot edits only package.json and the lockfile and
cannot run a bundler. A bump that changed the emitted bytes therefore sat
red on that gate until a person ran `make dashboard` and pushed the
result. The new workflow is that person.

On a Dependabot pull request that touches dashboard/, one job runs
`make dashboard` and, if `git status` shows any change under
static/dashboard (changed, dropped or added), hands the directory to a
second job as an artifact. That job commits it onto Dependabot's branch
with a plain push, so a branch that has moved since is refused instead
of overwritten.

Two jobs because the first executes whatever a dependency published this
week: it holds a read-only token that is not persisted, no secrets and no
write access, and checks that its output survives being zipped (no
symlink, special file or executable). The second holds the credential and
runs nothing the bump brought in; its three actions are pinned to full
commit SHAs, unlike the repository's major tags, because it is the job
with the key. It checks the bundle's file names against an allowlist --
static/dashboard sits inside the Go module, so a stray _test.go there
would run under every `go test ./...` -- and refuses hidden names. Both
jobs carry the author-and-actor guard dependabot-merge.yml uses, and the
paths filter on dashboard/** keeps an open GitHub Action bump from
running beside the credential.

The push is made as a GitHub App, not with GITHUB_TOKEN: a push made
with the workflow's own token leaves the pull request's runs waiting for
someone to click "Approve workflows to run". The App needs Contents: read
and write and nothing else, its client ID and private key have to be
DEPENDABOT secrets (a run Dependabot triggers cannot read Actions
secrets), and v* tags want a ruleset it cannot bypass, since Contents:
write can create one. The job fails naming both secrets when either is
empty.

The commit carries `[dependabot skip]`, GitHub's documented marker that
lets Dependabot force-push over it. Without it Dependabot stops rebasing
the branch and answers `@dependabot rebase` with "edited by someone other
than Dependabot", which would leave a bump that later conflicts with main
stuck: a conflicted pull request runs no workflows.

The workflow approves nothing and queues nothing. Whether a bump that
changed the bundle then merges itself is main's protection rule: if it
dismisses stale approvals, or requires approval of the most recent
push, that bump waits for a person.

dependabot-merge.yml now names the commit its approval is for.
`gh pr review --approve` sends no commit, so GitHub attached the review
to whatever the head was when the step ran: a run that began before the
bundle push, or a maintainer re-running an old one (a re-run keeps its
actor, so it passes the guard), would approve a commit no event named.
Named, an approval of a commit that is no longer the head is stale from
the moment it is made. The same edit corrects two comments there:
Dependabot rebases on conflict, on its schedule and on request rather
than whenever main moves, and after a maintainer's Update branch the
recovery is `@dependabot recreate`, not `rebase`.

Documents the change in dependabot.yml, CONTRIBUTING.md (replacing the
bullet that said such a bump would not auto-merge, adding a section, and
making "Which node" agree with ci.yml about which jobs must match),
RELEASING.md's list of what nothing guards, CLAUDE.md, and the
floating-version comments in ci.yml.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-recreate): ask Dependabot to recreate conflicted dashboard bumps

When one dashboard bump merges, every other open one conflicts: each
carries its own rebuilt bundle, the emitted names are content-hashed, and
two branches that both rebuilt static/dashboard collide on index.html and
on every chunk. A conflicted pull request runs no workflows, so
dependabot-dashboard.yml cannot reach it, and Dependabot refuses to
rebase a branch that holds a commit it did not write unless that commit
carries `[dependabot skip]`. `@dependabot recreate` works regardless, so
the new workflow comments it on each open Dependabot bump that touches the
dashboard and whose mergeable_state is dirty. Dependabot rebuilds the
branch from main and dependabot-dashboard.yml pushes a fresh bundle.

It runs on a push to main that changes static/dashboard and every hour. The
hourly run is the one that does the work: Dependabot's merges are queued
with GITHUB_TOKEN, and GitHub starts no workflow for a push that token
causes. Checked rather than assumed -- the merge commits of #167, #170,
#171 and #173 have no push-event run at all.

`recreate` discards every commit on the branch, so a bump is only asked
when every commit on it was made by a [bot] account. A conflicted bump
carrying anything else is listed in the run summary and left alone, and a
commit whose author GitHub cannot resolve counts as a person's. A bump is
asked about once per head commit: a comment of ours newer than the head's
own date means the question has been put.

Whether Dependabot acts on a command written by github-actions[bot] rather
than a person with write access is not documented and cannot be tested from
here, so a request still unanswered after six hours is a warning on the
run rather than a bump that quietly looks handled.

Tested offline against a fake gh over twelve scenarios (clean, conflicting,
a person's commit, an unresolvable author, a fresh and a stale request,
mergeability still being computed, a non-dashboard bump, a PR a person
opened), and ten deliberate breakages of the script are each caught.

Documents it in CONTRIBUTING.md, RELEASING.md, CLAUDE.md and the comment
in dependabot.yml.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* revert(dependabot-recreate): drop a workflow Dependabot ignores

Reverts 5cb04d5. It commented `@dependabot recreate` as github-actions[bot],
and Dependabot does not obey commands from a bot or from a GitHub App:

  "Sorry, only users with push access can use that command."

That is dependabot-core#9147, open since February 2024 and reported for
GitHub Apps that hold write access, and a community thread GitHub has not
answered since 2023. The commit message called it undocumented and
untestable from here; it is observable, and the refusal comes back in
minutes. The workflow would have reported "already asked" and warned only
after six hours.

It was also aimed at a case Dependabot handles by itself. A conflicted bump
whose commits are all Dependabot's, or carry `[dependabot skip]`, is rebased
automatically after a push to main. #167 conflicted when #168 merged and was
rebased two minutes later, with no comment from anyone, and the bundle commit
dependabot-dashboard.yml pushes carries that marker. The case Dependabot
refuses is a bump holding a person's commit, which this workflow was written
to leave alone, so a person has to comment the command.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* fix(dependabot-dashboard): match main's gate, correct the docs

The drift step asked a narrower question than ci.yml's gate. `git status
--porcelain` hides ignored files, while main's gate fails on them because
the engine embeds the directory with `all:dashboard` and ships whatever is
on disk. A rebuild that wrote only a file .gitignore hides would have left
the step saying "unchanged" and ci.yml red with nothing pushed. It now
uses the same listing (`--untracked-files=all --ignored=matching`); an
ignored file cannot be committed, so it travels to the push job and is
refused there by name. Covered by a new case, and the mutant that drops the
flag is caught.

Documentation that was wrong, found by review:

- The conflict story. Dependabot rebases a conflicted bump by itself after a
  push to main, while every commit on the branch is its own or carries
  `[dependabot skip]`, which the bundle commit does (#167 was rebased two
  minutes after #168 merged, with no comment). What it refuses is a branch
  holding a person's commit, or a bump open for 30 days, and `@dependabot
  recreate` there has to come from a person with push access: Dependabot
  answers github-actions[bot] and GitHub Apps with "only users with push
  access can use that command" (dependabot-core#9147). The earlier text, and
  the revert above, say why no workflow does it.
- main's ruleset keeps approvals across pushes, so today anything pushed
  onto an open Dependabot branch merges once CI is green, whoever pushed it.
  The docs said a rule "decides" this without saying which way it points.
  They now say so, and name the setting to change if a person should look.
- The "Update branch" cost in dependabot-merge.yml and CONTRIBUTING.md was
  stated as certain; it holds only under a rule that dismisses stale
  approvals. Recovery is `recreate`, not `rebase`, from a person.
- Two paragraphs left badly wrapped by earlier edits.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-dashboard): push with a personal access token

The bundle push authenticated as a GitHub App. It now uses a
fine-grained personal access token, DASHBOARD_BUNDLE_TOKEN, a Dependabot
secret scoped to this repository with Contents: read and write and
nothing else. Not Workflows, so it cannot rewrite a workflow file; not
Pull requests, so it cannot approve one. A classic token is accepted but
warned about, because its repo scope reaches every repository the
account can.

The push job asks GitHub who the token belongs to and attributes the
bundle commit to that account. Only a 401 from GET /user is reported as
an expired, revoked or mistyped token; any other answer is reported
with GitHub's own words and the commit is attributed to
github-actions[bot], so a good token is never called bad over a value
that is only the commit's author line. The token-minting action and its
step are gone, leaving two SHA-pinned actions in the privileged job.

CONTRIBUTING.md, RELEASING.md and CLAUDE.md describe the token, its
expiry, the tag ruleset it wants, and why commenting @dependabot
recreate is not automated: it would need Pull requests: write, which
also lets the token approve pull requests.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-merge): approve only while a review is still needed

The job runs on opened, reopened and every synchronize, and under a
ruleset that keeps approvals across pushes every run after the first
found the pull request already approved and stacked another review on
the timeline for each rebase and each bundle push.

It now reads reviewDecision with gh pr view and skips on APPROVED, and
on CHANGES_REQUESTED, which this account's approval would not clear.
Anything else approves, an empty decision included, and on purpose:
GitHub leaves it empty both when nothing requires a review and when its
answer does not account for the rule in force, and a skip on doubt
would stall every bump with nothing red to show where a redundant
review costs one line. A dismissed approval reads as REVIEW_REQUIRED,
so the push that follows is approved again. An unreadable decision
fails the step rather than approving blind.

The approval still names the commit the run was started for.
CONTRIBUTING.md, RELEASING.md and CLAUDE.md describe the rule.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-recreate): ask Dependabot to recreate conflicted bumps

A bump that conflicts with main stops merging, and Dependabot rebases
it by itself only while every commit on the branch is its own or marked
[dependabot skip]. This workflow comments `@dependabot recreate` on an
open Dependabot pull request that conflicts with main, once per head
commit, on every push to main and every six hours. Dependabot makes the
branch again and dependabot-dashboard.yml pushes a fresh bundle onto it.

The comment has to be a user account's: Dependabot ignores commands
from github-actions[bot] and from GitHub Apps. It is made with a second
secret, DEPENDABOT_RECREATE_TOKEN, a fine-grained token for this
repository with Issues: read and write and nothing else. The comments
endpoint is served under Issues as well as Pull requests, and Issues
cannot approve a pull request, so a leaked token can comment but cannot
sign off a change that main's ruleset counts. It is an Actions secret,
because the run is started by a merge or the clock rather than by
Dependabot, and for that reason it is not the bundle token: every
workflow in the repository can read an Actions secret, and that other
token can push. Only the one command that posts holds it; reads use the
workflow's own token.

recreate discards every commit on the branch, so a bump is only asked
for one when every commit is Dependabot's or carries [dependabot skip].
A bump holding anything else, a commit with no resolvable author
included, is named in the run summary with a warning and left to whoever
added it. An ask that stands unanswered for twelve hours is a warning,
not a second comment.

The schedule is load-bearing. A bump merges with GITHUB_TOKEN, which
starts no push workflow (the merge commits of #167, #170, #171 and #173
have no push-event run), so the push trigger sees only what a person
merges. Six hours because a pass that finds nothing costs a few API
reads and Dependabot's own rebase lands in minutes. Mergeability is
polled up to two minutes per bump (15 s, eight tries); a bump still
unknown is left to the next run and said so.

CONTRIBUTING.md, RELEASING.md and CLAUDE.md describe the workflow, its
token, and what it will not do.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-merge): correct the reasons given for approving once

The comment on the approve step, CONTRIBUTING.md and RELEASING.md said
the approval stacked up on every bundle push and that the job ran on
every push to a bump's branch. The actor guard skips every run that a
bundle push triggers, because that push is made by another account, so
approvals only ever stacked on what Dependabot itself does: it opens the
pull request, then rebases or recreates it each time main moves.

They also gave a dismissed approval as the case a count of reviews cannot
see, which is wrong: a dismissed review's state is DISMISSED and a count
of APPROVED reviews already leaves it out. What a count cannot see is how
many approvals the rule requires, an approval that does not count because
of who pushed last, and a required reviewer.

The reason for approving on an empty decision now says what is known and
where it comes from: GitHub leaves reviewDecision empty when nothing
requires a review, and it has been reported to stay empty while a
requirement that comes from a ruleset still blocks the merge
(radius-project/radius#13111). Whether main's own ruleset does has not
been observed. RELEASING.md also stops claiming that every way of
weakening the approval step fails by running more: narrowing the skip
silently stops it approving.

No behaviour changes.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-rebase): ask Dependabot to rebase after a grace period

An independent review of the recreate workflow found that it targeted
the wrong bumps at the wrong moment and rested on a token scope that
may not work. It is renamed and reworked.

It waited for nothing. Dependabot rebases a conflicted bump by itself
20 seconds to four and a half minutes after a merge here, and the first
version commented within seconds, so every conflicted bump was
force-pushed twice and ran CI and the bundle build twice. A run now does
nothing until main's tip is 30 minutes old (GRACE_SECONDS, six times the
slowest rebase seen), sleeping out the difference after a person's merge;
a newer push restarts the wait.

It comments @dependabot rebase and not recreate. recreate discards every
commit on the branch and the decision was made on a list read a minute
before Dependabot acts on it; rebase makes Dependabot check when it
acts and refuse an edited branch. The filter that spares a person's
commit now only avoids posting a command that would be refused, and it
reads all four spellings of the skip marker, in any case.

The token is DEPENDABOT_REBASE_TOKEN with Pull requests: read and write.
Issues alone has been refused for a comment on a pull request, and
nothing here could test it. That scope also approves pull requests,
which counts toward main's required review, so the secret now belongs to
an environment, dependabot-rebase, restricted to main, and only the
`ask` job declares it. The `find` job reads with the workflow's token
and hands over pull request numbers and commit SHAs. A token that is
empty, expired (probed with a read of the repository) or too narrow
fails the run by name, as does a request nobody acted on for 12 hours.

Other findings fixed. Only an owner, member or collaborator's comment
counts as an ask; a stranger's switched the workflow off for that head.
A pull request closed during the run is no longer asked about (GitHub
reports closed bumps as conflicting). Mergeability is polled in rounds
across all bumps instead of per bump, so the wait is two minutes however
many are open, and the timeout fits. The list is re-read just before
the comment is posted. The docs no longer claim the token is held by one
command, that every guard fails loudly, or that the schedule is a
guarantee, and they name which token each sentence is about. The
earlier commit message said approvals stacked on bundle pushes; the
previous commit explains why that was wrong.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-merge): correct two comments the review found wrong

Two claims about the approve and merge steps were not true.

The comment on the approve step and CONTRIBUTING.md said Dependabot
rebases a bump "each time main moves". It rebases when a push to main
puts the bump in conflict; the stacked-approval argument is unchanged.

CLAUDE.md still gave the old reason for approving on an empty
reviewDecision ("when its answer does not cover the rule in force"),
which the root files had already replaced with what is known: empty
when nothing requires a review, reported to stay empty for a
requirement that comes from a ruleset.

And the comment on the merge step, CONTRIBUTING.md, RELEASING.md and
CLAUDE.md said dropping --auto merges before a check has reported.
While main's ruleset requires the checks, gh pr merge refuses a blocked
pull request, so the step goes red and nothing merges: the hold is the
ruleset's and --auto is the queue. Only with no such rule would it merge
on the spot, which is the case the header warns about. RELEASING.md no
longer lists dropping --auto as a way the workflow runs more.

No behaviour changes.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-rebase): check its environment and re-read main

A second independent review of the rebase workflow found real defects.
Each was verified by two skeptics; the changes below fix them.

The grace wait read main's tip once, before sleeping. A bump merged
while it slept starts no workflow, so nothing restarted the wait, and the
run could wake on a seconds-old tip and ask while Dependabot was still
rebasing. It now reads the tip again after every sleep, sleeps again if
main moved, and gives up after an hour (WAIT_LIMIT_SECONDS) leaving the
bumps to the next run. A future-dated tip counts as brand new. Bumps
here merge in runs of three or four ten to forty minutes apart, which is
why an hour is enough to find a quiet half hour and not worth holding a
runner for longer.

The environment is now checked, not remembered. A workflow that names an
environment which does not exist creates it, with no protection, so the
first run would have left DEPENDABOT_REBASE_TOKEN's environment open to
every branch. The find job, which the ask job needs, reads the
environment's deployment-branch policy first and fails by name unless it
is exactly the selected branch main. The mode that looks right,
"Protected branches only", counts classic branch protection and main is
protected by a ruleset. The find job gains actions: read for this.

"Whose workflow files went through review" was false: main's ruleset keeps
approvals across pushes, so a writer can land a workflow unreviewed by
pushing it onto an approved Dependabot branch. The header and docs now say
what the environment does and does not do, name the ruleset setting that
closes the gap (require approval of the most recent push), and list the
token's real reach: it also dismisses reviews, retargets and closes pull
requests and has GitHub merge main into their branches.

Whether a request was already made is judged by the ask job, with the
personal token. The workflow's own token cannot see a private organisation
member, so author_association read this account's own comment as a
stranger's and every run would have asked again. The find job now hands
over only the candidates; the 12-hour unanswered list is built where the
comments are read.

Smaller: the token probe no longer claims the token "must be granted this
repository" (any valid token reads a public repository; only a 401 is
knowable) and the setup now says the organisation's approval and resource
owner; the docs no longer present a prediction as history ("force-pushed
twice") or call 30 minutes six times 4.5; the section that lists what
Dependabot will not rebase no longer implies the workflow handles a bump
holding a person's commit; RELEASING.md says which failures are loud.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-rebase): drop the schedule, wait up to ninety minutes

A conflict is made by a merge, so looking when main moves is the whole of
it, and a clock that wakes the workflow every six hours to find nothing
is noise. The workflow now runs on a push to main and by hand.

The blind spot is real and is written down where it will be read. A bump
merges itself with GITHUB_TOKEN and GitHub starts no push workflow for
that (the merge commits of #167, #170, #171 and #173 have none), so a
conflict a bump's merge makes is not looked at until a person merges next
or someone runs the workflow by hand. Those are the conflicts Dependabot
rebases on its own within minutes, so what it misses waits. The header,
CONTRIBUTING.md, RELEASING.md and CLAUDE.md say so, and no longer describe
a schedule as load-bearing or mention GitHub turning scheduled workflows
off after 60 days.

Two knobs followed from there being nothing behind the run. The wait for
a quiet main, WAIT_LIMIT_SECONDS, was an hour on the reasoning that the
next scheduled run would look if this one gave up. With no schedule that
reasoning is gone, so it is now ninety minutes (5400): the longest run of
bump merges seen here took 36 minutes (10:54 to 11:30 on 2026-09-22), and
a run that wakes into one waits for its last merge and then the 30-minute
grace, about 66 minutes. The job timeout follows, 90 to 120 minutes. The
comment on UNANSWERED_HOURS no longer cites the schedule: twelve hours is
past anything Dependabot takes to answer, and a request is judged only
when a run happens.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot): cut the bundle, rebase and approval workflows down

Three rounds of review made the Dependabot workflows far larger than
the job they do. Measured against main, this branch added 1,330 lines;
it now adds 584.

dependabot-rebase.yml was 450 lines and two jobs. It is 85 and one: wait
ten minutes, ask GitHub which bumps conflict, comment @dependabot rebase
on those nobody has asked since their last commit. What went, and why it
is no longer needed:
- the find/ask split, the environment-policy assertion, the grace loop
  that re-read main after every sleep, WAIT_LIMIT_SECONDS, the polling
  rounds, the association logic, the token probe and the 12-hour
  unanswered-request failure. Each defended a credential model that was
  more elaborate than it had to be, and each had produced review findings
  of its own. The loop that asks GitHub again while a bump is UNKNOWN stays,
  because mergeability is computed on request and one look can see nothing.
- the grace is now a single sleep of 600 seconds (was a 1800 second wait
  re-read after each sleep). Ten minutes is more than twice the slowest
  rebase Dependabot has made here (about four and a half). Without the
  re-read, a bump merged during the sleep can leave a conflict Dependabot
  has not reached yet, and that costs one redundant comment.
- the schedule was already gone; the push trigger is the only automatic one.
It keeps rebase, never recreate; one comment per head commit; and the
environment line, because Pull requests: write also approves, and an
environment limited to main is the one cheap thing between that token and
every writer. The environment must be created first (documented).

dependabot-dashboard.yml loses the identity step (a GET /user call, a
fallback and a classic-token warning, all to choose the commit's author
line; the commit is now authored by github-actions[bot], the push being
authenticated by the token either way) and the zip-fidelity step (ci.yml's
dashboard gate already goes red on any mismatch). It keeps the two-job
split, the file-name allowlist, the drift check, the pinned SHAs and the
named-secret preflight: those protect a token that can push.

dependabot-merge.yml approves with gh pr review again instead of the
reviews API naming the head commit. Naming it protected nothing under the
current ruleset, which keeps approvals across pushes. The conditional on
reviewDecision stays.

CONTRIBUTING.md, RELEASING.md and CLAUDE.md are rewritten to match: the
two long sections shrink by about half.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-recreate): ask for recreate, which edited branches accept

A bump still conflicting ten minutes after a merge is mostly one holding
a commit Dependabot did not write. Dependabot skips the automatic rebase
of such a branch and answers `@dependabot rebase` with "edited by someone
other than Dependabot", so asking for a rebase left it stuck for good.
`recreate` is the command it accepts there.

The price is that recreate overwrites every commit on the branch, a
person's included. It falls on a bump that is still in conflict after the
wait, and CONTRIBUTING.md says so.

Only a recreate counts as already asked: a refused rebase left the branch
as it was, so it must not stop the next ask.

Renamed with it: the workflow is dependabot-recreate.yml, its job
`recreate`, its environment `dependabot-recreate` and its secret
DEPENDABOT_RECREATE_TOKEN. Nothing on main has the old names.
CONTRIBUTING.md, RELEASING.md and CLAUDE.md follow; the CLAUDE.md
bullet also moves up beside the dashboard one it continues.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* ci(dependabot-dashboard): use plain action tags in the push job

The push job's two actions were pinned to full commit SHAs because it is
the job that holds the token. They are GitHub's own actions, and every
other workflow here references them by major tag, so the push job now
does the same.

Nothing else about the job changes: it still runs only the runner's own
tools and these two actions, never anything the bump brought in.
CONTRIBUTING.md, RELEASING.md and CLAUDE.md stop describing SHA pins.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

---------

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
Co-authored-by: Seena Fallah <seenafallah@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:standard Ongoing maintenance, minor improvements, documentation updates, and routine development work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants