Skip to content

fix: hint at permissions when R-PR-001 assignee mutation 404s - #64

Merged
BigLep merged 1 commit into
masterfrom
fix/r-pr-001-assignee-permission-error-hint
Sep 25, 2026
Merged

BigLep merged 1 commit into
masterfrom
fix/r-pr-001-assignee-permission-error-hint

Conversation

@BigLep

@BigLep BigLep commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The hourly FOC Board Mechanical Rules workflow had been failing since 2026-09-24T22:05 on FilOzone/team-skills#14: R-PR-001's assignee mutation returned a bare 404 Client Error: Not Found. Root cause was that the FilOzzy bot only had read access to team-skills (never granted triage+ access, unlike every other board repo), which I've since fixed directly via gh api .../collaborators/FilOzzy (role_name: triage).
  • add_assignee now detects that specific 404 and re-raises with an explicit permissions hint instead of the raw GitHub message, so the next time a newly-added board repo is missing this grant, the failure is actionable straight from GITHUB_STEP_SUMMARY.
  • Documented the underlying gotcha in the README: org-wide token scope doesn't guarantee per-repo write access, so a new board repo needs an explicit grant (via github-mgmt or a direct collaborator add) or this recurs.
  • Left the "any rule error fails the job" exit behavior in cli.py unchanged — that's intentional so permission gaps get noticed.

Test plan

  • uv run pytest -m "not integration" -k "assignee" — 8 passed
  • Verified permission fix live: gh api repos/FilOzone/team-skills/collaborators/FilOzzy/permission now reports role_name: triage
  • Triggered workflow_dispatch dry-run (36169922287) — succeeded (note: dry-run skips the actual add_assignee call, so real confirmation comes from the next scheduled hourly run)

🤖 Generated with Claude Code

FilOzone/team-skills#14 was failing the hourly mechanical-rules run
because the FilOzzy bot only had read access to that repo (never
granted triage+ via github-mgmt), and GitHub returns a bare 404 for
both "not found" and "no write access" on the assignees endpoint.
Annotate that specific 404 with a permissions hint, and document the
per-repo access requirement so it's actionable directly from the
GITHUB_STEP_SUMMARY next time a new board repo is missing this grant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 25, 2026 18:10
@BigLep
BigLep requested a review from rjan90 as a code owner September 25, 2026 18:10
@FilOzzy FilOzzy added this to FOC Sep 25, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Sep 25, 2026

@BigLep BigLep left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a sensible clarity item. I'll merge since I don't see any reason not to. worst case we change in future. this isn't mission ciritical.

@BigLep
BigLep merged commit ae9a029 into master Sep 25, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from 📌 Triage to 🎉 Done in FOC Sep 25, 2026

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Add focused tests covering the new 404 behavior and non-404 error handling.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Improves diagnostics for assignee-mutation 404 errors and documents repository-level permissions.

Changes:

  • Adds a permissions hint to relevant 404 errors.
  • Documents required bot access for new board repositories.
File Summary
foc-mechanical-rules/​README.md Documents repository permission requirements.
foc-mechanical-rules/​foc_mechanical_rules/​github_api.py Annotates assignee-mutation 404 errors.

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

Comment on lines +112 to +115
indistinguishable from the response alone, but in this codebase's usage
(the target is always the PR's own author) it's almost always the
former, so the error is annotated with that hint rather than left as a
bare "Not Found".
@BigLep
BigLep deleted the fix/r-pr-001-assignee-permission-error-hint branch September 25, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

3 participants