Report URLs of pending status checks#138
Conversation
rudymatela
left a comment
There was a problem hiding this comment.
Nice. Other than the typo and minor indenting issues I found, looks good to me. 👍
src/Logic.hs
Outdated
| -- Sometimes we want to leave an informative comment on the PR. This isn't for things | ||
| -- that require uesr feedback like build failures. |
There was a problem hiding this comment.
itym user:
| -- Sometimes we want to leave an informative comment on the PR. This isn't for things | |
| -- that require uesr feedback like build failures. | |
| -- Sometimes we want to leave an informative comment on the PR. This isn't for things | |
| -- that require user feedback like build failures. |
| case integrationStatus pullRequest of | ||
| Integrated _ (BuildPending (Just ciUrl)) -> do | ||
| span " | " | ||
| a ! href (toValue ciUrl) $ "View in CI" | ||
|
|
||
| Integrated _ (BuildFailed (Just ciUrl)) -> do | ||
| span " | " | ||
| a ! href (toValue ciUrl) $ "View in CI" | ||
|
|
||
| _ -> pure () |
There was a problem hiding this comment.
While reading the original issues I found something to improve.
Instead of just "View in CI", maybe it would be better to have: "🟡 build pending" and "❌ build failed " as the link labels for each case. So one can see the status without clicking the links.
NVM, the PRs are already separated by category.
tools/send-webhook
Outdated
| event= | ||
| commit="$1" | ||
| state="$2" | ||
| target="$3" |
There was a problem hiding this comment.
Code is misaligned here due to a mix of tabs and spaces. Changing the 8 spaces before target to a tab fixes it:
| event= | |
| commit="$1" | |
| state="$2" | |
| target="$3" | |
| event= | |
| commit="$1" | |
| state="$2" | |
| target="$3" |
| [ -n "$state" ] || state=success | ||
|
|
||
| # If this is a URL make sure it has quote marks, if null make sure it doesn't. | ||
| if [ -z "$target" ]; then | ||
| target="null" | ||
| else | ||
| target="\"$target\"" | ||
| fi | ||
|
|
||
| event="status" |
There was a problem hiding this comment.
Code is misaligned here as well due to spaces instead of tabs:
| [ -n "$state" ] || state=success | |
| # If this is a URL make sure it has quote marks, if null make sure it doesn't. | |
| if [ -z "$target" ]; then | |
| target="null" | |
| else | |
| target="\"$target\"" | |
| fi | |
| event="status" | |
| [ -n "$state" ] || state=success | |
| # If this is a URL make sure it has quote marks, if null make sure it doesn't. | |
| if [ -z "$target" ]; then | |
| target="null" | |
| else | |
| target="\"$target\"" | |
| fi | |
| event="status" |
| let payload = testCommitStatusPayload Github.Pending | ||
| Just event = convertGithubEvent $ Github.CommitStatus payload | ||
| event `shouldBe` (BuildStatusChanged (Sha "b26354") Project.BuildPending) | ||
| event `shouldBe` (BuildStatusChanged (Sha "b26354") (Project.BuildPending (Just "https://travis-ci.org/rachael/owl/builds/1982"))) |
There was a problem hiding this comment.
Nice. The test fixture was already there. :-)
| case integrationStatus pullRequest of | ||
| Integrated _ (BuildPending (Just ciUrl)) -> do | ||
| span " | " | ||
| a ! href (toValue ciUrl) $ "View in CI" | ||
|
|
||
| Integrated _ (BuildFailed (Just ciUrl)) -> do | ||
| span " | " | ||
| a ! href (toValue ciUrl) $ "View in CI" | ||
|
|
||
| _ -> pure () |
There was a problem hiding this comment.
While reading the original issues I found something to improve.
Instead of just "View in CI", maybe it would be better to have: "🟡 build pending" and "❌ build failed " as the link labels for each case. So one can see the status without clicking the links.
NVM, the PRs are already separated by category.
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. |
|
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 😔. I reviewed the conflicts though, and they seem to be not major. :-) |
dfa71be to
517632b
Compare
|
Okay, the rebase was mostly mechanical apart from the |
src/Logic.hs
Outdated
| -- Sometimes we want to leave an informative comment on the PR. This isn't for things | ||
| -- that require uesr feedback like build failures. |
There was a problem hiding this comment.
s/uesr/user/
| -- Sometimes we want to leave an informative comment on the PR. This isn't for things | |
| -- that require uesr feedback like build failures. | |
| -- Sometimes we want to leave an informative comment on the PR. This isn't for things | |
| -- that require user feedback like build failures. |
There was a problem hiding this comment.
in case anything dumb crept in
Hey look, something dumb
|
@OpsBotPrime merge on friday |
|
Pull request approved for merge by @alex-mckenna, rebasing now. |
|
Rebased as b4994ca, waiting for CI … |
06c6812 to
b4994ca
Compare
This PR allows
hoffto report thetarget_urlof pending builds, giving users an indication of which jobhoffis 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:

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 fromBuildPending NothingtoBuildPending (Just url).Closes #26
Closes #109