Honour repository default branch setting [2] #497

Closed
popey opened this Issue Mar 15, 2017 · 8 comments

Comments

Projects
None yet
7 participants

popey commented Mar 15, 2017

I have a project at https://github.com/popey/home-assistant yaml at https://github.com/popey/home-assistant/blob/dev/snap/snapcraft.yaml - tried hooking it up to build.s.i and got
"Could not find snap/snapcraft.yaml. Are you sure you're in the right directory?"
https://build.snapcraft.io/popey/home-assistant/builds/27893

Collaborator

cjwatson commented Mar 15, 2017

This is because we hardcode the master branch at present. This is almost a duplicate of #440, except that this issue also exposes the fact that in this case the repository's default branch is set to dev rather than master, and we should honour that as the default even once we allow branch selection.

@cjwatson cjwatson changed the title from Could not find snap/snapcraft.yaml to Doesn't honour repository default branch setting Mar 15, 2017

@cjwatson cjwatson changed the title from Doesn't honour repository default branch setting to Honour repository default branch setting Mar 15, 2017

@evandandrea evandandrea added this to the GA milestone Apr 18, 2017

Collaborator

evandandrea commented Apr 23, 2017

I'm bumping this down in priority some, but not yet dropping it from GA. I did a quick scan of the trending repositories on GitHub and not a single one used something other than master for the default branch.

@ghost ghost added the Status: Proposal label Apr 24, 2017

@ghost ghost removed the Status: Proposal label Apr 25, 2017

@ghost ghost modified the milestone: GA Apr 25, 2017

@ghost ghost changed the title from Honour repository default branch setting to Honour repository default branch setting [1] Apr 25, 2017

Collaborator

cjwatson commented May 3, 2017

My inclination for this is to change Launchpad to allow passing HEAD as the git_path for a snap to indicate the default branch, which would be more or less consistent with the behaviour of git itself. We can then change the hardcoded refs/heads/master in BSI to be HEAD instead.

@cjwatson cjwatson changed the title from Honour repository default branch setting [1] to Honour repository default branch setting [2] May 3, 2017

@cjwatson cjwatson self-assigned this May 3, 2017

@cjwatson cjwatson changed the title from Honour repository default branch setting [2] to Honour repository default branch setting [1] May 3, 2017

@cjwatson cjwatson changed the title from Honour repository default branch setting [1] to Honour repository default branch setting [2] May 3, 2017

cjwatson pushed a commit to cjwatson/build.snapcraft.io that referenced this issue May 17, 2017

Use default branch rather than hardcoding master
The links to create/edit `snapcraft.yaml` were problematic: we haven't
necessarily fetched repository information from GitHub yet when these
are needed, and doing so was going to be quite cumbersome.  Instead, I
introduced server endpoints that fetch the current default branch from
GitHub and redirect to the appropriate URL, which is much simpler.

Fixes #497.

@cjwatson cjwatson added in progress and removed in progress labels May 17, 2017

Contributor

elopio commented Jun 13, 2017

This affects https://github.com/ethereum/cpp-ethereum
It's failing to build because it has develop as the default branch, with the snapcraft.yaml. Master hasn't been touched in a long time.

@elopio elopio referenced this issue in ethereum/cpp-ethereum Jun 13, 2017

Merged

update the source of the snap package #4139

cjwatson pushed a commit to cjwatson/build.snapcraft.io that referenced this issue Jul 19, 2017

Use default branch rather than hardcoding master
The links to create/edit `snapcraft.yaml` were problematic: we haven't
necessarily fetched repository information from GitHub yet when these
are needed, and doing so was going to be quite cumbersome.  Instead, I
introduced server endpoints that fetch the current default branch from
GitHub and redirect to the appropriate URL, which is much simpler.

Fixes #497.

@bartaz bartaz self-assigned this Jul 20, 2017

@cjwatson cjwatson closed this in #783 Jul 20, 2017

cjwatson added a commit that referenced this issue Jul 20, 2017

Use default branch rather than hardcoding master (#783)
This requires fetching repository information from GitHub when fetching
information about snaps.  We store the default branch in memcached to
minimise the number of additional API requests this causes.

Fixes #497.
Contributor

elopio commented Jul 20, 2017

Thanks a lot for the fix @cjwatson!

Is there something to do in the existing builds? cpp-ethereum is still failing: https://launchpad.net/~build.snapcraft.io/+snap/6d3df757960b94b20e2665180ef14f58-xenial

Collaborator

cjwatson commented Jul 20, 2017

@elopio The fix is in master but not rolled out yet. That'll happen in due course. We'll probably also need to look at existing snaps and update them where necessary.

Collaborator

evandandrea commented Jul 31, 2017

Thanks for fixing this. I just noticed https://build.snapcraft.io/user/ovilab/atomify is affected.

Is this still working its way to production? May we have a rollout this week?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment