pqm-submit dies if I can't access the submit branch

Bug #253644 reported by Christopher Armstrong
6
Affects Status Importance Assigned to Milestone
Bazaar PQM Plugin
Incomplete
Undecided
Unassigned

Bug Description

For example, if the submit_branch is sftp://<email address hidden>/~foo/bar/baz, it blows up with an authentication error, but it doesn't _really_ need to do anything with the submit branch.

Revision history for this message
Christopher Armstrong (radix) wrote :

I've linked a fix for this. It replaces "except errors.NotBranchError:" with "except:", which sucks because there's no indication of the error, but it's for an optional check anyway.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 253644] [NEW] pqm-submit dies if I can't access the submit branch

On Thu, 2008-07-31 at 14:13 +0000, Christopher Armstrong wrote:
> Public bug reported:
>
> For example, if the submit_branch is sftp://not-
> <email address hidden>/~foo/bar/baz, it blows up with an authentication
> error, but it doesn't _really_ need to do anything with the submit
> branch.

The submit branch should be the trunk and should be publically
accessible (well to the extent that your code is public :P). PQM has
configuration knobs to translate your visible URL's into its writable
URL's.

 status invalid
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Changed in bzr-pqm:
status: New → Invalid
Revision history for this message
Tom Haddon (mthaddon) wrote :

Our case is a little different, I think. We have a two PQM instances that need to be able to connect to Launchpad with two different user ids. We do this by creating two separate LP accounts, two ssh key pairs, and putting the public key for each as appropriate. We then specify both IdentityFiles in .ssh/config for bazaar.launchpad.net and as a result our branch locations have to be sftp://{username}@bazaar.launchpad.net/~{team/person}/{project}/{branch} to allow the PQM user to be able to commit to the appropriate branch. Since PQM requires the submit_branch in .bazaar/locations.conf to match the location in the PQM config in published_at, we have to include the {username} portion in .bazaar/locations.conf of the appropriate user that PQM will connect to LP as. And obviously, each user that's submitting to PQM doesn't have access to that account, so the bzr-pqm plugin fails.

Let us know if there's a better/other way of approaching this.

Changed in bzr-pqm:
status: Invalid → New
Revision history for this message
Tom Haddon (mthaddon) wrote :

I should say, I mean two PQM instances on the same server...

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

I think Robert's point was that you should be configuring pqm-submit to submit to a public location that any developer has access to, and have PQM configured to map that location to whatever it needs to push/pull the branch.

The bzr project uses a submit branch of http://bazaar-vcs.org/bzr/bzr.dev and that is not a URL writable by the PQM instance, so it should definitely be possible.

Changed in bzr-pqm:
status: New → Incomplete
Revision history for this message
Tom Haddon (mthaddon) wrote :

So any ideas how I would do that in this situation (i.e. where the "pqm" OS user has to be able to login to LP as two distinct usernames depending on which instance is configured)?

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

Robert is in the best position to answer the question, but from the sample-pqm.conf file, I'd assume it is something like:

    [location overrides]
    bzr+ssh://<email address hidden>/~user/project/branch=http://bazaar.launchpad.net/~user/project/branch

Or similar (perhaps using bzr+ssh on the right hand side if it is a private branch). Users of pqm-submit use the location on the right (including commands sent to PQM), and PQM uses the location on the left.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 253644] Re: pqm-submit dies if I can't access the submit branch

On Sat, 2008-08-02 at 09:47 +0000, James Henstridge wrote:
> Robert is in the best position to answer the question, but from the
> sample-pqm.conf file, I'd assume it is something like:
>
> [location overrides]
> bzr+ssh://<email address hidden>/~user/project/branch=http://bazaar.launchpad.net/~user/project/branch
>
> Or similar (perhaps using bzr+ssh on the right hand side if it is a
> private branch). Users of pqm-submit use the location on the right
> (including commands sent to PQM), and PQM uses the location on the left.

Yup, which I know for a fact Tom setup for some ubunet stuff just
recently :)..

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Tom Haddon (mthaddon) wrote :

Ok, I tried this but wasn't able to get it working as expected. The users have their public branches on LP as well in a location that's only readable if you're in a certain group, so essentially I needed to be able to rewrite any LP URLs to ensure they were being connected to with the right user. I tried:

sftp://{someuser}@bazaar.launchpad.net/=http://bazaar.launchpad.net/

And had the user's merge request looked like this:

star-merge http://bazaar.launchpad.net/~{someuser}/{project}/{somebranch} http://bazaar.launchpad.net/~{someteam}/{project}/trunk

However, I got:

["PQM Cannot merge between different VCSsystems. 'http://bazaar.launchpad.net/~{someuser}/{project}/{somebranch}'(pqm.Baz1_1Handler) and '/home/pqm/archives/{project}/trunk'(pqm.Bazaar2Handler) are different."]

Doing a bzr info on each branch manually revealed the first was "Standalone branch (format: pack-0.92)" while the second was "Standalone tree (format: pack-0.92)".

Revision history for this message
Robert Collins (lifeless) wrote :

On Mon, 2008-08-11 at 20:31 +0000, Tom Haddon wrote:
> Ok, I tried this but wasn't able to get it working as expected. The
> users have their public branches on LP as well in a location that's only
> readable if you're in a certain group, so essentially I needed to be
> able to rewrite any LP URLs to ensure they were being connected to with
> the right user. I tried:
>
> sftp://{someuser}@bazaar.launchpad.net/=http://bazaar.launchpad.net/

Its not a regex match, so that won't work. The user should just setup
~/.ssh/config to specify username, then bzr won't see them and they will
all be much simpler.

> And had the user's merge request looked like this:
>
> star-merge
> http://bazaar.launchpad.net/~{someuser}/{project}/{somebranch}
> http://bazaar.launchpad.net/~{someteam}/{project}/trunk
>
> However, I got:
>
> ["PQM Cannot merge between different VCSsystems.
> 'http://bazaar.launchpad.net/~{someuser}/{project}/{somebranch}'(pqm.Baz1_1Handler)
> and '/home/pqm/archives/{project}/trunk'(pqm.Bazaar2Handler) are
> different."]

It failed to detect bzr correctly - because it can't access the branch
over http - private branches on launchpad are not accessible except via
bzr+ssh or sftp.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

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.