Skip to content

fix: npm run fetch-changelog fails on a fresh clone - #694

Open
Anshumancanrock wants to merge 1 commit into
Project-HAMi:masterfrom
Anshumancanrock:fix-changelog-fresh-clone
Open

fix: npm run fetch-changelog fails on a fresh clone#694
Anshumancanrock wants to merge 1 commit into
Project-HAMi:masterfrom
Anshumancanrock:fix-changelog-fresh-clone

Conversation

@Anshumancanrock

@Anshumancanrock Anshumancanrock commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR fixes npm run fetch-changelog <version> failing on a fresh clone.

It exits 1 on a clean checkout. updateAuthorsJson() reads changelog/source/authors.json
without checking it exists, and the catch re-throws, so main() bails before anything gets
written, including CHANGELOG.md. changelog/source/ is gitignored and only generated by the
changelog plugin at build time, so it isn't there on a fresh clone or in CI.

The fix, in updateAuthorsJson(): make the directory first, and start from an empty map when
authors.json isn't there yet.

Which issue(s) this PR fixes:

Fixes #693

Checklist:

  • npm run lint and npm run format:check pass (prettier run on the changed file via npx,
    repo deps aren't installed locally; markdownlint only covers docs/, tutorials/, blog/)
  • npm run build succeeds for both en and zh (not run, this is a standalone release
    script and nothing in the Docusaurus build imports it)
  • Chinese translation updated if English docs changed (or noted why not) (n/a, no docs touched)
  • Commits are signed off (git commit -s)

Summary by CodeRabbit

  • Bug Fixes
    • Improved changelog author updates by creating missing directories and handling absent author records automatically.

Signed-off-by: anshumancanrock <anshu.1239.as@gmail.com>
@hami-robot hami-robot Bot added kind/bug Something isn't working dco-signoff: yes labels Aug 1, 2026
@hami-robot
hami-robot Bot requested review from mesutoezdil and windsonsea August 1, 2026 07:32
@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for project-hami ready!

Name Link
🔨 Latest commit 17c5bf0
🔍 Latest deploy log https://app.netlify.com/projects/project-hami/deploys/6a6da10b3ecd5a0008f681b7
😎 Deploy Preview https://deploy-preview-694--project-hami.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hami-robot hami-robot Bot added the size/XS label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changelog script now creates the authors directory when needed and handles a missing authors.json by starting with an empty author map.

Changes

Changelog author storage

Layer / File(s) Summary
Initialize author storage
src/scripts/fetch-changelog.js
updateAuthorsJson creates the parent directory recursively and loads existing authors only when authors.json exists. Otherwise, it starts with an empty object before adding contributors and writing updates.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: mesutoezdil

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes create the missing directory and handle absent authors.json, satisfying issue #693.
Out of Scope Changes check ✅ Passed The changes are limited to making changelog generation work when generated authors files are absent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the failure fixed by the pull request on a fresh clone.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mesutoezdil

Copy link
Copy Markdown
Contributor

/lgtm

@windsonsea windsonsea left a comment

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.

/approve

@hami-robot

hami-robot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Anshumancanrock, windsonsea

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hami-robot hami-robot Bot added the approved label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm run fetch-changelog fails on a fresh clone

3 participants