-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kicking off Jenkins build triggered by comment #128
Conversation
With the current changes, the bot replies to any comments in gets mentioned in as long as the comment author has checked out to be a repo collaborator. |
9e66835
to
c4bfb27
Compare
IMO this is getting ready to merge. How does this work?Any repository collaborator creates a comment in any PR:
That is picked up by the bot that verifies the comment author is actually a collaborator in that particular repository. If so, the bot requests http://ci.nodejs.org to trigger a build for a preconfigured job for that repository. As soon as it gets a response from Jenkins, the bot replies to the comment author saying the build started and the corresponding job URL, or informing an error occurred when communicating with Jenkins. If the Jenkins job is configured showing inline PR build statuses via this bot, build statuses will start to be visible in the PR as soon as they start / end. That's not really part of this PR, that functionality has already been implemented. How is this configured?Three new $ENV variables are introduced here. A "global" This have to be configured and enabled explicitly per repo. Read more about them in the changes done in README.md. Further improvementsThe comment made by the bot to inform about build started, contains the Jenkins job URL, which ideally would be the build URL. Improving that means continuously polling Jenkins for build started after the triggering a build. The reason behind that is Jenkins doesn't wait to respond until the build is actually started, but responds as soon as the build as been put into the build queue. What's next? |
You could assigning it to the bot-- or create a 'needs rebuild' label. Either option requires a person to be a collaborator- so that check would be already done. |
Good point @williamkapke. My only concern with those two are the awkwardness of triggering more builds after changes are made. Having to re-assign or re-label rather than posting a new comment. |
@phillipj When a label is applied or it is assigned, it puts a message like " ... when the bot gets the notification, it could reply like "Ok, Oh- and you'd want to unassign/unlabel after it's done. |
I'm confused, don't collaborators already have access to start a new job from the Jenkins UI? If so, why this feature? It seems like it would just add more noise to PRs. |
@mscdex absolutely. I see this as simplifying the process of starting a build against the changes in a PR, rather than clicking through the Jenkins UI and filling in the parameters by hand (ref #82). Possibly a precursor to automatically kicking off builds whenever a collaborator opens a PR, tho that's a different discussion. |
One potential issue is that this kind of mechanism does not require a collaborator to explicitly acknowledge that they have reviewed the PR and are sure that it is "safe" (this is currently done in the Jenkins UI via the "CERTIFY_SAFE" checkbox). If we ignore that with the bot, why keep the checkbox in the Jenkins UI? |
Yepp, we have to have that discussion in nodejs/node before enabling this functionality there. This have to be enabled very explicitly per repo. ATM we want this in the citgm repo where |
@mscdex I think that we can just update the contributing guidelines per repo to state that by typing |
@gdams But then what's the point of keeping the checkbox on the Jenkins UI? You could just say that by submitting that form you are implicitly certifying the PR is "safe" instead of having to check a checkbox. |
@mscdex True, but then what's the issue with the checkbox in the Jenkins UI? It doesn't really take any extra time to click. I guess we could have the phrase as I guess my point is that checking another box is |
Don't want to undermine the But for the time being, could we ignore that a bit and focus reviewing the code changes and getting this tested on nodejs/citgm? |
a90adbd
to
458fdc6
Compare
@gdams @gibfahn you got any thoughts about those two alternatives, compared to commenting to trigger builds? |
@phillipj, no I'm much more of a fan of the way you have don't it, it's the only way that will make rebuilds easy |
I agree with @gdams, commenting is the easiest way. To be honest it'd be ideal if the bot had a shorter name, but it's not the end of the world (due to tab complete).
It will also be much easier if we want to have multiple commands for the bot in the future (e.g. I know @mentioning in a comment is how Rust use their bot. |
@gibfahn No one would need to un-assign+assign or remove+re-addd. The bot just removes does the removal as part of it's work. I'm not MASSIVELY against using the comment method. I just prefer to use things that reduces the number of email notifications that are sent to everyone. But- email filters can be added, right? 😆 @phillipj Thanks for considering it- that's all I ask. 👍 |
@williamkapke that's a good point, I hadn't thought of the notifications question (probably because I use the web notifications). I guess the problem is that you'd get two emails, one for the |
There wouldn't need to be a reply |
I think pinging people when you rerun CI is a good thing (it's what we have now, and IMO it works well). @gdams the problem with just having the Github CI status section is that (AFAIK) you can only see the results for the latest build that was run. I find it useful to go back to previous CI runs. Also in the past the reporting hasn't always been correct, but maybe that won't be a problem going forward. |
Ping @nodejs/github-bot as I'm missing a clear thumbs up on this before deploying it and doing some initial tests with CITGM. |
@phillipj really looking forward to seeing this! |
With the latest commented issues fixed, I'm leaning towards merging this before the end of the week if no objections are made. |
8fc298b
to
5a0996b
Compare
This is the initial shot at triggering a Jenkins build when a repository collaborator mentions the bot in a comment with the following content: `@nodejs-github-bot run CI` In addition the bot has to be explicitly configured with $ENV variables per repo and related Jenkins build for this to be enabled. At first we'll start with https://github.com/nodejs/citgm which has been the biggest driver for getting this implemented. If that test run succeeds we can enable it on other repos as we see fit in collaboration with their corresponding working group. Refs nodejs#82
5a0996b
to
59d30c3
Compare
@gdams @gibfahn this is running in production and configured for the CITGM repo 👯 As I don't have collab access to that repo, I can't trigger runs.. So the honours is all yours when you have the time -- abuse nodejs/citgm#375 as much as you want. |
@phillipj Is this live for nodejs/node, too? |
@addaleax nope. We'll test it on CITGM first, then have a |
Refs nodejs/github-bot#128 PR-URL: #684 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Putting this out for public scrutiny to show there is some kind of progress.
The main goal is to get the bot to kick off a Jenkins build triggered by a collaborator commenting in a PR, mentioning the bot.
Refs #82