Allow building snap from current default branch of repository
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Colin Watson | ||
launchpad-buildd |
Fix Released
|
High
|
Colin Watson |
Bug Description
Launchpad allows building a snap from any branch in a Git repository, if named explicitly. However, it would be useful to be able to have a way to represent the notion of building from whatever the current default branch is: for instance, I think this would be a clean way to fix https:/
We generally prefer to pass IGitRef-providing objects around internally rather than explicit repository/path combinations (see e.g. GitRefRemote), and I don't want to unwind that. However, the repository scanner doesn't and probably shouldn't create GitRef rows for HEAD, instead just setting GitRepository.
I think the most elegant way to handle this would be as follows:
* Allow launchpad-buildd to accept a snap build without git_path, turning that into a simple 'git clone' rather than 'git clone -b <git_path>'.
* Extend GitRepository.
* Adjust SnapBuildBehaviour to omit git_path if one of these "use the default branch" GitRef objects is passed.
Related branches
- Evan (community): Approve
-
Diff: 46 lines (+13/-8)2 files modifiedbuildsnap (+6/-8)
debian/changelog (+7/-0)
- William Grant (community): Approve (code)
-
Diff: 300 lines (+143/-29)6 files modifiedlib/lp/code/configure.zcml (+6/-1)
lib/lp/code/model/gitref.py (+71/-25)
lib/lp/code/model/gitrepository.py (+6/-1)
lib/lp/code/model/tests/test_gitrepository.py (+16/-0)
lib/lp/snappy/model/snapbuildbehaviour.py (+3/-2)
lib/lp/snappy/tests/test_snapbuildbehaviour.py (+41/-0)
Changed in launchpad-buildd: | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in launchpad: | |
assignee: | nobody → Colin Watson (cjwatson) |
Changed in launchpad-buildd: | |
assignee: | nobody → Colin Watson (cjwatson) |
Changed in launchpad-buildd: | |
status: | In Progress → Fix Committed |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Fixed in launchpad-buildd 143 (but there's still a branch to land on the Launchpad side).