ProductBranchVocabulary token should be branch.unique_name

Bug #43807 reported by David Allouche
14
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
James Henstridge

Bug Description

Currently the token used by the ProductBranchVocabulary (that ends up displayed in the form) is the branch.id.

We must not expose database branch ids in the UI. Instead we should use the guaranteed-unique and more human-readable Branch.unique_name for that purpose.

Tags: lp-code ui
Revision history for this message
David Allouche (ddaa) wrote :

See https://launchpad.net/products/bzr/+bug/40474/+addbranch for an example.

Initially reported as bug 42488.

Changed in launchpad-bazaar:
status: Unconfirmed → Confirmed
Revision history for this message
James Henstridge (jamesh) wrote :

My jamesh/launchpad/branch-vocabulary branch fixes this up, and also lets people enter a registered branch URL as a token too.

Changed in launchpad-bazaar:
assignee: nobody → jamesh
status: Confirmed → In Progress
Revision history for this message
David Allouche (ddaa) wrote :

Does it also allow using the public supermirror url for a branch?

If yes, then it does all that was originally intended.

Revision history for this message
James Henstridge (jamesh) wrote :

The code for parsing a string token to a vocabulary term does this:

 1. check if the token looks like an http, https, ftp or sftp URL
 2. if so, then use IBranchSet.getByUrl() to find the branch.
 3. otherwise use IBranchSet.getByUniqueName().

The getByUrl() method checks for both the registered URL and our mirror URL, so the vocabulary handles both (there is a test to verify this).

Changed in launchpad-bazaar:
status: In Progress → Fix Committed
Revision history for this message
James Henstridge (jamesh) wrote :

Fixed in today's production rollout.

Changed in launchpad-bazaar:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.