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

nx release does not detect changes #30026

Open
1 of 4 tasks
rrrnld opened this issue Feb 13, 2025 · 2 comments
Open
1 of 4 tasks

nx release does not detect changes #30026

rrrnld opened this issue Feb 13, 2025 · 2 comments

Comments

@rrrnld
Copy link

rrrnld commented Feb 13, 2025

Current Behavior

I have two projects, project-a and project-a-helm. project-a-helm depends on project-a, which is defined in a package.json. here's an excerpt of the git history; please ignore project-b, it's just in here so i don't leave out bits of the history.

# git log --oneline
2562b8bb2 fix(project-a-helm): rotate mailchimp & google api key in feature deployment
1ab6c62cb chore(project-a): remove unused {preview,dev,qa}-*.yaml config
2830c8502 chore(project-a): remove unused config file
fbe729694 feat(project-a): re-enable auth
23b0588ff (tag: [email protected], fix/project-a-auth) chore(release): publish [no ci]
aaf0a75d4 fix(project-b): canonical urls for sections
0806a932d refactor(project-b): cleanup
0dc171c0c refactor(project-b): cleanup
35eec823d fix(project-b): members canonical route
1b01038dd fix(project-b): make sure members page is not static
79e743e42 feat(project-b): sort members and move their page to app folder
d24f04323 (tag: [email protected], tag: [email protected]) chore(release): publish [no ci]

And this is my config for nx release:

{
  // …
  "release": {
    "version": {
      "generatorOptions": {
        "updateDependents": "auto",
        "preserveLocalDependencyProtocols": true
      },
      "conventionalCommits": true
    },
    "projects": "*",
    "projectsRelationship": "independent",
    "changelog": {
      "projectChangelogs": true
    }
  }
}

Running

pnpm nx release --dry-run

does not detect any changes to project-a, even though 1ab6c62cb, 2830c8502 and fbe729694 all changed it since the last release. it does detect the changes to project-a-helm.

 NX   Running release version for project: project-a

project-a 🔍 Reading data for package "@org/project-a" from apps/project-a/package.json
project-a 📄 Resolved the current version as 100.3.0 from git tag "[email protected]".
project-a 🚫 No changes were detected using git history and the conventional commits standard.
project-a 🚫 Skipping versioning "@org/project-a" as no changes were detected.

 NX   Running release version for project: project-a-helm

project-a-helm 🔍 Reading data for package "@org/project-a-helm" from helm-charts/project-a/package.json
project-a-helm 📄 Resolved the current version as 100.0.12 from git tag "[email protected]".
project-a-helm 📄 Resolved the specifier as "patch" using git history and the conventional commits standard.
project-a-helm ✍️  New version 100.0.13 written to helm-charts/project-a/package.json


UPDATE helm-charts/project-a/package.json [dry-run]

    "private": true,
-   "version": "100.0.12",
+   "version": "100.0.13",
    "dependencies": {

any idea what may cause this?

Expected Behavior

I'd expect nx release to pick up the changes from the commits that happened on the same branch since the last tagged release.

GitHub Repo

No response

Steps to Reproduce

See the git log above. I'm happy to provide any additional info that may help.

Nx Report

NX   Report complete - copy this into the issue template

Node           : 18.20.6
OS             : linux-x64
Native Target  : x86_64-linux
pnpm           : 10.2.1

nx             : 19.8.14
@nx/js         : 19.8.0
@nx/workspace  : 19.8.0
@nx/devkit     : 19.8.0
@nrwl/tao      : 19.8.14
typescript     : 5.7.3
---------------------------------------
The following packages should match the installed version of nx
  - @nx/[email protected]
  - @nrwl/[email protected]
  - @nx/[email protected]
  - @nrwl/[email protected]
  - @nx/[email protected]
  - @nrwl/[email protected]

To fix this, run `nx migrate [email protected]`

Same thing happens with nx 20.4.3.

Failure Logs

Package Manager Version

10.2.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

This is the full nx.json:

{
  "$schema": "./node_modules/nx/schemas/nx-schema.json",
  "defaultBase": "main",
  "namedInputs": {
    "default": ["{projectRoot}/**/*"],
    "js": ["{projectRoot}/**/*.{js,mjs,cjs}"],
    "ts": ["{projectRoot}/**/*.ts"],
    "tsx": ["{projectRoot}/**/*.tsx"],
    "tsconfig": ["{workspaceRoot}/default-tsconfig.json", "{projectRoot}/tsconfig.json"],
    "tsconfig-test": ["tsconfig", "{projectRoot}/tsconfig.test.json"],
    "default-values": ["{projectRoot}/default-values.mjs"],
    "eslint-config": ["tsconfig", "default-values", "{workspaceRoot}/default-eslint-config.mjs", "{projectRoot}/eslint.config.mjs"],
    "jest-config": ["tsconfig-test", "default-values", "{workspaceRoot}/default-jest-config.mjs", "{projectRoot}/jest.config.mjs"],
    "jest-integration-config": ["tsconfig-test", "default-values", "{workspaceRoot}/default-jest-config.mjs", "{projectRoot}/jest.config.mjs"],
    "docker": ["{workspaceRoot}/docker-install.sh", "{workspaceRoot}/.dockerignore", "{projectRoot}/Dockerfile", "{projectRoot}/docker-compose*.{yaml,yml}"],
    "helm": ["{projectRoot}/templates/**/*", "{projectRoot}/{values.yaml,Chart.lock,Chart.yaml,.helmignore}"]
  },
  "targetDefaults": {
    "build": {
      "cache": true,
      "dependsOn": [
        "^build"
      ],
      "inputs": [
        "js",
        "ts",
        "tsx",
        "tsconfig",
        { "externalDependencies": ["typescript"] }
      ],
      "outputs": ["{projectRoot}/dist"]
    },
    "lint": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": [
        "js",
        "ts",
        "tsx",
        "eslint-config",
        { 
          "externalDependencies": [
            "eslint",
            "@eslint/js",
            "eslint-plugin-jest",
            "typescript-eslint",
            "typescript"
          ] 
        }
      ]
    },
    "test": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": [
        "default",
        "jest-config",
        { 
          "externalDependencies": [
            "jest",
            "ts-jest",
            "typescript"
          ] 
        }
      ]
    },
    "integration-test": {
      "cache": true,
      "parallelism": false,
      "dependsOn": ["^build"],
      "inputs": [
        "default",
        "jest-integration-config",
        { 
          "externalDependencies": [
            "jest",
            "ts-jest",
            "typescript"
          ] 
        }
      ]
    },
    "build:docker": {
      "inputs": ["docker"]
    },
    "build:docker-push": {
      "dependsOn": ["build:docker"],
      "inputs": ["docker"]
    },
    "build:docker-release": {
      "inputs": ["docker"]
    },
    "build:docker-release-push": {
      "dependsOn": ["build:docker-release"],
      "inputs": ["docker"]
    },
    "deploy:feature": {
      "dependsOn": ["^build:docker-push"],
      "inputs": ["helm", "{projectRoot}/feature*.yaml", "{projectRoot}/bin/**/*"]
    },
    "deploy:dev": {
      "dependsOn": ["^build:docker-push"],
      "inputs": ["helm", "{projectRoot}/dev*.yaml", "{projectRoot}/bin/**/*"]
    },
    "deploy:qa": {
      "dependsOn": ["^build:docker-push"],
      "inputs": ["helm", "{projectRoot}/qa*.yaml", "{projectRoot}/bin/**/*"]
    },
    "deploy:preview": {
      "dependsOn": ["^build:docker-push"],
      "inputs": ["helm", "{projectRoot}/preview*.yaml", "{projectRoot}/bin/**/*"]
    },
    "release": {
      "dependsOn": ["build:docker-release-push"]
    },
    "release:commit": {
      "dependsOn": ["release"],
      "parallelism": false
    }
  },
  "plugins": [],
  "release": {
    "version": {
      "generatorOptions": {
        "updateDependents": "auto",
        "preserveLocalDependencyProtocols": true
      },
      "conventionalCommits": true
    },
    "projects": "*",
    "projectsRelationship": "independent",
    "changelog": {
      "projectChangelogs": true
    }
  }
}
@thdk
Copy link
Contributor

thdk commented Feb 13, 2025

Hi, can you list the file paths that where touched with commits 1ab6c62cb, 2830c8502 and fbe729694?

@rrrnld
Copy link
Author

rrrnld commented Feb 14, 2025

Sure!

commit 1ab6c62cb21cb383e6dd22295f096ff36ffa4f98
Author: rrrnld
Date:   Thu Feb 13 14:37:53 2025 +0100

    chore(project-a): remove unused {preview,dev,qa}-*.yaml config

D	helm-charts/project-a/dev-secrets.yaml
D	helm-charts/project-a/dev-values.yaml
D	helm-charts/project-a/preview-secrets.yaml
D	helm-charts/project-a/preview-values.yaml
D	helm-charts/project-a/qa-secrets.yaml
D	helm-charts/project-a/qa-values.yaml

commit 2830c85023dae67aecb6b36a58a56d6d21ef8f8d
Author: rrrnld
Date:   Thu Feb 13 16:46:11 2025 +0100

    chore(project-a): remove unused config file
    
    basically a no-op, hopefully triggers a release

D	apps/project-a/vercel.json

commit fbe729694727d37e3712fea1d2ef12876839192a
Author: rrrnld
Date:   Thu Feb 13 15:40:47 2025 +0100

    feat(project-a): re-enable auth
    
    This reverts commit a4f2c8c1b5e6fcf0d99854dcad5c05abd419062b.

A	apps/project-a/pages/api/auth/[...nextauth].ts

Note that both projects contain an project.json that defines their name:

// apps/project-a/project.sjon
{
  "name": "project-a",
  "includedScripts": [
    "build",
    "dev",
    "lint",
    "test",
    "build:docker-push"
  ],
  "targets": {
    "build": {
      "cache": false,
      "outputs": [
        "{projectRoot}/.next",
        "!{projectRoot}/.next/cache"
      ]
    },
    "dev": {
      "dependsOn": [
        "^build"
      ]
    }
  }
}

// helm-charts/project-a/project.json
{
  "name": "project-a-helm"
}

I just noticed that 1ab6c62cb21cb383e6dd22295f096ff36ffa4f98 uses the wrong scope, it should be chore(project-a-helm); may that cause issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants