Skip to content

Handle missing commit author data - #2116

Closed
bluwy wants to merge 2 commits into
mainfrom
github-info-author
Closed

Handle missing commit author data#2116
bluwy wants to merge 2 commits into
mainfrom
github-info-author

Conversation

@bluwy

@bluwy bluwy commented Jun 24, 2026

Copy link
Copy Markdown
Member

fix #795

Did a very simple fix only since the pr variant also handles similarly

const data = await GHDataLoader.load({ kind: "pull", ...request });
const user = data?.author;

Could look into better warnings or types later maybe.

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 13a1d19

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@changesets/get-github-info Patch
@changesets/changelog-github Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.13%. Comparing base (b0fbf85) to head (13a1d19).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2116      +/-   ##
==========================================
+ Coverage   85.11%   85.13%   +0.02%     
==========================================
  Files          66       66              
  Lines        2526     2530       +4     
  Branches      698      695       -3     
==========================================
+ Hits         2150     2154       +4     
  Misses        346      346              
  Partials       30       30              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

let user = data?.author?.user;

const associatedPullRequest =
data.associatedPullRequests &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reported problem was related to an attempt of reading .author from data (undefined). So it seems with this propoposed patch we'd just move the crash to this place

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you/we add a regression test to help verify the error and fix? :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh, I'll fix this later

@bluwy

bluwy commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

Looks like it's better to address this as a breaking change I think. Going to re-open a new PR

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.

TypeError: Cannot read properties of null (reading 'author')

3 participants