channable / hoff

A gatekeeper for your commits
Apache License 2.0
41 stars 3 forks source link

Report URLs of pending status checks #138

Closed alex-mckenna closed 2 years ago

alex-mckenna commented 2 years ago

This PR allows hoff to report the target_url of pending builds, giving users an indication of which job hoff is waiting for. This is shown both as a comment on the PR, and an additional link in the headline for pull requests where a CI URL is available (i.e. pending and failed jobs, since we don't currently keep the URL of succeeded jobs).

Screenshots: Screenshot from 2022-07-21 15-15-17

Screenshot from 2022-07-21 15-15-07

I'm slightly unsure if this will actually go off in practice. This info is given when the build status changes to pending with a non-null target_url, but I have no concrete intuition for when this would occur in practice. I'm hoping when the status check starts it will change the state from BuildPending Nothing to BuildPending (Just url).

Closes #26 Closes #109

rudymatela commented 2 years ago

I'm slightly unsure if this will actually go off in practice. This info is given when the build status changes to pending with a non-null target_url, but I have no concrete intuition for when this would occur in practice. I'm hoping when the status check starts it will change the state from BuildPending Nothing to BuildPending (Just url).

For this, I think GitHub sends a BuildPending hook again with the build URL when it gets one. But I think you've already figured this out because I saw your changes on send-webhook which deal with this.

rudymatela commented 2 years ago

Btw, I reverted the broken merge of yesterday. So feel free to rebase and merge this into master now if you like.

I saw this created a few conflicts with your files (as your change was already based on top of mine). I'm sorry about that :pensive:. I reviewed the conflicts though, and they seem to be not major. :-)

alex-mckenna commented 2 years ago

Okay, the rebase was mostly mechanical apart from the handleBuildStatusChanged which was a little different after the revert for some reason. I changed the PR to be in the style of the reverted version so give it a once over in case anything dumb crept in

alex-mckenna commented 2 years ago

@OpsBotPrime merge on friday

OpsBotPrime commented 2 years ago

Pull request approved for merge by @alex-mckenna, rebasing now.

OpsBotPrime commented 2 years ago

Rebased as b4994cabf047f6cdedc1433018f46a2d54d0391b, waiting for CI …