lp-propose redirected me to a page which had a leading '1.0'

Bug #619412 reported by Guilherme Salgado
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned
launchpadlib
Invalid
Undecided
Unassigned

Bug Description

I've just used lp-submit to submit a branch and after it was done it redirected me to https://code.edge.launchpad.net/1.0/~salgado/launchpad/upload-policy-utility/+merge/32911, which is wrong as it has a leading /1.0 path element.

Tags: lp-propose
Revision history for this message
John A Meinel (jameinel) wrote :

I think the recommended name is actually 'lp-propose' now, but it does still have 'lp-submit' as an alias.

Anyway, the issue is probably in:
def canonical_url(object):
    """Return the canonical URL for a branch."""
    scheme, netloc, path, params, query, fragment = urlparse.urlparse(
        str(object.self_link))
    path = '/'.join(path.split('/')[2:])
    netloc = netloc.replace('api.', 'code.')
    return urlparse.urlunparse((scheme, netloc, path, params, query,
                                fragment))

The issue being that 'self_link' is an api.... style url, but that isn't useful for opening a web browser.

In other code in bzr (or hydrazine?) I've seen "url.replace('api.launchpad.net/1.0', 'code.launchpad.net')"

Regardless, I think the *real* fix is to have Launchpad api objects give you a url that you can give to users, rather than trying to fake it in the wrapper code.

I think this can be fixed here, but I think it is also a launchpadlib issue, so I'll add that project.

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 619412] Re: lp-submit redirected me to a page which had a leading '1.0'

On 18 August 2010 05:13, John A Meinel <email address hidden> wrote:
> I think this can be fixed here, but I think it is also a launchpadlib
> issue, so I'll add that project.

There is another bug asking for this. I don't know the state off
hand. It may have been fixed and our code is just old.

--
Martin

Revision history for this message
Gary Poster (gary) wrote : Re: lp-submit redirected me to a page which had a leading '1.0'

launchpadlib: bug 316694. Not done as of this writing. Marking launchpadlib task as invalid.

Changed in launchpadlib:
status: New → Invalid
Jelmer Vernooij (jelmer)
summary: - lp-submit redirected me to a page which had a leading '1.0'
+ lp-propose redirected me to a page which had a leading '1.0'
Jelmer Vernooij (jelmer)
tags: added: lp-propose
Revision history for this message
Max Bowsher (maxb) wrote :

Something looking very much like this was fixed in bzr.dev r5171, for bzr 2.2b3. Please re-open if you can reproduce with bzr 2.2.x or later. If you do, please state the version of launchpadlib in use.

Changed in bzr:
status: Confirmed → Fix Released
Revision history for this message
Leonard Richardson (leonardr) wrote :

I just landed a branch that publishes a 'web_link' for most objects in the Launchpad web service (see bug 316694). You should be able to simplify your code by using web_link instead of manipulating selflink.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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