You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DRU-982 -- Return cancelled and closed work to rest only while active - #1081
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.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_namesgives 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:LinearClient.update_issue_statustakesonly_from=.Noneallows any status.