-
Notifications
You must be signed in to change notification settings - Fork 12
Description
The sync command output isn't always useful and can be cryptic. Improve the overall UX of sync output to make it clearer what happened and why.
Tasks
Show why issues aren't closing during sync
Description
When a user runs dex sync after completing tasks, some issues may stay open because commits aren't pushed yet. Add feedback about WHY an issue wasn't closed (e.g., commit not pushed, subtask missing commit, etc.).
Result
Added feedback to sync command explaining why issues stay open:
Changes:
- Added
issueNotClosingReasonfield toSyncResultinterface - Implemented
getIssueNotClosingReason()method in GitHubSyncService that returns clear reasons:- "commit abc1234 not pushed to remote" - for unpushed commits
- "subtask xyz789 commit def456 not pushed" - for subtasks with unpushed commits
- "subtask xyz789 not completed" - for incomplete subtasks
- "subtask xyz789 completed without commit" - for subtasks missing commits
- "completed without commit (use --no-commit to close manually)" - for tasks without any commit
- CLI now shows warnings:
! taskid: issue staying open (reason)
Testing:
- Added 7 new tests for
getIssueNotClosingReason - All 889 existing tests pass
Add bidirectional sync reconciliation
Description
During sync, detect when remote state differs from local and reconcile.
Key mechanism: Track remote 'updated_at' timestamp in local metadata. If remote updated_at is newer than stored value, the remote was modified elsewhere (another machine or GitHub UI).
Reconciliation rules:
- If remote metadata shows completed:true but local is incomplete, update local task
- If remote updated_at is newer, prefer remote state for conflict resolution
- This handles stale local dex state after completing on another machine
Result
Added bidirectional sync reconciliation for subtasks during GitHub sync.
When remote issue state is newer than local, the sync now:
- Detects stale local subtasks by comparing updated_at timestamps
- Pulls completion state (completed, completed_at, started_at, result)
- Pulls commit metadata if present in remote but not local
This handles the scenario where tasks are completed on Machine A, synced to GitHub, then Machine B with stale local state needs to sync and pull the updated subtask state.
Added tests verifying:
- Subtask state is pulled when remote is newer
- Subtask state is not pulled when local is newer
Code simplified by removing unused parentId parameter from reconcileSubtasksFromRemote method.