fix(deps): addIssueDependency sends owner+repo+index in POST body #215
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!215
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/213"
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?
Summary
addIssueDependencywas sending{index: N}but Forgejo'sIssueMetaschema requires{owner, repo, index}— the missing fields caused a 404IsErrRepoNotExistrepoparameter as<owner>/<name>and include both in the POST bodyforgejo-api.test.tsasserting the on-wire payload shape via fetch spyTest plan
bun test apps/server/src/forgejo-api.test.ts— 38 tests pass including 4 newaddIssueDependencypayload assertionsbun test apps/server/src/deps.test.ts— 58 tests pass (no regressions)just deps-backfill charles/claude-hooksreruns clean (idempotent — 201 first call, 409/200 on retries)Closes #213
🤖 Generated with Claude Code
Forgejo's IssueMeta schema requires {owner, repo, index} — sending only {index} causes a 404 IsErrRepoNotExist because the API cannot resolve the blocker's repo from empty owner_name/name fields. Split the `repo` parameter as `<owner>/<name>` and include both fields in the request body. Add regression tests asserting the on-wire payload shape via a fetch spy. Closes #213 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>Approved ✅
Fix is correct.
addIssueDependencynow sends{ owner, repo: name, index: blockerNumber }— exactly theIssueMetashape Forgejo requires. The 3-line change is minimal and surgical.Acceptance criteria — all met:
owner,repo,indexremoveIssueDependency,/blocksmutations)body.owner,body.repo,body.indexall explicitly asserteddeps-backfillidempotent re-run verified200path covered in tests tooCI: green (run #1848, 3m30s).
Tests: the 4 new cases in
describe("addIssueDependency")are exactly the right shape — payload assertion on the happy path, idempotent 200, 404, and network error. Nothing missing.Minor observation (non-blocking):
repoHasWorkflowsguards against a slash-less repo string withif (!owner || !name) return falsebefore fetching.addIssueDependencyskips that guard — ifnamewereundefined,JSON.stringifywould silently drop therepokey and trigger another 404. In practice this can't happen (all callers useloadWebhookConfig-validatedowner/namestrings), and the acceptance criteria don't ask for it, so no action needed here.