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

[Bug?]: yarn up picking pre-release versions #6207

Open
1 task
Cellule opened this issue Apr 5, 2024 · 2 comments
Open
1 task

[Bug?]: yarn up picking pre-release versions #6207

Cellule opened this issue Apr 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Cellule
Copy link

Cellule commented Apr 5, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

Running yarn up <pkg> on a package that has a upcoming pre-release version will upgrade to that version.
Pre-releases are by design unstable and not ready and should not be picked up automatically by yarn up

In our setup, we create pre-releases from developper PRs to test end-to-end install.
So if I have a lib @notreal/mypackage installed on version 0.1.5 and a dev opens a PR, it will create version 0.1.6-<branchname>.<build>
Then if I run yarn up @notreal/mypackage it will upgrade to version 0.1.6-<branchname>.<build>

To reproduce

const {promises: {readFile}} = require(`fs`);

await packageJsonAndInstall({
  dependencies: {"@iterable/web-sdk": "^1.0.8"},
});

await yarn(`up`, `@iterable/web-sdk`);

const pkgJson = JSON.parse(await readFile(`package.json`, `utf8`));
expect(pkgJson.dependencies["@iterable/web-sdk"]).not.toBe(`^1.1.0-beta`);

Environment

System:
    OS: macOS 14.4.1
    CPU: (12) arm64 Apple M2 Max
  Binaries:
    Node: 20.11.0 - /private/var/folders/v0/7jhk4nzs3b7dcy40vqp4pg200000gp/T/xfs-f5fb1c3b/node
    Yarn: 3.8.0 - /private/var/folders/v0/7jhk4nzs3b7dcy40vqp4pg200000gp/T/xfs-f5fb1c3b/yarn
    npm: 10.4.0 - ~/.nvs/default/bin/npm
    pnpm: 8.15.4 - ~/.nvs/default/bin/pnpm

Additional context

No response

@Cellule Cellule added the bug Something isn't working label Apr 5, 2024
@dfilipidisz
Copy link

I think I just experienced the same behaviour. In my case, I had "eslint-plugin-vitest": "0.4.1" defined in my package.json, and after yarn upgrade-interactive, I've ended up having "eslint-plugin-vitest": "0.4.2-beta.3" in there. The upgrade tool listed simply 0.4.2.

Can be reproduced with this package.json, by running first yarn install and than yarn upgrade-interactive:

{
  "name": "report",
  "packageManager": "yarn@4.1.1",
  "dependencies": {
    "eslint-plugin-vitest": "0.4.1"
  }
}
yarn-report

Environment:

  System:
    OS: macOS 12.7.4
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 20.10.0 - /private/var/folders/_q/vwtq1bkj4gs2g421_x8zp0rr0000gn/T/xfs-96f626c4/node
    Yarn: 4.1.1 - /private/var/folders/_q/vwtq1bkj4gs2g421_x8zp0rr0000gn/T/xfs-96f626c4/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm

@me4502
Copy link
Contributor

me4502 commented Apr 9, 2024

I've also been experiencing this, however in my case it started around the same time as we switched to using internal package feeds, so my assumption had initially been that it was caused by the internal feeds. After testing against the live NPM feed though, I can see the same issue. It started probably early in the second half of last year.

  System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.20.1 - /private/var/folders/92/h3d4hb8n54g0kmbbvqhl4fp40000gn/T/xfs-f168ff78/node
    Yarn: 4.1.0 - /private/var/folders/92/h3d4hb8n54g0kmbbvqhl4fp40000gn/T/xfs-f168ff78/yarn
    npm: 9.8.1 - /opt/homebrew/bin/npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants