Teach besadii to react to gerrit comments (eg rerunning a build) #407
Labels
No labels
Compat/Breaking
Difficulty/Architectural
Difficulty/Easy
Difficulty/Hard
Help Wanted
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Security
Silenced Alert
Status/Abandoned
Status/Blocked
Status/Need More Info
Status/Postponed
Superseded
Tracking Issue
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
afnix/infra#407
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This was discussed in passing a few times on the lix matrix and other places, but it'd be nice to have besadii be able to relaunch a failed CI run, especially since it can be pretty flaky, and the only other way to force a rerun is to rebase or change the code in some insignificant way, which isn't great.
Would something like reacting to comments that contain
@besadii rerun-buildwork?Note that I know basically nothing about CI, so I have no idea about the limitations you might want to put on such an ability. It might be harder to implement if we need to check who's requesting a change, or if a certain quota has been reached, etc.
See the gerrit hook docs for the info we're passed for new comments.
Dumping some state here: I've heard second hand that there were vague complaints about a "retry via review comments" workflow - they make the review thread more spammy, notify people for unactionable events, etc. (I fully realize that "vague second hand" makes this a bit of a discussion stopper - unfortunately a lot of Lix discussions happen behind closed doors and I'm not privy to them...).
Ideally we'd have another flow to retry builds, presumably a web interface behind SSO with a button. Possibly implemented as a Gerrit plugin so we can piggy back on auth and so on?
But I think that if nobody picks that up within 1-2 months we should just go with the review comment solution which is trivial-ish to implement (like, < 1 day of work) and evaluate whether the pros sufficiently balance the cons. I believe they will, but tbf the "better" solution also isn't a ton of work.
looking at the gerrit plugin docs as well as existing plugins and the API docs, i think this is slightly above what i can do as a side-quest currently (mostly because of every "extra" task: testing it, giving it a way to be configured, packaging it, making it work with
nix-gerrit, etc.), so if that's the direction this is going (which i do think is a better idea than comments), i can't help right now (so if someone wants to pick up, that'd be great ;)update: i couldn't help looking more into it, and apparently there's already a whole bunch of infrastucture for this built into gerrit... which besadii already kinda uses, but only for displaying test results. we could probably extend it to also support sending jobs to buildkite from gerrit (without a separate listener like besadii), and have a rerun button, like the official instance:
now i just need to understand how you actually get that button to appear...
to continue this saga: looking around a bit more (because another job of mine broke and i got frustrated), it seems like all we need to really add is an
actionsarray to this constructor, an instance of which you can see in the wild in this random repo. according to the buildkite docs, we need to make a (write_buildsauthenticated) PUT call to/v2/organizations/afnix/lix/jobs/{job.id}/retry(but it has the caveat that it can only be called once, and retrying it anymore requires keeping state from each call to the next, but i guess we can add support for that later).i don't think there's anything more complex than that to put in place here, but i just really don't have the infra knowledge to set it up properly or even just hack/test it, so it'll have to be done by someone else. hopefully i've been helpful enough to the person who'll implement this :)