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

Graduating a prerelease with no further changes #1675

Closed
MartinBlackburn opened this issue Sep 13, 2018 · 7 comments · Fixed by #1991
Closed

Graduating a prerelease with no further changes #1675

MartinBlackburn opened this issue Sep 13, 2018 · 7 comments · Fixed by #1991

Comments

@MartinBlackburn
Copy link

When we're happy with our latest prerelease we'd like to graduate the packages even if no further changes were made.
We thought this would be fixed in issue #1671, but we now get a new problem where lerna wont release an already released commit.

Expected Behavior

Version is updated from 0.0.1-prelease.0 to 0.0.1

Current Behavior

lerna publish --force-publish=lobby --yes --conventional-commits --no-verify-registry --no-verify-access
lerna notice cli v3.3.2
lerna info versioning independent
lerna info Looking for changed packages since lobby@0.0.1-prerelease.0
lerna WARN force-publish lobby
lerna ERR! ERELEASED The current commit has already been released. Please make new commits before continuing.

Steps to Reproduce (for bugs)

  1. git commit -m'chore: example change'
  2. lerna version prerelease --force-publish=lobby --yes --preid=prerelease --npm-tag=prerelease => 0.0.1-prerelease.0
  3. lerna version --force-publish=lobby --yes --conventional-commits => would like 0.0.1 got The current commit has already been released
lerna.json

{
  "packages": [
    "packages/*",
    "apps/*"
  ],
  "command": {
    "publish": {
      "conventionalCommits": true,
      "message": "chore(release): publish",
      "allowBranch": "release/build"
    }
  },
  "npmClient": "yarn",
  "useWorkspaces": true,
  "version": "independent"
}

Context

We prerelease packages on every merge to our release branch. After testing we will manually take the decision to graduate these packages.

Your Environment

Executable Version
lerna --version 3.3.2
npm --version 6.4.1
yarn --version 1.9.4
node --version v8.11.1
OS Version
macOS el Capitan 10.11.6
@MartinBlackburn
Copy link
Author

The current workaround I am using for this is to make an "empty" commit to the branch, such as whitespace change, then run learna publish
It does mean we are polluting the git history, but for now, it works.

@sergiohgz
Copy link

This is too close to our problem described in #1667, after updating to 3.3.2 we are getting that ERELEASED and blocked our workflow. Thanks @MartinBlackburn for your idea of an empty commit, it's making our git tree too ugly, but works for the meanwhile.

@evocateur what do you think about that ERELEASED error? We think that is not correct if we force

@x5a
Copy link

x5a commented Sep 24, 2018

I would argue that the promotion of "staging" package > "latest" package should be allowed even without force.

@evocateur
Copy link
Member

  1. It's really confusing when you title a new issue identically to a previously closed one.
  2. Reproduction needed, a failing test would be ideal.

@phun-ky
Copy link

phun-ky commented Dec 6, 2018

I'm getting the same, see attached screenshot. It should not be hard to reproduce. I am trying to force version packages to test CI without polluting git history.

image

EDIT: This might solve stuff for my part:

 lerna version --force-publish --yes --conventional-commits --no-git-tag-version --no-push

@akrantz
Copy link

akrantz commented Jan 28, 2019

I started using Lerna and ran into this same issue. I published using "lerna publish --dist-tag next" with a prerelease version (2.0.0-alpha.0). After validation that it was good, I wanted to re-publish the packages with the updated version using the "latest" dist-tag. But Lerna says that there are no changes.

I ended up moving the "Publish" commit to a "next" branch in git and reset the master branch to the previous commit. I could then publish from the master branch because there were changes on the master branch.

However, it would still be good to have a way to have Lerna be able to republish a prerelease version as a release version.

@imbhargav5
Copy link

What I do to overcome this issue.

lerna version --force-publish --no-git-tag-version

Commit package.jsons which have changed.

lerna publish from-package

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

Successfully merging a pull request may close this issue.

7 participants