fix(sync): gitea_task_tracker_sync claims "1 card(s) processed" for read-only actions #35
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea#35
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Symptom
gitea_task_tracker_syncreportsTask Tracker Sync: 1 card(s) processed.for actions that process no cards.status_maponly returns the status mapping andconvert_cardonly converts one card, yet both claim a card was processed.Repro
Observed vs expected
data.count ?? 1, so any action without acountis reported as "1 processed".status_map: print the contract + mapping (open→status/ready, …).convert_card: print the converted Gitea fields (state, target label) without claiming a sync/process.export_cards: keep the count.Root cause
lib/handlers/formatters.js:lib/task-tracker-sync.jsreturns{contract, mapping}forstatus_mapand the converted payload forconvert_card— neither hascount.Proposed fix
Branch on the returned shape (mapping present → print the mapping; converted card present → print state + target label + number; count present → keep the current line). Add formatter tests for all four actions.
Acceptance: read-only actions never claim processing;
export_cards/sync_cardkeep accurate counts.Duplicate check
Searched
tracker/sync(state all) — no existing issue.Layer
dsh-gitea plugin/tool (formatter).
Fixed in
281eade(PR #40).The formatter branches on the returned shape:
status_mapprints the contract + mapping,convert_cardprints the converted state/label,export_cardsprints the real count,sync_cardthe sync result. Read-only actions no longer claim “1 card(s) processed”.Live:
status_map→ contract +todo → status/ready…;convert_card→#2 "QA probe" → state open, target label status/in-progress;export_cards→2 card(s) exported.Tests:
test/qa-defaults.test.mjs.