"charms" needs branch name consistency

Bug #983530 reported by Clint Byrum
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
Undecided
Unassigned
pyjuju
Triaged
Low
Unassigned

Bug Description

Currently the charm store only publishes branches in the launchpad distro 'charms' namespace if they are marked as 'trunk'.

This causes problems with the way launchpad's distro organization works, as they name the branches not 'trunk' but $series. After branching a new distro, we had to rename all the official branches from 'precise' to 'trunk' to get the charm store to pick them up.

It might seem like it would make more sense to ship the branches that are marked as 'Mature' in branch metadata, rather than only the ones named 'trunk.' However, the charm store needs to have a single charm for each piece of the charm namespace. The name trunk is used because that is the one that is used when somebody pushes to lp:charms/foo .

It would make more sense for the branch-distro script to just create the branches named trunk for consistency with the other ways to create branches.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

The Launchpad branch name is:

    lp:~user/charms/series/project/trunk

And that gets mapped to:

    cs:~user/series/project

The reason why we map "trunk" is because that's the default branch name in Launchpad, but no matter which name it is, we can only map a single name to allow such naming scheme.

That said, in the future we'll extend the branch names supported by introducing the concept of subsets of charms for specific purposes (e.g. production vs. testing, etc). This will have richer semantics, and will use the branch name in a specific scheme to be defined.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Ugh, the problem is in the branch-distro script which launchad uses to move distros forward, the default branch name is actually $series. Launchpad doesn't have the namespace problem in a distro because of the 'official' pointer, but it doesn't handle the per-user case.

Could we instead ship all *official* branches regardless of their name?

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

The default branch name when you push to lp:~you/foo/bar is trunk.

Can we instead ask the Launchpad folks to fix that problem by moving branches forward to trunk? Maybe I'm missing something obvious, but I really don't see the point of having series twice in the URL.

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 983530] Re: charm store should publish all 'Mature' branches.

Excerpts from Gustavo Niemeyer's message of Mon Apr 16 23:20:21 UTC 2012:
> The default branch name when you push to lp:~you/foo/bar is trunk.
>
> Can we instead ask the Launchpad folks to fix that problem by moving
> branches forward to trunk? Maybe I'm missing something obvious, but I
> really don't see the point of having series twice in the URL.
>

I agree completely. There was a bit of a winding twisted discussion on
#launchpad-dev which did not come to any conclusions but at least brought
forth the agreement that the push-to-create-branch feature should be
consistent with branch-distro.

We have 6 months to get that fixed before we move the charm store
forward to "Q". I suggested that in order to not disrupt Ubuntu we
introduce a --branch-name argument to the branch-distro script that is
run to open a new series.

Perhaps more complete would be to have a setting for the distro code that
controls charms specific behavior. There are a number of other reasons
to do that, such as the lack of publishing, resulting in strange error
messages and warnings all over because the charms don't have published
versions.

I'd suggest that we should probably put forth a list of features and
changes we need done in Launchpad to improve the charm development
experience for ~charmers, otherwise we can just document the needed
steps to rename the branches before and/or after branch-distro runs.

summary: - charm store should publish all 'Mature' branches.
+ "charms" needs branch consistency
summary: - "charms" needs branch consistency
+ "charms" needs branch name consistency
description: updated
Changed in juju:
status: New → Invalid
Revision history for this message
Robert Collins (lifeless) wrote :

Sorry, I'm not clear what the problem is.

Changed in launchpad:
status: New → Incomplete
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

We had some more IRC discussions, but the here is the krux of the problem:

If somebody pushes to

lp:distro/packagename

The branch created is

lp:~theiruser/distro/current-dev-series/packagename/trunk

However, if the script branch-distro.py is used to create a new series for a distro, all branches (regardless of their old name) are copied as

lp:~theiruser/distro/new-series/packagename/new-series

This means that the branch is not detected as existing. It is also confusing for the juju charm store, which wants to map

lp:~anyuser/charms/series/packagename/trunk

to a single published charm for each user/series/package combination found. The charm store uses 'trunk' as the name for the charm to publish, so that users can have other charm branches in the namespace that are not published.

So, I am suggesting consistency in distro branch creation. Either always use 'trunk', or always use 'series', but not both. If the series is used, then we can change the charm store implementation. If 'trunk' is used, then we have to think about what impact this might have on Ubuntu Distributed Development.

Changed in launchpad:
status: Incomplete → New
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

There are two separate issues here:

One is the distro-branch script creating branches with a name that might not be optimal (the series).

The other issue is that the charm store assumes that series branch are named trunk. That's a bug. There is no such guarantee. Each series can specify which branch is it's "official" branch. And the charm store should be able to detect that using Launchpad metadata.

Changed in launchpad:
status: New → Invalid
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Well said Francis.

We have "official" charms which are pointed at by running 'promulgate' script that you wrote. These, indeed, should just be taken without respect to 'trunk' or not. For those, I do believe that the charm storee code should be changed. We should walk all branches in the lp:charms namespace, and if it has an official pointer, publish to the charm store.

We also have the unofficial charms which right now we identify by the name 'trunk' because we have no other obvious way for users to make a distinction between "publish this one" or "don't publish this". However, that is neither here nor there, because the charm store can continue using that for non "official" charms.

Changed in juju:
status: Invalid → New
Curtis Hovey (sinzui)
Changed in juju:
importance: Undecided → Low
status: New → Triaged
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.