nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.62k stars 2.36k forks source link

Nx release fails to detect changes if the workspace directory is not the monorepo root directory #27995

Open hkfb opened 1 month ago

hkfb commented 1 month ago

Current Behavior

Given a monorepo with a set of packages, each with its own project.json file.

The nx.json file resides in a repo subdirectory called typescript, along with package.json

The path to each package is typescript/packages/<project_name>

nx.json is set up to use Conventional commits and independent packages:

    "release": {
        "version": { "conventionalCommits": true },
        "projectsRelationship": "independent"
    }

I have created a commit that changes some file belonging to a package, with a "fix:" prefix in the commit header.

When I run npx nx release version --dry-run it fails to detect any changes, ie. 🚫 No changes were detected using git history and the conventional commits standard.

Expected Behavior

I expect NX release to be able to detect changes if the NX workspace directory is not the root directory of the monorepo

GitHub Repo

https://github.com/hkfb/webviz-subsurface-components/tree/nx_release

Steps to Reproduce

  1. Clone the repo and check out the nx_release tag
  2. In the typescript directory run npx nx release version --dry-run -p subsurface-viewer

Nx Report

Node   : 20.10.0
OS     : linux-x64
npm    : 8.19.4

nx             : 19.2.3
@nx/js         : 19.2.3
@nx/jest       : 19.2.3
@nx/workspace  : 19.2.3
@nx/devkit     : 19.2.3
@nrwl/tao      : 19.2.3
typescript     : 5.4.3
---------------------------------------
Community plugins:
@theunderscorer/nx-semantic-release : 2.11.0

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response