fix(validate-repo): flag a missing Agent label at onboarding #378
No reviewers
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Total time spent: 35 seconds
Due date
igor
35 seconds
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!378
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/validate-repo-agent-label"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds an onboarding check for the repo-level
Agentgreenlight label tobin/validate-repo.sh.What
forgejo_repo_has_label <repo> <name>(lib/forgejo.sh) with distinct exit codes: 0 present · 1 absent · 2 indeterminate (API read failed) — so the caller can tell "missing, flag it" from "couldn't check, skip it."validate-repo.shemits an advisory checklist line. A missingAgentlabel is safe since #375 (the gate fails closed), so it never flips the readiness exit code — but it shows as an unchecked(advisory)box so onboarding notices a repo that will silently do no issue work.validate-repo.sh, notvalidate_repo_local— that stays pure local-clone reads for the per-tick hot path.Tests
bin/test-forgejo.sh: present / absent / indeterminate.make testgreen; shellcheck clean; ran end-to-end against a live repo.Note
Opened as a WIP draft on purpose so the live review loop doesn't rework it overnight — drop the
WIP:prefix (or just merge) once you've reviewed.Closes #376
WIP: fix(validate-repo): flag a missing Agent label at onboardingto fix(validate-repo): flag a missing Agent label at onboarding🤖 Review —
APPROVE(automated)CI for
e66e05b6: successAdds an advisory onboarding check for the repo-level
Agentlabel. Small, focused, well-tested; CI green. Approving.Verified:
forgejo_repo_has_labelexit-code contract is correct:_fj GETfailure short-circuits toreturn 2(indeterminate) via|| return 2; otherwise the function inheritsjq -e's status —any(.[]; .name==$n)yields true→0 (present) / false→1 (absent). Empty array[]correctly yields absent (1). Matches the three test cases exactly._fj() { return 22; }) properly exercises the read-failure path — command substitution surfaces the nonzero status, so it can't be misread as "absent." Good that this distinction is tested; conflating it would be the dangerous bug.validate-repo.shpreserves readiness viareturn $status; the advisory branch only prints a checklist line and never mutates the exit code, consistent with the "#375 fails closed, so a missing label is safe" claim.validate_repo_local(the local-clone hot path) since it's the one API read — matches the description.Minor follow-up (non-blocking):
/repos/{repo}/labelsmay paginate (Forgejo default page limit). If a repo defines more labels than one page andAgentsorts past it, this could report a false "absent." Low risk for an advisory onboarding check that never flips readiness, but worth alimit=param or pagination note if label lists ever grow.No security, correctness, or honesty concerns. Note the title still lacks the
WIP:prefix the description mentions — cosmetic, and the author flags it for manual drop before merge.Independent review by the harness on
claude-opus-4-8(effort: high). The human reviewer is requested once Igor has reviewed; a human still merges.