Skip to content

Workspaces config break C.I. #74

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

Open
borisdamevin opened this issue Sep 16, 2022 · 7 comments
Open

Workspaces config break C.I. #74

borisdamevin opened this issue Sep 16, 2022 · 7 comments

Comments

@borisdamevin
Copy link
Contributor

Hi @ext ,

With "workspaces" lerna configuration, NPM add each packages refs on root package-lock.json, but after each version release, we need to uptdate manualy the package-lock.json because the last version number is not utpdate to date and break github action.

image

Is possible to semantic-release-lerna by himself the refs in root package-lock.json when we are in workspaces configuration?

Thank you.

@borisdamevin
Copy link
Contributor Author

@ext ?

@ext
Copy link
Owner

ext commented Oct 6, 2022

Sorry for the late reply, the notifications got lost in my mailbox. Is this issue not that @semantic-release/git is not configured to add and commit package-lock.json?

@borisdamevin
Copy link
Contributor Author

My config @ext

[
    "@semantic-release/git",
          {
              "message": "chore(release): publish version ${nextRelease.version}",
              "assets": [
                  "CHANGELOG.md",
                  "lerna.json",
                  "package.json",
                  "package-lock.json",
                  "packages/*/package.json",
                  "packages/*/package-lock.json"
              ]
          }
]

@ext
Copy link
Owner

ext commented Oct 6, 2022

Interesting, not sure what causes this. I'm running this with NPM workspaces myself and there is even an integration test covering this scenario: https://github.com/ext/semantic-release-lerna/blob/master/test/integration.test.js#L271

Can you show the full log?

@borisdamevin
Copy link
Contributor Author

> release
> semantic-release

[3:13:59 PM] [semantic-release] › ℹ  Running semantic-release version 19.0.5
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "semantic-release-lerna"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "semantic-release-lerna"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/changelog"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "semantic-release-lerna"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "publish" from "semantic-release-lerna"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[3:13:59 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[3:14:02 PM] [semantic-release] › ✔  Run automated release from branch main on repository https://github.com/magnesiumlabs/magnesium
[3:14:02 PM] [semantic-release] › ✔  Allowed to push to the Git repository
[3:14:02 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[3:14:02 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[3:14:02 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "semantic-release-lerna"
[3:14:02 PM] [semantic-release] [semantic-release-lerna] › ℹ  Verify authentication for registry https://registry.npmjs.org/
[3:14:02 PM] [semantic-release] [semantic-release-lerna] › ℹ  Wrote NPM_TOKEN to /tmp/988797b60236b42073edf521b9766b53/.npmrc
bdamevin
[3:14:03 PM] [semantic-release] › ✖  Failed step "verifyConditions" of plugin "semantic-release-lerna"
[3:14:03 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/git"
[3:14:03 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/git"
[3:14:03 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[3:14:03 PM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication (https://api.github.com/)
[3:14:03 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[3:14:03 PM] [semantic-release] › ℹ  Start step "fail" of plugin "@semantic-release/github"
[3:14:06 PM] [semantic-release] [@semantic-release/github] › ℹ  Created issue #105: https://github.com/magnesiumlabs/magnesium/issues/105.
[3:14:06 PM] [semantic-release] › ✖  EDIRTYWC Dirty working copy.
[3:14:06 PM] [semantic-release] › ✔  Completed step "fail" of plugin "@semantic-release/github"
The git working copy must be clean before releasing:

 M package-lock.json

AggregateError: 
    SemanticReleaseError: Dirty working copy.
        at module.exports (/home/runner/work/magnesium/magnesium/node_modules/semantic-release-lerna/lib/get-error.js:6:9)
        at /home/runner/work/magnesium/magnesium/node_modules/semantic-release-lerna/lib/verify-git.js:24:29
        at Array.map (<anonymous>)
        at verifyGit (/home/runner/work/magnesium/magnesium/node_modules/semantic-release-lerna/lib/verify-git.js:24:4)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async verifyConditions (/home/runner/work/magnesium/magnesium/node_modules/semantic-release-lerna/index.js:39:56)
        at async validator (/home/runner/work/magnesium/magnesium/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
        at async /home/runner/work/magnesium/magnesium/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
        at async Promise.all (index 0)
        at async next (/home/runner/work/magnesium/magnesium/node_modules/p-reduce/index.js:16:18)
    at /home/runner/work/magnesium/magnesium/node_modules/semantic-release/lib/plugins/pipeline.js:54:11
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.pluginsConf.<computed> [as verifyConditions] (/home/runner/work/magnesium/magnesium/node_modules/semantic-release/lib/plugins/index.js:80:11)
    at async run (/home/runner/work/magnesium/magnesium/node_modules/semantic-release/index.js:103:3)
    at async module.exports (/home/runner/work/magnesium/magnesium/node_modules/semantic-release/index.js:269:22)
    at async module.exports (/home/runner/work/magnesium/magnesium/node_modules/semantic-release/cli.js:55:5)
Error: Process completed with exit code 1.

@ext
Copy link
Owner

ext commented Oct 13, 2022

To me it seems like package-lock.json is already modified before starting semantic-release. Can you run git diff before running semantic-release? Do you run npm ci or npm install?

@ext
Copy link
Owner

ext commented Oct 13, 2022

I cant reproduce this issue, can you create a minimal reproduction repo showing the configuration yielding this issue? Take a look at @html-validate/eslint-config, it runs with NPM workspaces and this plugin (see config)

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

No branches or pull requests

2 participants