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

Version only suggests major bump in independent mode #3941

Open
benjhoo opened this issue Jan 29, 2024 · 0 comments
Open

Version only suggests major bump in independent mode #3941

benjhoo opened this issue Jan 29, 2024 · 0 comments

Comments

@benjhoo
Copy link

benjhoo commented Jan 29, 2024

Current Behavior

I'm having some tests with Lerna to check if we can easily use it on our monorepo project (ionic frontend + nestJS backend as a main gateway and 17 independent microservices).
So far, everything seemed to be working as expected with conventional commits until I performed a major update test.
Since then, Version only suggests a major bump for all changed packages, even if the release only contains a 'fix' commit.

My Git logs :
Capture d’écran 2024-01-26 à 15 58 56

Lerna version bump suggestion :
Capture d’écran 2024-01-26 à 16 03 25

As we can see, I only committed a fix for the chatbot microservice since the last release (tag v2.0.0), but 'version' suggests a major bump for the impacted microservice (3.0.0 instead of 2.0.1)

Expected Behavior

Suggest a patch bump

Steps to Reproduce

  1. Configure a mono repo project with npm workspaces
  2. Configure lerna version with independent mode, noPush and noGitTagVersion
  3. Do a commit with a breaking change
  4. Execute lerna version
  5. Check that version suggests a major update and confirm
  6. Manually commit the release and create new tag
  7. Do a commit with a fix
  8. Execute lerna version
  9. Check the lerna suggestion (should be a patch)

Configuration

lerna.json

{
  "$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
  "npmClient": "npm",
  "version": "independent",
  "packages": [
    ".",
    "user-frontend/",
    "user-backend/main/",
    "user-backend/microservices/*"
  ],
  "ignoreChanges": [
    "**/CHANGELOG.md",
    "**/node_modules/**",
    "**/package.json",
    "**/*.md"
  ],
  "command": {
    "version": {
      "conventionalCommits": true,
      "push": false,
      "gitTagVersion": false,
      "gitRemote": "ul-origin",
      "allowBranch": [
        "test-lerna"
      ],
      "message": "chore(release): publish new release",
      "syncWorkspaceLock": true,
      "changelogPreset": "angular"
    }
  }
}

project directory

multi/
├── CHANGELOG.md
├── lerna.json
├── package.json
├── ...
├── user-backend/
│	├── ...
│	├── main/
│	│	├── ...
│	│	├── CHANGELOG.md
│	│	└── package.json
│	└── microservices/
│		├── microservice-1/
│		│	├── ...
│		│	├── CHANGELOG.md
│		│	└── package.json
│		├── ...
│		└── microservice-17/
│			├── ...
│			├── CHANGELOG.md
│			└── package.json
└── user-frontend/
	├── ...
	├── CHANGELOG.md
	└── package.json

main package.json

{
  "name": "multi",
  "version": "2.0.0",
  "description": "",
  "author": "",
  "engines": {
    "node": ">=16"
  },
  "private": true,
  "license": "CECILL-2.1",
  "workspaces": [
    "user-backend/main",
    "user-backend/microservices/*",
    "user-frontend"
  ]
}

Environment

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

1 participant