Edgewall Software
Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#12882 closed defect (fixed)

TracError is not raised even if <action>.set_resolution is empty

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.17
Component: ticket system Version: 1.0
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Improve validations for <action>.set_resolution attribute in ticket-workflow.

API Changes:
Internal Changes:

Description

At tags/trac-1.0.15/trac/ticket/default_workflow.py@:280-281,284#L278, it seems TracError with the following message is raised if resolutions specified in set_resolution attribute are not available.

Your workflow attempts to set a resolution but none is defined
 (configuration issue, please contact your Trac admin).

However, the exception is not actually raised because the following expression would be [''], not an empty list.

                resolutions = [x.strip() for x in
                               this_action['set_resolution'].split(',')]
>>> this_action = {'set_resolution': ''}
>>> [x.strip() for x in this_action['set_resolution'].split(',')]
['']

Another issue, I think we should ignore undefined resolutions specified in the set_resolution attribute. Currently, any values can be specified in.

Attachments (0)

Change History (6)

comment:1 by Jun Omae, 3 years ago

Owner: set to Jun Omae
Status: newassigned

Proposed changes in [4fc9ed549/jomae.git] (jomae.git@t12882).

Last edited 3 years ago by Jun Omae (previous) (diff)

comment:2 by Ryan J Ollos, 3 years ago

Checking for valid resolutions is a good idea. I documented the constraint in TracWorkflow@74.

Two notes:

  • r13443 and r13445 used to_list so the none is defined error is correctly raised on 1.2-stable and trunk
  • We might want to raise ConfigurationError

comment:3 by Jun Omae, 3 years ago

Thanks. That makes sense.

Revised branch and created branches for 1.2-stable and trunk:

comment:4 by Ryan J Ollos, 3 years ago

Looks good to me.

comment:5 by Jun Omae, 3 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [16253] and merged in [16254-16255].

comment:6 by Ryan J Ollos, 3 years ago

Milestone: 1.0.161.0.17

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae 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.