Skip to content

Fix unarchive issue reopening and archive-done idempotency#26

Merged
aarontrowbridge merged 5 commits intomainfrom
copilot/implement-task-issues
Feb 8, 2026
Merged

Fix unarchive issue reopening and archive-done idempotency#26
aarontrowbridge merged 5 commits intomainfrom
copilot/implement-task-issues

Conversation

Copy link

Copilot AI commented Feb 8, 2026

Two bugs when moving tasks back from archived/done state: (1) unarchived Issues remained closed on GitHub despite project board status updating, and (2) --archive-done required a follow-up run without the flag to stabilize.

Unarchive reopens closed Issues

  • Added reopen_issue() GraphQL mutation and get_item() single-item fetch to GitHubProjectClient
  • Unarchive path in execute_sync() now immediately applies task fields (status, etc.) and reopens the underlying Issue
# Before: only unarchived on the board, Issue stayed closed
client.unarchive_item(task.board_item_id)

# After: unarchive, apply fields, and reopen
client.unarchive_item(task.board_item_id)
_apply_task_fields(client, task.board_item_id, task, fields)
bi = client.get_item(task.board_item_id)
if bi and bi.content_type == "Issue" and bi.content_id:
    client.reopen_issue(bi.content_id)

--archive-done idempotency

  • Moved remove_done_tasks() from post-sync to pre-sync so the file is cleaned before the sync plan is built
  • Second run now finds no Done tasks in file, no-ops correctly instead of requiring a follow-up run

Tests

  • 5 new tests covering unarchive+reopen (Issue, DraftIssue, failure tolerance) and archive-done idempotency (repeated runs, empty Done section)

TASKS.md

  • Updated to reflect both tasks moved to Done

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 8, 2026 08:23
Co-authored-by: jack-champagne <43344745+jack-champagne@users.noreply.github.com>
Bug 1: When unarchiving a task, reopen the underlying GitHub Issue and
apply task fields (e.g. status) immediately instead of deferring to the
next sync run.

Bug 2: Move remove_done_tasks() to run before sync when --archive-done
is set, making repeated runs idempotent.

Co-authored-by: jack-champagne <43344745+jack-champagne@users.noreply.github.com>
…log level, update TASKS.md

Co-authored-by: jack-champagne <43344745+jack-champagne@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement multiple issues and update TASKS.md Fix unarchive issue reopening and archive-done idempotency Feb 8, 2026
Copilot AI requested a review from jack-champagne February 8, 2026 08:31
@jack-champagne jack-champagne marked this pull request as ready for review February 8, 2026 16:11
@jack-champagne
Copy link
Member

TASKS.md Sync Preview (dry run)

Action Count
Create 0
Update 2
Archive 0
Unchanged 1

This is a preview. Changes will be applied when merged to main.

@aarontrowbridge aarontrowbridge merged commit 25b7f1b into main Feb 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants