Forgejo: Issue Handler on configured label + .omp/forgejo.yaml #79
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
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 project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck!79
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-78-issue-handler"
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?
Implements plan step 18.
forgejo/repo-config.ts: parser for.omp/forgejo.yaml(issue_handler.labelonly; unknown keys ignored; missing/empty file → defaults; invalid → error).DispatchApi:readRepoFile(default branch, 404 → null, 64 KiB cap) andlistLabelEvents(timelinetype: "label",body === "1"= add).issue_label/issues+label_updatedaccepted;label_cleared, agent-authored, andpull_request_labelignored.issue-labeledreason; config read fresh per event; fires only when the newest label batch adds the configured label; invalid config → newconfigfailure kind (public comment names the file as invalid, parse error stays in the row). Permission/workspace gates unchanged; session is the issue'sforgejo_conversationsession (created or reused).ForgejoTriggerSummaryevent/action unions extended withissue_label/label_updated. This wasn't in the plan, but the change needed it to typecheck.Verification:
bun test src/forgejo(264 pass),bun run typecheckin server and web. I didn't run the manual end-to-end check against the live instance.Closes: #78
Please give me an example of the repo config file
Example
.omp/forgejo.yaml, committed at the repository root on the default branch:When someone with write access adds the
needs-triagelabel to an issue, the agent posts an analysis comment on it. Label matching is exact and case-sensitive.issue_handler.labelis the only key this PR reads. Other keys, including future sections likereview:, are ignored.issue_handler, label changes trigger nothing. @mentions and review requests still work..omp/forgejo.yamlis invalid, and doesn't run. Examples of invalid content: bad YAML,issue_handler: x, or an emptylabel.Please fix the conflicts
91689f948ato6bd3ad50ecI've rebased onto current
main(cdee4b8) and force-pushed; the branch head is now6bd3ad5. The conflicts were indispatch-api.tsanddispatcher.test.ts. In both files, this PR and main had each added new methods in the same spot:mainaddedlistLabels/replaceIssueLabels, and this PR addedreadRepoFile/listLabelEvents. The resolution keeps both sets. Typecheck passes andbun test src/forgejopasses (275 tests).More conflicts, though
6bd3ad50ectocd0681c4a6I've rebased onto the current
main(b433e29) and force-pushed; the branch head is nowcd0681c. The conflicts were the same kind as before.mainaddedcreateIssue/updateIssueBodytoDispatchApiand its test fake, at the spot where this PR addsreadRepoFile/listLabelEvents. I kept all four methods. Typecheck passes for server and web, andbun test src/forgejopasses (282 tests).Looks good, but needs a final conflict fix
cd0681c4a6to58d99bfd01I've rebased onto
main(93b1ade) and force-pushed; the branch head is now58d99bf. The conflicts came from #90 (base-push conflict checks), which touched the same places as this PR. Every conflict was an addition on both sides, and I kept both:push/pushed/base_pushedalongsideissue_label/label_updatedin the protocol unions.base-pushedandissue-labeledreasons.listOpenPullsalongsidereadRepoFile/listLabelEvents.Server and web typecheck pass, and
bun test src/forgejopasses (290 tests).