Skip to content

fix: correctly fetch changesets (nested changeset directory from git root)#1636

Merged
Andarist merged 4 commits intochangesets:mainfrom
Netail:fix/nested-changeset-dir
Apr 16, 2025
Merged

fix: correctly fetch changesets (nested changeset directory from git root)#1636
Andarist merged 4 commits intochangesets:mainfrom
Netail:fix/nested-changeset-dir

Conversation

@Netail
Copy link
Copy Markdown
Contributor

@Netail Netail commented Apr 15, 2025

Brought up by @Aubron in #1620 (comment) (but seperate from the issue fixed in that PR)

When the .changeset directory is located lower than the git root it wrongly parses the changeset filenames from the changeset paths. It always tries to get the second item in the array, which is the case for repos where the .changeset dir is located in the git root, but not when nested. It's safer to pop off the last item, as it's a file name (Which is filtered by getChangedChangesetFilesSinceRef already)

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2025

🦋 Changeset detected

Latest commit: 26eff58

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

This PR includes changesets to release 6 packages
Name Type
@changesets/cli Patch
@changesets/read Patch
@changesets/git Patch
@changesets/get-release-plan Patch
@changesets/release-utils Patch
@changesets/apply-release-plan 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
Copy link
Copy Markdown

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.66%. Comparing base (5d01857) to head (26eff58).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1636   +/-   ##
=======================================
  Coverage   80.66%   80.66%           
=======================================
  Files          54       54           
  Lines        2255     2255           
  Branches      680      676    -4     
=======================================
  Hits         1819     1819           
  Misses        431      431           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 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.

@Netail Netail changed the title fix: correctly fetch changesets (nested changeset directy from git root) fix: correctly fetch changesets (nested changeset directory from git root) Apr 15, 2025
@Andarist
Copy link
Copy Markdown
Member

Could we add a test case for this? While at it, it would be great to add a test case for #1620 too

@Aubron
Copy link
Copy Markdown

Aubron commented Apr 16, 2025

Thanks so much for this @Netail! I mentioned it in another thread, but I think I have wrestled against this issue multiple times when trying to integrate changesets with big monorepos, and its silent failures always eluded me - it will be good to know this particular bug is dead

@Netail
Copy link
Copy Markdown
Contributor Author

Netail commented Apr 16, 2025

No problemo! Happy to help :)

@Andarist Andarist merged commit f73f84a into changesets:main Apr 16, 2025
3 checks passed
@Andarist
Copy link
Copy Markdown
Member

Thank you! ❤️

@Netail Netail deleted the fix/nested-changeset-dir branch April 16, 2025 18:43
@github-actions github-actions bot mentioned this pull request Apr 16, 2025
@Netail
Copy link
Copy Markdown
Contributor Author

Netail commented Apr 16, 2025

Thank you! ❤️

You're welcome! 😄

Let's hope this resolves it for you @Aubron :)

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.

3 participants