Skip to content

feat: implement issue #749 — Canary 403 NOT fixed by #745/#746 — release-manager App can't bypass tag ruleset even repo-scoped; need effective-permission diagnostic#750

Merged
don-petry merged 4 commits into
mainfrom
dev-lead/issue-749-20260716-1017
Jul 16, 2026
Merged

feat: implement issue #749 — Canary 403 NOT fixed by #745/#746 — release-manager App can't bypass tag ruleset even repo-scoped; need effective-permission diagnostic#750
don-petry merged 4 commits into
mainfrom
dev-lead/issue-749-20260716-1017

Conversation

@don-petry

@don-petry don-petry commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closes #749

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Bug Fixes
    • Improved diagnostics for GitHub API permission failures when moving protected-channel tags.
    • Preserved the original failure status while providing additional permission and repository-access details.
    • Prevented an inappropriate fallback action after a 403 permission error.
    • Limited diagnostics to authorization failures, avoiding misleading output for other errors.

…ase-manager App can't bypass tag ruleset even repo-scoped; need effective-permission diagnostic
@don-petry
don-petry requested a review from a team as a code owner July 16, 2026 10:31
Copilot AI review requested due to automatic review settings July 16, 2026 10:31
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9ecea5c9-6917-4837-a758-2250f5a3e526

📥 Commits

Reviewing files that changed from the base of the PR and between 7103758 and c271929.

📒 Files selected for processing (2)
  • scripts/canary-rollout.sh
  • tests/canary_rollout.bats
📝 Walkthrough

Walkthrough

The canary rollout now diagnoses targeted GitHub API 403 tag-move failures by reporting effective permissions and installation repository scope. Bats tests cover diagnostic output, token routing, repository scope, and non-403 behavior.

Changes

Canary 403 diagnostics

Layer / File(s) Summary
403 diagnostic flow
scripts/canary-rollout.sh
_gh_move_tag invokes _gh_403_diag for the targeted 403 response, while the helper reports accepted permissions and installation repository scope without changing the original failure.
Diagnostic validation
tests/canary_rollout.bats
Tests verify diagnostic output, CANARY_WRITE_TOKEN usage, owner-wide scope reporting, PATCH-only behavior, and exclusion of 422 failures.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • petry-projects/.github issue 745 — Covers the related token-scoping and canary tag-write failure that this diagnostic path investigates.

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant TagMover
  participant GitHubAPI
  participant DiagnosticOutput
  TagMover->>GitHubAPI: PATCH tag reference
  GitHubAPI-->>TagMover: 403 integration-access failure
  TagMover->>GitHubAPI: Probe permissions and installation repositories
  GitHubAPI-->>TagMover: Permission header and repository scope
  TagMover->>DiagnosticOutput: Emit grouped diagnostic and error
Loading

Suggested labels: needs-human-review

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and matches the main change: adding a 403 diagnostic for canary tag moves.
Linked Issues check ✅ Passed The PR adds the requested one-shot 403 diagnostic and tests, matching the issue’s diagnostic and preservation requirements.
Out of Scope Changes check ✅ Passed The changes stay focused on the 403 diagnostic path and its tests, with no obvious unrelated scope added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-749-20260716-1017

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

Comment @coderabbitai help to get the list of available commands.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #750
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-07-16T11:01:53Z

@don-petry

Copy link
Copy Markdown
Contributor Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-07-16T11:01:53Z

@don-petry
don-petry enabled auto-merge (squash) July 16, 2026 10:31

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a one-shot effective-permission diagnostic function _gh_403_diag in scripts/canary-rollout.sh to troubleshoot 403 errors during tag-move operations, along with comprehensive tests in tests/canary_rollout.bats. The feedback suggests improving the robustness of the diagnostic by guarding the jq parser against empty or null responses using a non-empty check and the optional operator ?.

Comment thread scripts/canary-rollout.sh Outdated
@don-petry
don-petry disabled auto-merge July 16, 2026 10:33
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 16, 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.

Pull request overview

Adds a one-shot diagnostic path for the canary tag-move failure case where gh api returns 403 “Resource not accessible by integration”, so future promotion runs can capture effective token permissions/scope data in the logs and guide the next remediation step for issue #749.

Changes:

  • Add _gh_403_diag and invoke it from _gh_move_tag when the PATCH failure looks like a 403 integration-access denial.
  • Add Bats coverage that stubs the 403 path and asserts the diagnostic is emitted and POST fallback is not attempted.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/canary-rollout.sh Adds _gh_403_diag and calls it on 403-ish PATCH failures before surfacing the ::error::.
tests/canary_rollout.bats Adds stubs + tests for the 403 diagnostic behavior and token routing.

Comment thread scripts/canary-rollout.sh Outdated
Comment thread tests/canary_rollout.bats
Comment thread tests/canary_rollout.bats Outdated
Comment thread scripts/canary-rollout.sh Outdated
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 16, 2026
@don-petry
don-petry disabled auto-merge July 16, 2026 10:40
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry disabled auto-merge July 16, 2026 10:51
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) July 16, 2026 10:54
@don-petry
don-petry disabled auto-merge July 16, 2026 19:57
@sonarqubecloud

Copy link
Copy Markdown

@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) July 16, 2026 20:06

@donpetry-bot donpetry-bot 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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: c271929123b46ac462971de13153bd03b0640b35
Review mode: triage-approved (single reviewer)

Summary

Adds a one-shot, best-effort 403 effective-permission diagnostic (_gh_403_diag) to the _gh_move_tag failure path in scripts/canary-rollout.sh, plus 6 bats tests. The diagnostic runs only on 403 "Resource not accessible by integration" failures, prints the X-Accepted-GitHub-Permissions header and installation-repositories total_count using the same write token the PATCH used, never alters the original exit status, and never falls back to POST. Confirms the triage assessment: low-risk, diagnostic-only change.

Linked issue analysis

Closes #749, which asked for exactly this: a one-shot effective-permission diagnostic on the 403 tag-move failure (after #745/#746 token-scoping did not resolve it), to distinguish (a) a token-minting bug from (b) a lapsed ruleset bypass. The PR implements ask #1 verbatim and respects the issue guardrails: no ruleset changes, #744's un-suppressed error and #746's two-token structure are preserved. Substantively addressed.

Findings

  • No blocking findings.
  • Security: no token values are logged (only which token name is used for introspection); both probes are read-only GETs; diagnostic is guarded (|| true, jq optional operator, always returns 0) so it cannot mask the original 403 or change _gh_move_tag's exit code.
  • Prior reviewer feedback (gemini: jq null-guarding; Copilot: non-existent repository_selection field on /installation/repositories) was addressed in follow-up commits — the final code uses total_count with .total_count? // empty and non-empty checks, with dedicated edge-case tests. All 5 review threads are resolved.
  • Test coverage is thorough: 403 diagnostic emission, CANARY_WRITE_TOKEN routing, owner-wide vs repo-scoped count, non-403 (422) exclusion, empty/keyless API responses.
  • Secret scan MCP tool (run_secret_scanning) unavailable in this environment; gitleaks CI check passed.

CI status

All checks green: Lint, ShellCheck, Agent Security Scan, Secret scan (gitleaks), Canary-rollout Tests (lint + bats), CodeQL, SonarCloud (quality gate passed, 0 new issues), AgentShield, dependency audits. Remaining SKIPPED checks (dependabot, pnpm/pip/cargo audit, govulncheck, ci-relay) are ecosystem-conditional and expected.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 6351788 into main Jul 16, 2026
22 checks passed
@don-petry
don-petry deleted the dev-lead/issue-749-20260716-1017 branch July 16, 2026 20:10
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.

Canary 403 NOT fixed by #745/#746 — release-manager App can't bypass tag ruleset even repo-scoped; need effective-permission diagnostic

3 participants