weblink github fetching snapcraft.yaml fails if branch 'HEAD' exists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Unassigned |
Bug Description
I was trying to automatically build and publish the freeorion snap (using a weblink to repositoy agrrr3/freeorion).
That worked a while and suddenly failed, using an old snapcraft.yaml file. I opened a ticket against snapcraft.io
https:/
And they figured out that launchpad tries to fetch the snapcraft.yaml from
https:/
But that did not return the contents from the default branch
https:/
On snapcraft.io people were guessing that maybe launchpad should use the API or retrieve the correct revision in a different way.
They told me to open this ticket against launchpad.
I opened a support ticket against github and they told me that I have a branch named 'HEAD' and that was the reason I got the contents from that branch instead of the default branch.
TLDR;
By mistake I had created a branch named HEAD (push origin master:HEAD) and that broke the automatic snapcraft build. Deleting that branch (push origin :HEAD) solved that for me. But this may bite other people as well - the behavior is pretty opaque/surprising.
Ah! Mystery solved, thanks. As far as I can see the effect is the same as my original guess though: we'll have to use the API (https:/ /docs.github. com/en/ rest/reference/ repos#contents or similar) so that it can tell us what the default branch is, rather than relying on the behaviour where raw.githubuserc ontent. com returns the blob from the default branch if no branch called HEAD exists.