Closed rajatjindal closed 4 years ago
where should the webhook listener run and where should we store the container images for the same.
We have a Google Cloud Platform project that we've been operating for various *.krew.dev endpoints and stats collection etc . We can deploy it to there.
- what domain should be used for webhook listener. currently it uses subdomain of my personal domain
Maybe we can put something like release-webhook.krew.dev to use for this, fairly easy to do, once deployed to Cloud Run. The krew.dev is currently owned by me, but it should be fairly easy to add other maintainers to it.
- where should be the code repository for the webhook code
We'd most probably keep this on your personal account for now. It's not a responsibility that we can offload to the SIG CLI at the moment. We have other repos (like krew-index-autoapprove, and download stats collector) that we've been keeping on our personal accounts.
- We need two secrets (webhook payload validation secret and secret for krew-release-bot for opening PR).
I think we can just use secret to open PR. Validation secret is not so much necessary (am I right?). For that secret it can be just something that we share in a secured document between maintainers of this.
sounds good to me. For docker image, can we setup automated builds? I've done automated builds for docker hub, but not for gcr.io. can you please help with that.
Also I am happy to add you as collaborator there, just in case you need to push something to that repo while I am not available. (please let me know if that is ok).
We should have both the secrets. One thing that was worrying me was what if someone sends a malicious release event? so together with webhook payload validation and verifying homepage == repo of event, i was hoping we can have some security in place here.
Yeah don't worry about setting CI/CD up. For now, run it in your account with your plugins. Let's pilot it for a few months and we can take over?
sure. just so that I ensure i understood you correctly. For now we will keep everything (including docker image, cloud-run, webhook) in my account, and later we can decide to move to krew?
Yeah. Let's pilot it for a while. I'll add it to some of my plugins, Cornelius can do the same. And we'll refine the developer experience over time, make sure repo has docs, it works properly etc. Hope that's good.
sure. sounds good to me. :)
@rajatjindal how’s it going? Did you make any progress? Do you mind writing a small guide for using it? I might start using this soon on a plugin that I am working on.
Hey @ahmetb , this is up and running. Please refer to this PR i opened for a different plugin: https://github.com/robscott/kube-capacity/pull/23
If you run into any issues with this, please let me know.
@rajatjindal My understanding is that this should not be a GitHub action ideally. We can just add a simple webhook that captures tag/release events.
Is GitHub Apps a better approach than webhooks? I'm trying this on my new plugin at https://github.com/ahmetb/kubectl-tree now.
I'm also trying to compare GitHub Actions vs GitHub Apps. It seems like GitHub Apps aren't going to be around in the long term, possibly.
hey Ahmet,
this is not a github action anymore, and is a github app. My understanding is that thats how you configure webhooks? I am not sure of the alternate way, if you can please point me to that, I can try that out for sure.
personally I think github apps will stay here as they provide more granular control (and not replaced by github actions). but even if they do, we can write an action to just make an http call on release published.
Yeah github apps will stay.
But go to repo Settings → Webhooks. There are webhooks for sure. It just involves pasting an URL and choosing which events you want.
I like “Apps” experience but right now it’s too opaque. I can’t see logs, I can’t see progress, but it actually could allow us to change the underlying endpoint and where it’s hosted.
I didn't follow closely, but the latest state is that the automated PR is done via a GH action, right?
@rajatjindal Is your documentation on the bot's homepage still up-to-date? I wonder if it is really still required to grant the bot read access to the repo. I thought this is not necessary when it runs as a GH action.
I think it would be nice to write up a small howto to help adoption of this tool. The best place for now would be in the krew-release-bot
repo, I think. When this is in good shape we can think about how to advertise this to other plugin authors.
I didn't follow closely, but the latest state is that the automated PR is done via a GH action, right?
more like:
GH action --> container running on GH ---HTTP---> Cloud Run endpoint --> GH API to create a PR on behalf of krew-release-bot
do you think this is useful? - https://github.com/rajatjindal/krew-release-bot#using-github-actions
I've removed webhook from main documentation, and moved it to a different file to avoid confusion. thanks :)
Lets scrap the GH app if we can, and just have the Action. Then I look forward to simplifying the code as much as we can and deploy (maybe using Cloud Run Button).
ok, i'll remove the github webhook based implementation from the code. Looking for feedback on how we can simplify things further.
cool, I opened several more issues in your repo to polish things up. Ideally this should be really easy to integrate. I think we've proven that.
Thanks for taking out time to open issues, i will try to address them quickly
Since this is now maturing, we should look at onboarding more plugins to it. If we onboard several more plugins, it's likely we'll see some more feature requests.
In the meanwhile, @rajatjindal can you please make a small docs PR to krew developer guide to add a short section talking about "Automating plugin releases on krew-index" and link to your tool?
sure. will do that
we have added the documentation to the krew developer guide. closing this issue.
/close
@rajatjindal: Closing this issue.
continuing from discussions in #270 and #371, opening this ticket to identify next steps for krew-release-bot
Questions that needs to be answered are:
I think we need short term answers for now, and we can decide on the long term plan depending on feedback we receive from users.