Edgewall Software
Modify

Opened 7 years ago

Closed 3 years ago

#11093 closed defect (duplicate)

subversion hook scripts do not respect the trac workflow

Reported by: anonymous Owned by:
Priority: normal Milestone:
Component: version control Version:
Severity: normal Keywords: workflow
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

If i configure the following workflow within trac:

leave = * -> *
leave.default = 1
leave.operations = leave_status
accept = new,assigned,reopened -> accepted
accept.operations = set_owner_to_self
accept.permissions = TICKET_MODIFY
reassign = new,assigned,accepted,reviewing,reopened -> assigned
reassign.operations = set_owner
reassign.permissions = TICKET_MODIFY
review = new,assigned,accepted,reopened -> reviewing
review.operations = set_owner
review.permissions = TICKET_MODIFY
reopen = closed -> reopened
reopen.operations = del_resolution
reopen.permissions = TICKET_CREATE
resolve = reviewing -> closed
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY

it should be not possible to switch from any other state than reviewing to closed. But with subversion hook scripts like trac-svn-post-commit-hook this is totally ignored and tickets can be closed directly from new or other states.

Attachments (0)

Change History (9)

comment:1 by Christian Boos, 7 years ago

Component: generalversion control
Description: modified (diff)
Keywords: workflow added
Milestone: next-stable-1.0.x

This is likely an oversight.

comment:2 by Sebastian Dietrich, 5 years ago

It should also be possible to switch to other states than closed. In the example above the keyword fixed in a commit message could put a ticket into the state reviewing.

comment:3 by Sebastian Dietrich, 5 years ago

Ideally the keywords and the transitions they effect should be configurable, e.g. one can configure new keywords.

comment:4 by Sebastian Dietrich, 5 years ago

Additionally a sort of dry-run handler should be added. This handler could be run in the pre commit hook. It would allow to abort a commit when the committer does not have sufficient rights to perform the actions mentioned in the commit message or if the mentioned actions are not plausible (e.g. closing an already closed ticket).

One example could be to enforce the following rules:

  • Every commit must mention at least one ticket.
  • All mentioned tickets must be in the state open.

in reply to:  4 comment:5 by Ryan J Ollos, 5 years ago

Replying to Sebastian Dietrich:

One example could be to enforce the following rules:

  • Every commit must mention at least one ticket.
  • All mentioned tickets must be in the state open.

See branches/1.0-stable/contrib/trac-pre-commit-hook.

comment:6 by Ryan J Ollos, 4 years ago

Milestone: next-stable-1.0.xnext-stable-1.2.x

Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.

comment:7 by anonymous, 3 years ago

I am hitting the same problem. I used to have a custom post-commit that no longer works after we upgraded to 1.2.2, but the new tracadmin changeset approach is directly changing the status to closed, bypassing our custom workflow.

in reply to:  7 comment:8 by anonymous, 3 years ago

Replying to anonymous:

I am hitting the same problem. I used to have a custom post-commit that no longer works after we upgraded to 1.2.2, but the new tracadmin changeset approach is directly changing the status to closed, bypassing our custom workflow.

See commit_updater.py@L277.

comment:9 by Ryan J Ollos, 3 years ago

Milestone: next-stable-1.2.x
Resolution: duplicate
Status: newclosed

This is non-trivial to fix properly. For an immediate solution, you could copy commit_updater.py and create a new single-file plugin to fit your needs. See comment:5:ticket:10755.

Duplicate of #10755.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.