Skip to content

DRU-982 -- Return cancelled and closed work to rest only while active - #1081

Draft
dserbano wants to merge 1 commit into
mainfrom
issues/982
Draft

dserbano wants to merge 1 commit into
mainfrom
issues/982

Conversation

@dserbano

@dserbano dserbano commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

An operator cancel left the tracker ticket in progress or in review, because WorkItem.resolve(Resolution.CANCELLED) only stored the resolution. A cancel now returns the ticket to the resting status, the same as a pull request closed without merge. Both move the ticket only while it is still in progress or in review, so a ticket someone already moved, for example to done, stays where it is.

Tracker.get_active_status_names gives the in progress and in review names: the configured ones, or the board's own statuses. Each tracker checks the current status against them before the resting move:

  • Board: the ticket's status.
  • Linear: LinearClient.update_issue_status takes only_from=. None allows any status.
  • Jira: the status it already reads to skip a self-transition.
  • GitHub: the issue is open and carries an active label.

@mintlify

mintlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
druks 🟢 Ready View Preview Nov 4, 2026, 12:46 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@dserbano

dserbano commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Testing and scope for this change.

Scope. The only caller that asks for the resting status is the last line of WorkItem.resolve, and every new check sits behind status == TicketStatus.BACKLOG. Moves to in progress, in review, and done are unchanged. only_from defaults to None, so other LinearClient callers are unaffected. No setting, migration, workflow step, or event shape changes, so in-flight builds replay as before. A tracker error on the resting move is still caught and logged by set_ticket_status, so it cannot fail a cancel.

Behavior that does change, all intended:

  • A cancel now writes to the tracker, which can fire tracker-side automations.
  • A PR closed without merge no longer moves a ticket that someone already moved out of in progress or in review.
  • With both in progress and in review unmapped, nothing counts as active, so the resting move never happens.
  • The GitHub tracker reads the issue once before the resting move. It requires an open issue because someone can close the issue by hand while a build still holds it, and the active label stays on.

Automated. Ruff lint and format pass. druks-house-rules check --base origin/main passes. backend/tests/software_factory passes (334 tests). test_cancel_ticket_status.py covers the board rule for every status and the GitHub open-and-active rule. test_linear_client_skips_the_mutation_from_a_status_not_allowed covers only_from against a mocked Linear HTTP transport, like the other LinearClient tests. The Jira rule has no test.

Manual, on a local install of this branch against dserbano/druks-test-stub. I cancelled each build from its work-item page, then read the ticket from the tracker.

Tracker Ticket Before cancel After cancel
Linear OSS-83 In Progress (set by Druks) Backlog
Linear OSS-84 In Review Backlog
Linear OSS-85 Done Done
Board DSE-15 In Progress Backlog

The Linear builds started from signed webhooks posted to the install. Each carried a druks-test-stub routing label, because the test key cannot create labels. Jira and the closed-PR path were not run by hand. A local build without a Linear MCP stops at planning and never opens a PR.

This branch was successfully deployed

1 active deployment
staging - docs — 610b5890 Deployed Nov 4, 2026 by mintlify[bot]
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.

1 participant