Prevent build failures from being reverted by GitHub#154
Conversation
... with other statuses
| , BuildStatusChanged (Sha "1b2") (Project.BuildFailed (Just "example.com/1b2")) | ||
| , BuildStatusChanged (Sha "1b2") (Project.BuildStarted "example.com/1b2") -- ignored | ||
| , BuildStatusChanged (Sha "1b2") (Project.BuildFailed (Just "example.com/alt/1b2")) | ||
| , BuildStatusChanged (Sha "1b2") Project.BuildSucceeded -- ignored |
There was a problem hiding this comment.
Should this also include BuildPending as something which we expect to be ignored?
There was a problem hiding this comment.
Makes sense. I have added it as a test now.
| , CommentAdded (PullRequestId 1) "bot" "[CI job](example.com/1b2) started." | ||
| , BuildStatusChanged (Sha "1b2") Project.BuildSucceeded | ||
| , BuildStatusChanged (Sha "1b2") (Project.BuildStarted "example.com/1b2") -- ignored | ||
| , BuildStatusChanged (Sha "1b2") (Project.BuildFailed (Just "example.com/1b2")) -- ignored |
src/Logic.hs
Outdated
There was a problem hiding this comment.
Would you hit this line? I would've thought
newStatus `supersedes` oldStatus | newStatus == oldStatus = Falsewould have fired if both arguments were BuildSucceeded
There was a problem hiding this comment.
Including this line also seems to disagree with
The same status does not supersede itself
There was a problem hiding this comment.
Makes sense. I have removed the unreachable line.
|
@alex-mckenna Thanks for the review. I think I have addressed your comments. Can you please take a look again? |
|
@OpsBotPrime merge |
|
Pull request approved for merge by @rudymatela, rebasing now. |
Approved-by: rudymatela Auto-deploy: false
|
Rebased as c0a7524, waiting for CI … |
|
CI job started. |
Closes: #150
There are two separate commits, the first adds the failing test exposing the bug. The second commit fixes it.