fix: add PR number context to merge-base compare API warnings #739
Closed
ebios-star wants to merge 1 commit intoentrius:testfrom
Closed
fix: add PR number context to merge-base compare API warnings #739ebios-star wants to merge 1 commit intoentrius:testfrom
ebios-star wants to merge 1 commit intoentrius:testfrom
Conversation
Threads an optional pr_number argument through get_merge_base_sha so the four warning messages it emits identify the PR that failed. Without this, a warning like "Compare API for owner/repo failed after 3 attempts" is not attributable to any specific PR when multiple are scored in a round. Mirrors PR entrius#711, which applied the same pattern to the downstream fetch_file_contents_with_base warning.
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.
Summary
pr_numberargument toget_merge_base_shaso the four warningmessages it emits identify the PR that failed.
pr.numberfromfetch_file_contents_for_prthrough the call.absent otherwise.
Mirrors #711, which applied the same pattern to the downstream
fetch_file_contents_with_basewarning.Problem
When validator scoring processes many PRs per round, a warning like
Compare API for owner/repo failed after 3 attempts. Will use base_ref_oid.can't be attributed to any specific PR, making transient compare-API
failures hard to diagnose.
Type of Change
Testing
test_warning_includes_pr_number_when_provided,test_warning_omits_pr_number_when_absent)assert_called_once_withto match new signatureuv run pre-commit run --all-files --hook-stage pre-push— all 431 tests pass