fix: gracefully handle unfetchable committer profiles in getCommitters#76
Open
chirag3092 wants to merge 2 commits into
Open
fix: gracefully handle unfetchable committer profiles in getCommitters#76chirag3092 wants to merge 2 commits into
chirag3092 wants to merge 2 commits into
Conversation
Author
|
@mansona, Hi, first-time contributor here. Could you approve the CI run when you get a chance? Fix + tests are in, and I've run lint/build/test locally, so it should be green. Happy to address any feedback. Thanks |
Member
|
Thanks @chirag3092 for the contribution! So I would love to know more about this change 🤔 the code change makes sense on the face of it but I wonder what it will looking like in the acual changelog with this information missing? your tests only updated the unit style tests so I can't see an output Markdown from this change |
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.
Problem
getCommitterscallsgetUserDatafor every PR author to fetch their profile. If that request fails (e.g. 403 for bot accounts where the token lacks sufficient scope, or 404 for deleted accounts), the entire changelog generation throws and therelease-plan preparecommand fails.Solution
Wrap the
getUserDatacall in a try/catch. On failure, fall back to a minimal contributor entry using theloginandhtml_urlalready available from the PR issue data, so changelog generation continues rather than crashing.The fallback renders as
[@login](html_url)in the changelog, which is accurate for both bot accounts and deleted users, without fabricating any data.Test cases added
html_urlon the PR user object itself falls back to''ignoreCommittersstill short-circuits beforegetUserDatais attempted