Skip to content

fix: gracefully handle unfetchable committer profiles in getCommitters#76

Open
chirag3092 wants to merge 2 commits into
release-plan:mainfrom
chirag3092:fix/gracefull-bot-commiter-fetch
Open

fix: gracefully handle unfetchable committer profiles in getCommitters#76
chirag3092 wants to merge 2 commits into
release-plan:mainfrom
chirag3092:fix/gracefull-bot-commiter-fetch

Conversation

@chirag3092

Copy link
Copy Markdown

Problem

getCommitters calls getUserData for 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 the release-plan prepare command fails.

Solution

Wrap the getUserData call in a try/catch. On failure, fall back to a minimal contributor entry using the login and html_url already 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

  • 403: bot account where token lacks scope to fetch the profile
  • 404: account deleted after the PR was merged
  • Missing html_url on the PR user object itself falls back to ''
  • ignoreCommitters still short-circuits before getUserData is attempted

@chirag3092

Copy link
Copy Markdown
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

@mansona

mansona commented Jul 3, 2026

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants