Berry: [Bug] `preferInteractive` has no effect

Created on 9 Jul 2020  ยท  5Comments  ยท  Source: yarnpkg/berry

Describe the bug

According to the docs, preferInteractive: true should imply --interactive flag on every yarn add, but adding preferInteractive to yarnrc.yml has no effect.

To Reproduce


Reproduction

```js repro
await packageJson({ name: 'root', workspaces: ['packages/*'] })
await packageJson({ name: 'package-a', dependencies: { typescript: '3.8' } }, 'packages/package-a')

await expect(yarn('add', 'typescript', '--interactive', { timeout: 60000 })).rejects.toThrow(Command failed) // failed as expected because of interactive mode
require('fs').writeFileSync('.yarnrc.yml', 'preferInteractive: true')
await expect(yarn('add', 'typescript', { timeout: 60000 })).rejects.toThrow(Command failed) // it should also fail because of interactive mode, but succeeded as if there is no preferInteractive
```

Environment

  • Yarn version 2.0.0-rc.36

Additional context

I cannot find any preferInteractive text in this repo other than docs.

bug reproducible

Most helpful comment

๐Ÿค” Looks like yet another one of those "not yet implemented, but somehow documented" features that somehow somebody took the time document. ๐Ÿ˜…
I'm going to implement it soon ๐Ÿ‘

All 5 comments

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

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

This issue reproduces on master:

Error: expect(received).rejects.toThrow()

Received promise resolved instead of rejected
Resolved to value: "โžค YN0000: โ”Œ Resolution step
::group::Resolution step
::endgroup::
โžค YN0000: โ”” Completed in 0.44s
โžค YN0000: โ”Œ Fetch step
::group::Fetch step
โžค YN0013: โ”‚ No packages were cached - 3 packages had to be fetched
::endgroup::
โžค YN0000: โ”” Completed in 42.94s
โžค YN0000: โ”Œ Link step
::group::Link step
::endgroup::
โžค YN0000: โ”” Completed
โžค YN0000: Done in 43.43s
"
    at expect (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-0ac41999f0.zip/node_modules/expect/build/index.js:138:15)
    at module.exports (evalmachine.<anonymous>:7:7)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:13
    at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:16)
    at async Object.executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:12)
    at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:25:38)
    at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
    at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
    at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)

This issue reproduces on master:

Error: expect(received).rejects.toThrow()

Received promise resolved instead of rejected
Resolved to value: "โžค YN0000: โ”Œ Resolution step
::group::Resolution step
::endgroup::
โžค YN0000: โ”” Completed in 0.42s
โžค YN0000: โ”Œ Fetch step
::group::Fetch step
โžค YN0013: โ”‚ No packages were cached - 3 packages had to be fetched
::endgroup::
โžค YN0000: โ”” Completed in 41.26s
โžค YN0000: โ”Œ Link step
::group::Link step
::endgroup::
โžค YN0000: โ”” Completed
โžค YN0000: Done in 41.74s
"
    at expect (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-0ac41999f0.zip/node_modules/expect/build/index.js:138:15)
    at module.exports (evalmachine.<anonymous>:7:7)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:13
    at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:16)
    at async Object.executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:12)
    at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:25:38)
    at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
    at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
    at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)

๐Ÿค” Looks like yet another one of those "not yet implemented, but somehow documented" features that somehow somebody took the time document. ๐Ÿ˜…
I'm going to implement it soon ๐Ÿ‘

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IanVS picture IanVS  ยท  4Comments

danreg picture danreg  ยท  3Comments

joshmeads picture joshmeads  ยท  4Comments

milichev picture milichev  ยท  3Comments

juanpicado picture juanpicado  ยท  4Comments