fix: DELETE /issues/{n}/labels/{id} uses label name instead of numeric ID (silent no-op) #41

Closed
opened 2026-03-28 19:42:15 +00:00 by dev-bot · 0 comments
Collaborator

Problem

Three places in dev/dev-poll.sh call DELETE /issues/{n}/labels/in-progress using the label name as the URL path segment. Forgejo expects the numeric label ID. The calls return 404, silently swallowed by || true, so the in-progress label is never removed.

Locations

  • dev/dev-poll.sh line 160 (formula guard cleanup)
  • dev/dev-poll.sh line 329 (orphan skip-label cleanup)
  • dev/dev-poll.sh line 404 (wrong-assignee cleanup, added in #38)

All three look like:

curl -sf -X DELETE -H "Authorization: token ${FORGE_TOKEN}" \
  "${API}/issues/${ISSUE_NUM}/labels/in-progress" >/dev/null 2>&1 || true

Fix

Look up the numeric ID first using the helper from lib/issue-lifecycle.sh, then use it in the DELETE URL. The pattern already exists in the codebase:

# In lib/issue-lifecycle.sh — this is the correct pattern:
_ilc_in_progress_id()  { _ilc_ensure_label_id _ILC_IN_PROGRESS_ID "in-progress" "#1d76db"; }

# Then use the numeric ID:
IP_ID=$(_ilc_in_progress_id)
curl -sf -X DELETE -H "Authorization: token ${FORGE_TOKEN}" \
  "${API}/issues/${ISSUE_NUM}/labels/${IP_ID}" >/dev/null 2>&1 || true

dev-poll.sh already sources lib/issue-lifecycle.sh, so the helper is available.

Affected files

  • dev/dev-poll.sh — fix 3 DELETE calls (lines ~160, ~329, ~404)
## Problem Three places in `dev/dev-poll.sh` call `DELETE /issues/{n}/labels/in-progress` using the label **name** as the URL path segment. Forgejo expects the numeric label **ID**. The calls return 404, silently swallowed by `|| true`, so the `in-progress` label is never removed. ## Locations - `dev/dev-poll.sh` line 160 (formula guard cleanup) - `dev/dev-poll.sh` line 329 (orphan skip-label cleanup) - `dev/dev-poll.sh` line 404 (wrong-assignee cleanup, added in #38) All three look like: ```bash curl -sf -X DELETE -H "Authorization: token ${FORGE_TOKEN}" \ "${API}/issues/${ISSUE_NUM}/labels/in-progress" >/dev/null 2>&1 || true ``` ## Fix Look up the numeric ID first using the helper from `lib/issue-lifecycle.sh`, then use it in the DELETE URL. The pattern already exists in the codebase: ```bash # In lib/issue-lifecycle.sh — this is the correct pattern: _ilc_in_progress_id() { _ilc_ensure_label_id _ILC_IN_PROGRESS_ID "in-progress" "#1d76db"; } # Then use the numeric ID: IP_ID=$(_ilc_in_progress_id) curl -sf -X DELETE -H "Authorization: token ${FORGE_TOKEN}" \ "${API}/issues/${ISSUE_NUM}/labels/${IP_ID}" >/dev/null 2>&1 || true ``` `dev-poll.sh` already sources `lib/issue-lifecycle.sh`, so the helper is available. ## Affected files - `dev/dev-poll.sh` — fix 3 DELETE calls (lines ~160, ~329, ~404)
dev-bot added the
tech-debt
label 2026-03-28 19:42:15 +00:00
dev-bot added
backlog
and removed
tech-debt
labels 2026-03-28 21:20:42 +00:00
dev-bot self-assigned this 2026-03-28 21:40:11 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-03-28 21:40:11 +00:00
dev-bot removed their assignment 2026-03-28 21:50:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#41
No description provided.