-
Notifications
You must be signed in to change notification settings - Fork 2.6k
chore(release): Improve release performance #33866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JamesHenry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this, seems like it's going to be a great improvement. Instinctively these caching elements feel like they belong on the ReleaseGraph as it already performs many similar operations to reduce rework and is passed between different subsections of the release process and ultimately can be dropped without any module level cache clearing etc.
Please could you explore that?
|
@JamesHenry yes, I could explore that possibility, in this case, what api changes would you suggest I can do to move this into the |
a63f2c5 to
fec2915
Compare
Implemented RepoGitTags singleton class to cache git tags and eliminate redundant git operations during release commands. This function is called for each project in an independent versions configuration, once when calculating the next versions and once angain when creating the changelogs Performance improvement: - Constant time after first call The cache is automatic and transparent. Added clean() method for test isolation. No breaking changes.
…ions across projects Added affectedGraphPerCommit cache to avoid recomputing graph traversals when multiple projects analyze the same commits during release. For independent release groups, this provides 90-98% performance improvement for subsequent projects by reusing graph computations from the first project. The cache is keyed by commit hash, stored during release operations, and automatically cleared after processGroups() completes to prevent memory leaks in long-running processes like Nx daemon. No breaking changes.
…ache to release-graph
fec2915 to
520ba42
Compare
|
@JamesHenry I've moved both the cache and the resolve logic to the |
- move the instance into release-graph class - pass resolveGitTags as params
dae84cf to
25aba4b
Compare
Current Behavior
When releasing packages using nx release using conventional commits and independent versions for the packages in a large repository, with 232 projects and hefty git history with several thousand tags, the release process takes more than 30 minutes.
Expected Behavior
When releasing package using nx release, it should not take more than 30 minutes to release all package in a big monorepo.
Related Issue(s)
Fixes #33865