2072: Bug Tracker URL hides templated section of url, causes append error

buzm*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Dec. 23, 2012
What version are you running?
1.5.5

What's the URL of the page containing the problem?
/admin/db/scmtools/repository/<repository_id>/

What steps will reproduce the problem?
1. Access the Database -> Repositories Admin page
2. Create a repository with a trac bug tracker url http://trac.example.com/ticket/%s
3. Save the repository
4. Modify the Bug Tracker URL to http://trac2.example.com/ticket/%s
5. Save the repository.

What is the expected output? What do you see instead?
Expected output is for the Respository Admin ui to show the full url of trac, and for the trac url to be correctly stored after each edit.

However,
* the admin ui hides the /ticket/%s part of the url. After step 3, the Bug Tracker URL will be showing as 

http://trac.example.com/ 

although the scmtools_repository.bug_tracker column in the db is storing the full url

* having modified the url in the admin ui, the database is storing a corrupt version of the url. After step 5 the Bug Tracker URL will now be showing as http://trac2.example.com/. The scmtools_repository.bug_tracker column in the db however now has the value 

http://trac2.example.com/ticket/%s/ticket/%s

This causes the following exception to be thrown

  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.5.5-py2.6.egg/reviewboard/reviews/templatetags/reviewtags.py", line 372, in bug_url
    return review_request.repository.bug_tracker % bug_id

TypeError: not enough arguments for format string

 
What operating system are you using? What browser?
Hosted on Debian linux with Python 2.6, Apache 2.2 and mod_python. 
Chrome 10.0.6 web browser on OSX

Please provide any additional information below.
A similar problem occurs when leaving the host/domain of the url the same and just editing the path.
david
#1 david
We have proper validation for this now.
  • +Fixed