Build.snapcraft.io: Support webhook build trigger?


#1

Not all upstreams are willing to maintain an official snap package, but I guess more of them are willing to set up a webhook(GitHub, SourceForge) to trigger a third-party snap build on every SCM push, I would like to request that build.snapcraft.io support this method.

This also makes repos that are not hosted on GitHub can automate the snap build without migrating their projects to GitHub.

Also filed at build.s.i: Support webhook build triggering · Issue #1362 · canonical-websites/snapcraft.io


Suggestion: include Gitlab into build.snapcraft.io
#2

Regular ping…


#3

Regular ping……


#4

definitely a good idea “in my opinion”!


#5

Could you elaborate more on what do you mean by webhook support?

Currently build.snapcraft.io sets a webhook at github, so whenever something is pushed to a repo configured in build.snapcraft.io a snap build would be triggered.
What do you mean by ‘webhook triggering third party snap build’? Where the snap code would be hosted? Where would snapcraft.yaml live (if upstreams are not willing to maintain snap package)?


#6

My view is to be able to programmatically trigger a build without having to add a commit to the github repository. Answering your questions:

What do you mean by ‘webhook triggering third party snap build’?

A script or application hosted on my own infrastructure triggers the BSI build to initiate.

Where the snap code would be hosted?

GitHub

Where would snapcraft.yaml live (if upstreams are not willing to maintain snap package)?

GitHub


#7

Currently build.snapcraft.io sets a webhook at github, so whenever something is pushed to
a repo configured in build.snapcraft.io a snap build would be triggered.

I actually never noticed that. That’s half work done IMO.

What do you mean by ‘webhook triggering third party snap build’?
Where the snap code would be hosted?
Where would snapcraft.yaml live (if upstreams are not willing to maintain snap package)?

The snap code is hosted on GitHub by a third-party, and is set up publishing to build.snapcraft.io via the current webhook.

I would like to set up such webhook at the upstream repo(not necessarily on GitHub) as well, the necessary info (the webhook URL https://build.snapcraft.io/_user_id_/_repo_id_/webhook/notify and the secret if authentication is needed) should be accessible on build.snapcraft.io. As the third-party snap publisher doesn’t necessary have the write access to the upstream repo this information will be handed out to the upstream repo maintainer manually.


#8

For those not aware, BSI means https://build.snapcraft.io
Let’s please not use that acronym.


#9

Currently build webhooks are implemented for GitHub. Specifically we are listening for push event.

To support third party webhooks we would need to extend this not to limit ourselves to GitHub specific events and payload structure. Also we currently use same webhook URL to listen to both GitHub events (that trigger builds) and Launchpad events. Third party webhooks would need to fit into that or have a separate URL, so they don’t need to follow same restrictions.

And we need a UI (probably somewhere on a repository page) to show user webhook configuration to use (URL and secret).


#10

I agree that half work is done. Webhook works, but only for first ever created snap,
NEW USERS CANT UPLOAD IMAGES, SO I REMOVED, THAT RESTRICTION IS STUPID, THIS SCREENSHOT SHOWS THAT WEBHOOK WORKS AND ALL IS GREEN
upload : / / riUsle24GwMOlsy6gYIcaWmFoc4.png

if I add additional snaps from github, no github webhook is set.

It would be great if at least same password would work and webhook would be set. As it is not a problem to inspect password field and change, just click inspect element and you can see your password in field value, if you want to show your password in password field instead of ****, change simply
NEW USERS CANT UPLOAD IMAGES, SO I REMOVED, THAT RESTRICTION IS STUPID, THIS SCREENSHOT SHOWS ORIGINAL SETTING AS PASSWORD WITH ASTERIX
upload : // hPOq5Pjl9grhLyWfmNiRIDUVo5M.png
to
NEW USERS CANT UPLOAD IMAGES, SO I REMOVED, THAT RESTRICTION IS STUPID, THIS SCREENSHOT SHOWS WHICH FIELD TO CHANGE
upload : / / 3x5xIEQWRnucimF8cqXb0aDzeNF.png

However, trying to setup webhook with same secret and different url doesnt work, so either new secret is used on each webhook or webhook was not created at all on snapcraft.io, I suppose that both are currently the case.
NEW USERS CANT UPLOAD IMAGES, SO I REMOVED, THAT RESTRICTION IS STUPID, THIS SCREENSHOT SHOWS THAT WEBHOOK IS NOT WORKING
upload : / / A6domypv70Ghi0XKJYp83p8eYeM.png

As you see, webhook is not working on second snap:
NEW USERS CANT UPLOAD IMAGES, SO I REMOVED, THAT RESTRICTION IS STUPID, THIS SCREENSHOT SHOWS ALL FAILED HOOKS
upload : / / aFhLpSaBeRhMd4asiHreEGQcsVC.png

probably not part of this thread/post, but launchpad builds snaps too, offering additional architecture powerpc, would be nice if that could be added to snapcraft. Connection to launchpad works also well, if configured properly, building on launchpad does release on snapcraft too and combination of manually triggered builds on launchpad (automatic works too) for releases and snapcraft building on each commit is quite good but not perfect as I still miss one arch. That leads me to add simply additional remote url to my git and use actually launchpad for automatic build and release process.

PS: This restriction with screenshots is that stupid that I actually prefer to delete this post and close this account instead wasting my time on feedback here, but ok, I edited it.


#11

you could just use https://imgur.com/ and link the pictures from your post …


#12

It’s to prevent unwanted spam. Please respect our wishes not to be spammed. If you’d asked nicely I could have simply bumped your user level and you’d have no problems posting images. Happy to do that now.


#13

@ogra
I could have also wasted more time to maybe optimize those images before upload as well to spare time in not posting at all, or?

@popey
thanks. I understand what for it is and your forum software does recognize SSO and shows even my SSO logo but it does not know that I am already snapcraft and launchpad member, I understand also that this forum software is not snapcraft platform, but if I can login and create my snap by simply logging in with my github account, why cant I log in the same way to this forum if this is the only place for support? I would call such method outaged and quite user unfriendly.

About upload, your forum software could have warned me that I can not post uploaded files during the upload, not letting me upload and write the reply and at the end to tell the user, such methods are over 10 years old and obsolete where my wasted bandwith would also matter (especially over gprs) and yes, I kinda did not expect it from snapcraft as I was quite impressed and though this forum software works better.


#14

well, i was only trying to help you getting your pics across anyway until you gained enough user level. sorry if that bothered you though i dont think it justifies such an aggressive tone … i’ll keep out of your threads in the future …


#15

actually I tried to help a user who claimed he cant find his password, those screenshots show it, last two screenshots were showing that webhook fails, here you could have suggested to upload log instead.

I think it would be getting into nonsense discussion if I reply to you that suggested image host is not the only existing, beside that, if you assume that people are idiots and cant find a way to upload images, then you should have set as high prio that this forum uploads its pictures to suggested image hosters, then you could prevent also new users from spamming, as addition you could NOT display them as long as their reputation is not raised.

Beside all my explanations and being polite you comply about my aggressive tone, this is fully off-topic and you did not reply to any point of my questions/suggestions, I will even not ask how do you think you helped, as then you probably would call it rude. I dislike actually such attitude and I dont care if you read my posts or not.