Skip to content

Prevent build failures from being reverted by GitHub#154

Merged
OpsBotPrime merged 5 commits intomasterfrom
fix/build-failure-reversals
Aug 10, 2022
Merged

Prevent build failures from being reverted by GitHub#154
OpsBotPrime merged 5 commits intomasterfrom
fix/build-failure-reversals

Conversation

@rudymatela
Copy link

@rudymatela rudymatela commented Aug 10, 2022

Closes: #150

There are two separate commits, the first adds the failing test exposing the bug. The second commit fixes it.

@rudymatela rudymatela added the bug Something isn't working label Aug 10, 2022
@rudymatela rudymatela self-assigned this Aug 10, 2022
... with other statuses
@rudymatela rudymatela marked this pull request as ready for review August 10, 2022 11:50
, 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also include BuildPending as something which we expect to be ignored?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question about BuildPending

src/Logic.hs Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you hit this line? I would've thought

newStatus       `supersedes` oldStatus       | newStatus == oldStatus = False

would have fired if both arguments were BuildSucceeded

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including this line also seems to disagree with

The same status does not supersede itself

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I have removed the unreachable line.

@rudymatela
Copy link
Author

@alex-mckenna Thanks for the review. I think I have addressed your comments. Can you please take a look again?

Copy link

@alex-mckenna alex-mckenna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rudymatela
Copy link
Author

@OpsBotPrime merge

@OpsBotPrime
Copy link

Pull request approved for merge by @rudymatela, rebasing now.

Approved-by: rudymatela
Auto-deploy: false
@OpsBotPrime
Copy link

Rebased as c0a7524, waiting for CI …

@OpsBotPrime
Copy link

CI job started.

@OpsBotPrime OpsBotPrime merged commit c0a7524 into master Aug 10, 2022
@OpsBotPrime OpsBotPrime deleted the fix/build-failure-reversals branch August 10, 2022 13:06
@rudymatela rudymatela mentioned this pull request Aug 11, 2022
43 tasks
@rudymatela rudymatela added OKR Objectives and Key Results train Involves Merge Trains labels Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working OKR Objectives and Key Results train Involves Merge Trains

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failures can be reverted if GitHub sends multiple webhooks

3 participants

Comments