Skip to content

Comments

fix(release): handle short and full project names in commit scopes#34219

Open
ShwethaSundar wants to merge 2 commits intonrwl:masterfrom
ShwethaSundar:handle-project-short-names
Open

fix(release): handle short and full project names in commit scopes#34219
ShwethaSundar wants to merge 2 commits intonrwl:masterfrom
ShwethaSundar:handle-project-short-names

Conversation

@ShwethaSundar
Copy link

Current Behavior

Conventional commit scopes must exactly match the Nx project name.
If a commit uses a short scope (e.g. commons2) while the project name is fully qualified (e.g. @commons/commons2), the commit is treated as not project-scoped. This causes incorrect semver bumps, sometimes affecting multiple projects.

Expected Behavior

Commit scopes should match projects using either:

  • Full project name (@commons/commons2)
  • Short name (commons2)
  • Comma-separated scopes using either form

Related Issue(s)

Fixes #

@ShwethaSundar ShwethaSundar requested review from a team and Coly010 as code owners January 26, 2026 13:40
@netlify
Copy link

netlify bot commented Jan 26, 2026

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit de2b402

@vercel
Copy link

vercel bot commented Jan 26, 2026

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

Project Deployment Actions Updated (UTC)
nx-dev Ready Ready Preview Feb 3, 2026 5:17am

Request Review

@ShwethaSundar
Copy link
Author

@leosvelperez @Coly010 Could you please review this MR?

@netlify
Copy link

netlify bot commented Feb 5, 2026

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit de2b402

@ShwethaSundar
Copy link
Author

@Coly010 @leosvelperez Could I get a review please?

Copy link
Collaborator

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

@ShwethaSundar I'm a bit uneasy with the ad hoc matching logic here in general... can we please integrate the findMatchingProjects utility that is used throughout most of the nx codebase? It should handle the short name matching consistently with the task runner

@ShwethaSundar ShwethaSundar force-pushed the handle-project-short-names branch from fcd64ca to ea82900 Compare February 6, 2026 05:26
@ShwethaSundar ShwethaSundar force-pushed the handle-project-short-names branch from ea82900 to b921308 Compare February 8, 2026 10:08
@nx-cloud
Copy link
Contributor

nx-cloud bot commented Feb 13, 2026

View your CI Pipeline Execution ↗ for commit b410b91

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

☁️ Nx Cloud last updated this comment at 2026-02-13 09:36:52 UTC

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

Nx Cloud is proposing a fix for your failed CI:

These changes fix the module resolution error that was causing all e2e-release tests to fail. We corrected the import path from an absolute-style path to a relative path (../../../utils/find-matching-projects), which aligns with the existing import patterns in the file and allows Node.js to properly resolve the module.

Warning

We could not verify this fix.

diff --git a/packages/nx/src/command-line/release/utils/shared.ts b/packages/nx/src/command-line/release/utils/shared.ts
index bc56d46675..347d59b6ed 100644
--- a/packages/nx/src/command-line/release/utils/shared.ts
+++ b/packages/nx/src/command-line/release/utils/shared.ts
@@ -14,7 +14,7 @@ import {
   gitCommit,
   sanitizeProjectNameForGitTag,
 } from './git';
-import { findMatchingProjects } from 'packages/nx/src/utils/find-matching-projects';
+import { findMatchingProjects } from '../../../utils/find-matching-projects';
 import { ReleaseGraph } from './release-graph';
 
 export const noDiffInChangelogMessage = pc.yellow(

Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.

Apply changes locally with:

npx nx-cloud apply-locally Ih60-sZ3q

Apply fix locally with your editor ↗   View interactive diff ↗


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

@JamesHenry
Copy link
Collaborator

@ShwethaSundar just checking you saw the failing CI and suggested fix?

@ShwethaSundar ShwethaSundar force-pushed the handle-project-short-names branch from c452f17 to 56d1363 Compare February 20, 2026 04:10
@ShwethaSundar
Copy link
Author

@ShwethaSundar just checking you saw the failing CI and suggested fix?

yes its fixed.

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.

2 participants