Ignore build status changes on just the URL#180
Merged
OpsBotPrime merged 5 commits intomasterfrom Aug 31, 2022
Merged
Conversation
this solves the problem of multiple CI job started messages.
src/Logic.hs
Outdated
Comment on lines
+604
to
+605
| newStatus `supersedes` oldStatus | newStatus == oldStatus = False | ||
| (BuildStarted _) `supersedes` (BuildStarted _) = False -- url change, ignore. |
There was a problem hiding this comment.
Perhaps a more robust thing to do here is change the guard on the first case from newStatus == oldStatus to something like sameStatusType newStatus oldStatus where sameStatusType is URL-insensitive equality, i.e.
sameStatusType BuildStarted{} BuildStarted{} = True
sameStatusType BuildFailed{} BuildFailed{} = True
sameStatusType x y = x == yThoughts?
Author
There was a problem hiding this comment.
@alex-mckenna nice trick! Pattern matching using an empty record notation has never occurred to me before.
Author
|
@alex-mckenna Thanks for the review. I have amended the PR following your suggestion. Can you please take a look again? |
alex-mckenna
approved these changes
Aug 31, 2022
Author
|
@alex-mckenna Thanks for the speedy re-review. 🎉 @OpsBotPrime merge! |
|
Pull request approved for merge by @rudymatela, rebasing now. |
Approved-by: rudymatela Auto-deploy: false
|
Rebased as 441d7c7, waiting for CI … |
|
CI job 🟡 started. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #147
This PR makes Hoff ignore build status change where the only change is in the URL. This make it so that "CI job started" messages are not duplicated anymore (or triplicated (or quadruplicated (or quintuplicated (or ...)))).