Opened 13 years ago
Last modified 3 years ago
#10755 new enhancement
[PATCH] CommitTicketUpdater does not allow user to define what state to jump to
Reported by: | patrick.little | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | ticket system | Version: | 0.12.3 |
Severity: | normal | Keywords: | CommitTicketUpdater patch |
Cc: | ethan.jucovy@…, sterkrig@…, skrattaren@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The CommitTicketUpdater will only ever close a ticket. In general, the closed state is for when no more work is to be done, aka after QA has verified the fix. Trac should allow configuration of what state name the ticket will get updated to.
Attachments (1)
Change History (24)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Cc: | added |
---|
comment:3 by , 12 years ago
This would be cool!
In addition, it would be great if the CommitTicketUpdater would use the default_resolution
configured in the [ticket]
section of trac.ini
if no other state has been specified. Currently, it sets the state to fixed
(hard-coded in commit_updater.py
, line 251), although my custom workflow has no fixed
state.
comment:4 by , 12 years ago
Cc: | added |
---|
follow-ups: 6 8 comment:5 by , 12 years ago
For those who are looking for a workaround for this lack of feature, I added a simple plugin to do what I wanted:
from tracopt.ticket.commit_updater import CommitTicketUpdater class CustomCommitTicketUpdater(CommitTicketUpdater): def cmd_close(self, ticket, changeset, perm): if not self.check_perms or 'TICKET_MODIFY' in perm: ticket['status'] = 'reviewing' ticket['owner'] = ticket['reporter']
comment:6 by , 12 years ago
Replying to Paul Wise <pabs3@…>:
For those who are looking for a workaround for this lack of feature, I added a simple plugin to do what I wanted:
from tracopt.ticket.commit_updater import CommitTicketUpdater class CustomCommitTicketUpdater(CommitTicketUpdater): def cmd_close(self, ticket, changeset, perm): if not self.check_perms or 'TICKET_MODIFY' in perm: ticket['status'] = 'reviewing' ticket['owner'] = ticket['reporter']
I've tried following the various tutorials and I just can't get the plugin to show up in my admin panel. I can follow the t-h.o egg cooking tutorial and get the helloworld example to show up, but when I switch over to this code nothing shows up.
comment:7 by , 12 years ago
Milestone: | → unscheduled |
---|
A few configuration options for the commit ticket updater could indeed help.
comment:8 by , 12 years ago
I find that the simple plugin approach works but there's something odd going on as the ticket goes to 'closed' first and then the custom updater moves it to 'reviewing' (or 'test' or whatever), resulting in two entries in the ticket's history. It's like the base implementation is being called and the simple plugin is not overriding that behaviour. Am I missing something simple here?
follow-up: 10 comment:9 by , 12 years ago
If your plugin subclasses CommitTicketUpdater
, you need to disable the base component (tracopt.ticket.commit_updater.CommitTicketUpdater
) in trac.ini
.
comment:10 by , 12 years ago
Replying to rblank:
If your plugin subclasses
CommitTicketUpdater
, you need to disable the base component (tracopt.ticket.commit_updater.CommitTicketUpdater
) intrac.ini
.
That works perfectly. Many thanks.
comment:11 by , 11 years ago
Cc: | removed |
---|
comment:12 by , 11 years ago
Cc: | added |
---|
comment:13 by , 11 years ago
Keywords: | CommitTicketUpdater added |
---|
comment:14 by , 11 years ago
Cc: | added |
---|
comment:15 by , 11 years ago
Please clear the reported by field - I no longer am using Trac and do not want to keep getting ticket updates when something changes.
comment:16 by , 11 years ago
Reporter: | changed from | to
---|
comment:17 by , 11 years ago
Milestone: | unscheduled → next-major-releases |
---|---|
Priority: | highest → normal |
Severity: | major → normal |
comment:19 by , 8 years ago
TODO Add documentation when implemented, see TracWorkflow@72.
See also 0.11/TracWorkflow.
comment:20 by , 7 years ago
comment:22 by , 3 years ago
Added a patch which addresses this problem. Patch is against current trunk (Rev. 17579)
The Patch introduces two new options: for [ticket]
option | description | default |
---|---|---|
commit_ticket_update_close_state | State to change to if a close command is detected. | closed |
commit_ticket_update_close_resolution | Resolution to set, if closed state is closed. | fixed |
comment:23 by , 3 years ago
Keywords: | patch added |
---|---|
Summary: | CommitTicketUpdater does not allow user to define what state to jump to → [PATCH] CommitTicketUpdater does not allow user to define what state to jump to |
Yes, this would be a nice feature. I've wanted to be able to define reopens as a keyword that changes the state of the ticket to reopened, as well as transition tickets that are fixed from accepted → implemented, rather than from accepted to closed.