🐛 fix: improve error messages for branch-protection and pip-install checks#5043
Open
alliasgher wants to merge 1 commit into
Open
🐛 fix: improve error messages for branch-protection and pip-install checks#5043alliasgher wants to merge 1 commit into
alliasgher wants to merge 1 commit into
Conversation
Branch-protection (ossf#2946): - Make isPermissionsError case-insensitive so that 'resource not accessible by integration' (any capitalisation) is consistently detected, preventing the generic githubv4.Query error from leaking through when GITHUB_TOKEN lacks admin read on branch protection. - Reword classicBranchErrMsg to make the cause (GITHUB_TOKEN permission) and the fix (fine-grained PAT with 'administration: read') immediately clear to the user. pip-install (ossf#2444): - Add a specific message for DependencyUseTypePipCommand in generateTextUnpinned that tells users to add --require-hashes or use a hashed requirements file, with a link to pip's secure-installs guide. Signed-off-by: alliasgher <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5043 +/- ##
==========================================
+ Coverage 66.80% 69.83% +3.03%
==========================================
Files 230 252 +22
Lines 16602 15791 -811
==========================================
- Hits 11091 11028 -63
+ Misses 4808 3878 -930
- Partials 703 885 +182 🚀 New features to boost your workflow:
|
|
This pull request has been marked stale because it has been open for 10 days with no activity |
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 #2946
Fixes #2444
Branch-protection token error (#2946)
isPermissionsErrornow compares case-insensitively, soresource not accessible by integration(any capitalisation from the GitHub API) is always detected instead of falling through to the genericgithubv4.Query: ...message.classicBranchErrMsgto explain the cause (GITHUB_TOKEN lacksadministration: read) and the fix (use a fine-grained PAT) with a direct link.pip install hash message (#2444)
generateTextUnpinnednow emits a specialised message forDependencyUseTypePipCommandthat tells users to add--require-hashesor use a hashed requirements file, with a link to pip's secure-installs guide — instead of the genericpipCommand not pinned by hash.