Skip to content

fix(release): {releaseGroupName} not interpolated in changelog tag/releaseTagPattern#33779

Merged
JamesHenry merged 4 commits into
nrwl:masterfrom
jogelin:fix-releaseGroupName-release-tag-pattern-for-changelog
Dec 14, 2025
Merged

fix(release): {releaseGroupName} not interpolated in changelog tag/releaseTagPattern#33779
JamesHenry merged 4 commits into
nrwl:masterfrom
jogelin:fix-releaseGroupName-release-tag-pattern-for-changelog

Conversation

@jogelin

@jogelin jogelin commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

PR Description

Related: #33674

Problem

The {releaseGroupName} placeholder in releaseTag.pattern was never interpolated. Instead, it appeared URL-encoded in generated git tags, release URLs, and commit messages.

Example

release: {
  groups: {
    my-group: { ... }
  },
  releaseTag: {
    pattern: '{releaseGroupName}@{version}'
  }
}

Expected:
my-group@22.6.0

Actual:
%7BreleaseGroupName%7D%4022.6.0

This affected:

  • Release URLs (GitHub/GitLab)
  • Git tag names
  • Commit messages referencing tags

Root Cause

releaseGroupName was never passed through the release pipeline. The ReleaseVersion class and related helper functions accepted {projectName} and {version}, but not {releaseGroupName}, causing the placeholder to remain unprocessed.

Solution

Support for releaseGroupName has now been added throughout the release flow:

  1. Updated ReleaseVersion to accept and interpolate releaseGroupName.
  2. Updated workspace changelog to extract the group name from nxReleaseConfig.groups.
  3. Updated project changelog to pass releaseGroup.name.
  4. Updated commit message generation to include releaseGroupName in all ReleaseVersion instances.
  5. Updated git tag creation for both fixed and independent groups to pass releaseGroupName.

Changes by File

packages/nx/src/command-line/release/utils/shared.ts

  • Added releaseGroupName to ReleaseVersion constructor.
  • Passed releaseGroupName in createCommitMessageValues().
  • Passed releaseGroupName in createGitTagValues() for fixed and independent groups.

packages/nx/src/command-line/release/changelog.ts

  • Workspace changelog: infer group name using Object.keys(nxReleaseConfig.groups)[0].
  • Project changelog: pass releaseGroup.name to interpolation.

packages/nx/src/command-line/release/utils/shared.spec.ts

  • Added tests for fixed groups and independent groups to ensure {releaseGroupName} interpolates correctly.

Testing

New tests

  • Fixed groups

    • Pattern: {releaseGroupName}@{version}
    • Output: forge@1.1.0
  • Independent groups

    • Pattern: {releaseGroupName}/{projectName}@{version}
    • Output: my-group/a@1.1.0, my-group/b@1.2.0

Manual Verification

Before:

https://gitlab.example.com/repo/-/releases/%7BreleaseGroupName%7D%4022.6.0

After:

https://gitlab.example.com/repo/-/releases/my-group@22.6.0

Backward Compatibility

No breaking changes:

  • releaseGroupName is optional.
  • Configurations not using {releaseGroupName} behave as before.
  • All existing tests continue to pass.
  • The change is additive and consistent with existing interpolation logic.

@jogelin jogelin requested a review from a team as a code owner December 10, 2025 07:57
@jogelin jogelin requested a review from leosvelperez December 10, 2025 07:57
@netlify

netlify Bot commented Dec 10, 2025

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ee35df9

@vercel

vercel Bot commented Dec 10, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Dec 14, 2025 8:46am

@jogelin

jogelin commented Dec 10, 2025

Copy link
Copy Markdown
Contributor Author

@JamesHenry @Coly010 Can you have a look?

@nx-cloud

nx-cloud Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit ee35df9

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 49m 26s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 27s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 12s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-14 09:36:29 UTC

nx-cloud[bot]

This comment was marked as outdated.

@jogelin jogelin force-pushed the fix-releaseGroupName-release-tag-pattern-for-changelog branch from d2d87c3 to 3786a7f Compare December 10, 2025 10:17

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nx Cloud has identified a flaky task in your failed CI:

Since the failure was identified as flaky, the solution is to rerun CI. Because this branch comes from a fork, it is not possible for us to push directly, but you can rerun by pushing an empty commit:

git commit --allow-empty -m "chore: trigger rerun"
git push

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@JamesHenry JamesHenry changed the title fix(release): {releaseGroupName} not interpolated in changelog tag/re… fix(release): {releaseGroupName} not interpolated in changelog tag/releaseTagPattern Dec 14, 2025
@JamesHenry JamesHenry enabled auto-merge (squash) December 14, 2025 08:42
@JamesHenry

Copy link
Copy Markdown
Contributor

Please be sure to not submit PRs with trailing ellipses in the title, it is the squash merged commit candidate

@JamesHenry JamesHenry merged commit ad5d9b7 into nrwl:master Dec 14, 2025
16 of 17 checks passed
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
@github-actions

Copy link
Copy Markdown
Contributor

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 Dec 20, 2025
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