Repository navigation
fix(gh): CI state from newest run per check - #160
Merged
Merged
Conversation
CIState iterated the raw StatusCheckRollup, so a superseded CANCELLED run of a check on the same head commit still marked the PR failing even when Checks() (newest run per check) was all green. Compute it over Checks(). Refs #159
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.
Closes #159
Summary
PR.CIState()iterated the rawStatusCheckRollup, so a supersededCANCELLEDrun of a check on the same head commit marked the PR "fail" eventhough
Checks()(newest run per check) was all green. It now computes overp.Checks(), matching the deduped view the rest of the UI uses.The related dedup-key question from the issue (keying
Checks()on workflowname + check name instead of check name alone) is left for a separate change —
it alters which checks are distinct and how they render, a product decision
beyond this fix. A note was left on the issue.
Testing
go test ./internal/gh/ -run TestCIState— newsuperseded cancel is ignoredcase red before the fix, green after.go test ./...,go vet ./...,golangci-lint run ./...,nilaway -include-pkgs=github.com/noamsto/prdash ./...— all pass.