Skip to content
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

feat(release): dynamic release config via programmatic API #27204

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

JamesHenry
Copy link
Collaborator

@JamesHenry JamesHenry commented Jul 30, 2024

Summary

This PR adds a new ReleaseClient class to the programmatic API which allows for users to dynamically create nx release configuration and combine it with any config in nx.json.

This is particularly useful for large workspaces with many projects and lots of groups.

There are no changes to existing programmatic APIs and use-cases.


Example of new print-config output

image

The following command can additionally be used for debugging more advanced cases/nx internals:

nx release --print-config debug

Note for reviewers

image

^ strongly recommended settings for the diff view of this particular PR

Copy link

vercel bot commented Jul 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jul 30, 2024 9:17pm

@JamesHenry JamesHenry force-pushed the dynamic-release-config branch from 6bfa854 to 90591ee Compare July 30, 2024 15:57
@JamesHenry JamesHenry changed the title chore(release): experimental wip feat(release): dynamic release config via programmatic API Jul 30, 2024
@@ -174,7 +174,7 @@ export interface NxReleaseConventionalCommitsConfiguration {
>;
}

interface NxReleaseConfiguration {
export interface NxReleaseConfiguration {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needed for custom scripts which make use of the new ReleaseClient API

@JamesHenry JamesHenry marked this pull request as ready for review July 30, 2024 18:00
@JamesHenry JamesHenry requested review from a team as code owners July 30, 2024 18:00
@JamesHenry JamesHenry enabled auto-merge (squash) July 30, 2024 18:42
): T {
try {
// Ensure both objects are valid JSON before attempting to merge values
JSON.parse(JSON.stringify(source));
Copy link
Member

Choose a reason for hiding this comment

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

I think this check here would pass for numbers, strings, booleans etc only for below code to fail. Maybe thats fine, just pointing out :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this plus the author time checks from TS should be good enough

@JamesHenry
Copy link
Collaborator Author

JamesHenry commented Jul 30, 2024

My conflict resolution via the github UI caused the formatting to fail, rebasing locally. I ran through the overall concept with Jason already so it's just pending final review

@JamesHenry JamesHenry merged commit c2920a2 into master Aug 7, 2024
6 checks passed
@JamesHenry JamesHenry deleted the dynamic-release-config branch August 7, 2024 14:56
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants