yarnpkg / berry

πŸ“¦πŸˆ Active development trunk for Yarn βš’
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.41k stars 1.11k forks source link

[Bug] upgrade-interactive shows linked packages #2865

Closed AaronBuxbaum closed 3 years ago

AaronBuxbaum commented 3 years ago

Describe the bug

When a user uses a link to a local folder (as recommended in the documentation to replace disparate tooling), upgrade-interactive still tries to match the version to whatever npm package happens to match the name of the link. This means that every time a user upgrades packages, they have to be careful not to accidentally upgrade their linked folders.

To Reproduce

Reproduction ```js repro // Sherlock reproduction. For instance: await packageJsonAndInstall({ dependencies: { [`src`]: `link:./src`, }, }); const output = await yarn(`upgrade-interactive`); expect(output).not.toContain(`src`); ```

If the user runs yarn upgrade-interactive, Yarn will attempt to provide the npm package version, as seen in screenshot below.

NOTE: this won't work with Sherlock because it requires interaction -- waiting until it's ready to go and closing the command so it doesn't hang permanently. I wasn't able to make something that actually worked, but it's pretty easy to reproduce in general, and I'd be happy to make a reproduction if desired.

Screenshots

Screen Shot 2021-05-09 at 11 55 40 PM

Environment if relevant (please complete the following information):

yarnbot commented 3 years ago

We couldn't reproduce your issue (all the assertions passed on master).

yarnbot commented 3 years ago

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js upgrade-interactive

  ERROR Raw mode is not supported on the current process.stdin, which Ink uses
       as input stream by default.
       Read about how to prevent this error on
       https://github.com/vadimdemedes/ink/#israwmodesupported

 - Read about how to prevent this error on
   https://github.com/vadimdemedes/ink/#israwmodesupported
 -setRawMod (/github/workspace/.yarn/__virtual__/ink-virtual-dceb36bd5f/0/cache
           /ink-npm-3.0.8-3a8005f59f-8ec8fac189.zip/node_modules/ink/src/compon
           ents/App.tsx:139:11)
 - (/github/workspace/.yarn/__virtual__/@yarnpkg-libui-virtual-c04767462f/1/pac
  kages/yarnpkg-libui/sources/components/Application.tsx:15:19)
 -commitHookEffect (/github/workspace/.yarn/__virtual__/react-reconciler-virtua
  ist             l-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c
                  9c7420832.zip/node_modules/react-reconciler/cjs/react-reconci
                  ler.development.js:12025:26)
 -commitPassiveHookE (/github/workspace/.yarn/__virtual__/react-reconciler-virt
  ffects            ual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763
                    d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-r
                    econciler.development.js:12059:11)
 -Object.invokeGuardedCa (/github/workspace/.yarn/__virtual__/react-reconciler-
  lbackImpl             virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-
                        eaeed763d0-c9c7420832.zip/node_modules/react-reconciler
                        /cjs/react-reconciler.development.js:11563:10)
 -invokeGuardedCal (/github/workspace/.yarn/__virtual__/react-reconciler-virtua
  back            l-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c
                  9c7420832.zip/node_modules/react-reconciler/cjs/react-reconci
                  ler.development.js:11740:31)
 -flushPassiveEffec (/github/workspace/.yarn/__virtual__/react-reconciler-virtu
  sImpl            al-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0
                   -c9c7420832.zip/node_modules/react-reconciler/cjs/react-reco
                   nciler.development.js:15390:7)
 -unstable_runWithPr (/github/workspace/.yarn/cache/scheduler-npm-0.18.0-ee0cc1
  iority            e577-b6e0b9e008.zip/node_modules/scheduler/cjs/scheduler.de
                    velopment.js:697:12)
 -runWithPrior (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d1
  ty          14f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c742083
              2.zip/node_modules/react-reconciler/cjs/react-reconciler.developm
              ent.js:1881:10)
 -flushPassiveEff (/github/workspace/.yarn/__virtual__/react-reconciler-virtual
  cts            -d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c
                 7420832.zip/node_modules/react-reconciler/cjs/react-reconciler
                 .development.js:15359:12)

Internal Error: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
    at setRawMode (/github/workspace/.yarn/__virtual__/ink-virtual-dceb36bd5f/0/cache/ink-npm-3.0.8-3a8005f59f-8ec8fac189.zip/node_modules/ink/src/components/App.tsx:139:11)
    at /github/workspace/.yarn/__virtual__/@yarnpkg-libui-virtual-c04767462f/1/packages/yarnpkg-libui/sources/components/Application.tsx:15:19
    at commitHookEffectList (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:12025:26)
    at commitPassiveHookEffects (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:12059:11)
    at Object.invokeGuardedCallbackImpl (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:11563:10)
    at invokeGuardedCallback (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:11740:31)
    at flushPassiveEffectsImpl (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:15390:7)
    at unstable_runWithPriority (/github/workspace/.yarn/cache/scheduler-npm-0.18.0-ee0cc1e577-b6e0b9e008.zip/node_modules/scheduler/cjs/scheduler.development.js:697:12)
    at runWithPriority (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:1881:10)
    at flushPassiveEffects (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:15359:12)

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

yarnbot commented 3 years ago

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js upgrade-interactive

  ERROR Raw mode is not supported on the current process.stdin, which Ink uses
       as input stream by default.
       Read about how to prevent this error on
       https://github.com/vadimdemedes/ink/#israwmodesupported

 - Read about how to prevent this error on
   https://github.com/vadimdemedes/ink/#israwmodesupported
 -setRawMod (/github/workspace/.yarn/__virtual__/ink-virtual-dceb36bd5f/0/cache
           /ink-npm-3.0.8-3a8005f59f-8ec8fac189.zip/node_modules/ink/src/compon
           ents/App.tsx:139:11)
 - (/github/workspace/.yarn/__virtual__/@yarnpkg-libui-virtual-c04767462f/1/pac
  kages/yarnpkg-libui/sources/components/Application.tsx:15:19)
 -commitHookEffect (/github/workspace/.yarn/__virtual__/react-reconciler-virtua
  ist             l-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c
                  9c7420832.zip/node_modules/react-reconciler/cjs/react-reconci
                  ler.development.js:12025:26)
 -commitPassiveHookE (/github/workspace/.yarn/__virtual__/react-reconciler-virt
  ffects            ual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763
                    d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-r
                    econciler.development.js:12059:11)
 -Object.invokeGuardedCa (/github/workspace/.yarn/__virtual__/react-reconciler-
  lbackImpl             virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-
                        eaeed763d0-c9c7420832.zip/node_modules/react-reconciler
                        /cjs/react-reconciler.development.js:11563:10)
 -invokeGuardedCal (/github/workspace/.yarn/__virtual__/react-reconciler-virtua
  back            l-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c
                  9c7420832.zip/node_modules/react-reconciler/cjs/react-reconci
                  ler.development.js:11740:31)
 -flushPassiveEffec (/github/workspace/.yarn/__virtual__/react-reconciler-virtu
  sImpl            al-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0
                   -c9c7420832.zip/node_modules/react-reconciler/cjs/react-reco
                   nciler.development.js:15390:7)
 -unstable_runWithPr (/github/workspace/.yarn/cache/scheduler-npm-0.18.0-ee0cc1
  iority            e577-b6e0b9e008.zip/node_modules/scheduler/cjs/scheduler.de
                    velopment.js:697:12)
 -runWithPrior (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d1
  ty          14f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c742083
              2.zip/node_modules/react-reconciler/cjs/react-reconciler.developm
              ent.js:1881:10)
 -flushPassiveEff (/github/workspace/.yarn/__virtual__/react-reconciler-virtual
  cts            -d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c
                 7420832.zip/node_modules/react-reconciler/cjs/react-reconciler
                 .development.js:15359:12)

Internal Error: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
    at setRawMode (/github/workspace/.yarn/__virtual__/ink-virtual-dceb36bd5f/0/cache/ink-npm-3.0.8-3a8005f59f-8ec8fac189.zip/node_modules/ink/src/components/App.tsx:139:11)
    at /github/workspace/.yarn/__virtual__/@yarnpkg-libui-virtual-c04767462f/1/packages/yarnpkg-libui/sources/components/Application.tsx:15:19
    at commitHookEffectList (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:12025:26)
    at commitPassiveHookEffects (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:12059:11)
    at Object.invokeGuardedCallbackImpl (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:11563:10)
    at invokeGuardedCallback (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:11740:31)
    at flushPassiveEffectsImpl (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:15390:7)
    at unstable_runWithPriority (/github/workspace/.yarn/cache/scheduler-npm-0.18.0-ee0cc1e577-b6e0b9e008.zip/node_modules/scheduler/cjs/scheduler.development.js:697:12)
    at runWithPriority (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:1881:10)
    at flushPassiveEffects (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:15359:12)

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

yarnbot commented 3 years ago

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js upgrade-interactive

  ERROR Raw mode is not supported on the current process.stdin, which Ink uses
       as input stream by default.
       Read about how to prevent this error on
       https://github.com/vadimdemedes/ink/#israwmodesupported

 - Read about how to prevent this error on
   https://github.com/vadimdemedes/ink/#israwmodesupported
 -setRawMod (/github/workspace/.yarn/__virtual__/ink-virtual-dceb36bd5f/0/cache
           /ink-npm-3.0.8-3a8005f59f-8ec8fac189.zip/node_modules/ink/src/compon
           ents/App.tsx:139:11)
 - (/github/workspace/.yarn/__virtual__/@yarnpkg-libui-virtual-c04767462f/1/pac
  kages/yarnpkg-libui/sources/components/Application.tsx:15:19)
 -commitHookEffect (/github/workspace/.yarn/__virtual__/react-reconciler-virtua
  ist             l-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c
                  9c7420832.zip/node_modules/react-reconciler/cjs/react-reconci
                  ler.development.js:12025:26)
 -commitPassiveHookE (/github/workspace/.yarn/__virtual__/react-reconciler-virt
  ffects            ual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763
                    d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-r
                    econciler.development.js:12059:11)
 -Object.invokeGuardedCa (/github/workspace/.yarn/__virtual__/react-reconciler-
  lbackImpl             virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-
                        eaeed763d0-c9c7420832.zip/node_modules/react-reconciler
                        /cjs/react-reconciler.development.js:11563:10)
 -invokeGuardedCal (/github/workspace/.yarn/__virtual__/react-reconciler-virtua
  back            l-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c
                  9c7420832.zip/node_modules/react-reconciler/cjs/react-reconci
                  ler.development.js:11740:31)
 -flushPassiveEffec (/github/workspace/.yarn/__virtual__/react-reconciler-virtu
  sImpl            al-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0
                   -c9c7420832.zip/node_modules/react-reconciler/cjs/react-reco
                   nciler.development.js:15390:7)
 -unstable_runWithPr (/github/workspace/.yarn/cache/scheduler-npm-0.18.0-ee0cc1
  iority            e577-b6e0b9e008.zip/node_modules/scheduler/cjs/scheduler.de
                    velopment.js:697:12)
 -runWithPrior (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d1
  ty          14f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c742083
              2.zip/node_modules/react-reconciler/cjs/react-reconciler.developm
              ent.js:1881:10)
 -flushPassiveEff (/github/workspace/.yarn/__virtual__/react-reconciler-virtual
  cts            -d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c
                 7420832.zip/node_modules/react-reconciler/cjs/react-reconciler
                 .development.js:15359:12)

Internal Error: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
    at setRawMode (/github/workspace/.yarn/__virtual__/ink-virtual-dceb36bd5f/0/cache/ink-npm-3.0.8-3a8005f59f-8ec8fac189.zip/node_modules/ink/src/components/App.tsx:139:11)
    at /github/workspace/.yarn/__virtual__/@yarnpkg-libui-virtual-c04767462f/1/packages/yarnpkg-libui/sources/components/Application.tsx:15:19
    at commitHookEffectList (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:12025:26)
    at commitPassiveHookEffects (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:12059:11)
    at Object.invokeGuardedCallbackImpl (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:11563:10)
    at invokeGuardedCallback (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:11740:31)
    at flushPassiveEffectsImpl (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:15390:7)
    at unstable_runWithPriority (/github/workspace/.yarn/cache/scheduler-npm-0.18.0-ee0cc1e577-b6e0b9e008.zip/node_modules/scheduler/cjs/scheduler.development.js:697:12)
    at runWithPriority (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:1881:10)
    at flushPassiveEffects (/github/workspace/.yarn/__virtual__/react-reconciler-virtual-d114f7dd7d/0/cache/react-reconciler-npm-0.24.0-eaeed763d0-c9c7420832.zip/node_modules/react-reconciler/cjs/react-reconciler.development.js:15359:12)

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

yarnbot commented 3 years ago

Hi! πŸ‘‹

This issue looks stale, and doesn't feature the reproducible label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).

Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! πŸ˜ƒ

If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded label. Thanks for helping us triaging our repository! 🌟

lensbart commented 1 year ago

Fixed in https://github.com/yarnpkg/berry/pull/5442