Open Bare1337 opened 4 months ago
It seems this is what I'm experiencing as well.
I'm seeing this behaviour as well, my concern is that there's nowhere within the squash-commit message that it specifies which files included in the PR were a part of which commit. Thus making it difficult for nx release
to determine which packages should get which level of semver applied to them.
Current Behavior
When multiple changes are made to a package and are added to the base branch through the "squash and merge" option from github at merge time, launching nx release version on the base branch lead to: {packageName} 🚫 No changes were detected using git history and the conventional commits standard. {packageName} 🚫 Skipping versioning "{packageName}" as no changes were detected.
though my commit is respecting the conventional commits standard and directly affect the package.
Expected Behavior
A commit which respect the conventional commits standard and affect my package should be properly interpreted by nx release version and lead to a correct version compute, whether or not it has been squashed with the github ui command.
GitHub Repo
No response
Steps to Reproduce
1.Create a package in an nx workspace and commit your changes => git commit -m "feat: introduce my package" 2.Create a dummy file inside the created package and commit your changes => git commit -m "feat: new package feat" 3.Create a pull request against the base branch from your current branch and merge using the option "squash and merge" from github UI.
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
The issue comes from a conflict between the separator "----" used by github to delimit the squashed commit messages and the separator used there https://github.com/nrwl/nx/blob/7088b09f472bb767d386df73ca0534e09386d7db/packages/nx/src/command-line/release/utils/git.ts#L129 and there https://github.com/nrwl/nx/blob/7088b09f472bb767d386df73ca0534e09386d7db/packages/nx/src/command-line/release/utils/git.ts#L134
In case of a commit squashed from github here is a result example of the prettify log command:
Because of that format, the split('----') discard changed files completely and nx release version is no longer able to determine if the commit affect any library.
As it seems tough to completely avoid that since people can as well edit the commit format from the UI, we could at least use a different separator or maybe compute a unique separator on the fly.
I'am willing to submit a PR if necessary.