-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(bot): handling of duplicate check suites #688
Conversation
Previously if a user created duplicate check suites with the same check run name, Kodiak would consider all of the check suites, not just the most recent one. So if the check suite had failed previously, but the latest check suite passed, Kodiak would incorrectly mark the PR as blocked for merging. Now Kodiak only considers the most recent check run name.
bot/kodiak/evaluation.py
Outdated
check_run_map = dict() | ||
for check_run in check_runs: | ||
check_run_map[check_run.name] = check_run | ||
return list(check_run_map.values()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check_run_map = dict() | |
for check_run in check_runs: | |
check_run_map[check_run.name] = check_run | |
return list(check_run_map.values()) | |
check_run_map = { | |
check_run.name: check_run | |
for check_run in check_runs | |
} | |
return check_run_map.values() |
bot/kodiak/evaluation.py
Outdated
@@ -260,6 +263,13 @@ def review_status(reviews: List[PRReview]) -> PRReviewState: | |||
return status | |||
|
|||
|
|||
def deduplicate_check_runs(check_runs: Iterable[CheckRun]) -> List[CheckRun]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def deduplicate_check_runs(check_runs: Iterable[CheckRun]) -> List[CheckRun]: | |
def deduplicate_check_runs(check_runs: Iterable[CheckRun]) -> Iterable[CheckRun]: |
name="Pre-merge checks", conclusion=CheckConclusionState.FAILURE | ||
), | ||
create_check_run( | ||
name="Pre-merge checks", conclusion=CheckConclusionState.SUCCESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the GitHub API order the results with the most recent ones last?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened a support ticket about that but my assumption here is yes
Previously if a user created duplicate check suites with the same check run name, Kodiak would consider all of the check suites, not just the most recent one. So if the check suite had failed previously, but the latest check suite passed, Kodiak would incorrectly mark the PR as blocked for merging.
Now Kodiak only considers the most recent check run name.