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

Passing multiple --configuration options broken as of 14.0.0-next.5 #22956

Closed
6 of 15 tasks
bgotink opened this issue Apr 8, 2022 · 3 comments · Fixed by #22966
Closed
6 of 15 tasks

Passing multiple --configuration options broken as of 14.0.0-next.5 #22956

bgotink opened this issue Apr 8, 2022 · 3 comments · Fixed by #22966
Assignees
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@bgotink
Copy link
Contributor

bgotink commented Apr 8, 2022

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, passing multiple --configurations worked up to and including 14.0.0-next.4

Description

🔬 Minimal Reproduction

ng test --configuration lorem --configuration ipsum

See https://stackblitz.com/edit/node-sxof7v?file=README.md for a minimalistic repro set-up.

🔥 Exception or Error


$ ng test repro --configuration lorem --configuration ipsum
An unhandled exception occurred: targetConfiguration.split is not a function
See "/tmp/ng-38e66e/angular-errors.log" for further details.

$  cat /tmp/ng-38e66e/angular-errors.log
[error] TypeError: targetConfiguration.split is not a function
    at WorkspaceNodeModulesArchitectHost.getOptionsForTarget (/home/projects/node-sxof7v/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:158:56)
    at async TestCommandModule.runSingleTarget (/home/projects/node-sxof7v/node_modules/@angular/cli/src/command-builder/architect-base-command-module.js:37:17)
    at async TestCommandModule.run (/home/projects/node-sxof7v/node_modules/@angular/cli/src/command-builder/architect-command-module.js:65:20)
    at async TestCommandModule.handler (/home/projects/node-sxof7v/node_modules/@angular/cli/src/command-builder/command-module.js:101:24)

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 14.0.0-next.8
Node: 16.14.2
Package Manager: npm 7.17.0 
OS: linux x64

Angular: undefined
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1303.2
@angular-devkit/core         13.3.2
@angular-devkit/schematics   14.0.0-next.8
@angular/cli                 14.0.0-next.8
@schematics/angular          14.0.0-next.8

Anything else relevant?

n/a

@alan-agius4
Copy link
Collaborator

Actually in this case in version 13, the first configuration argument was ignored. Multiple configurations must be passed comma separated.

 ng test --configuration lorem,ipsum

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity5: regression area: @angular/cli labels Apr 8, 2022
@ngbot ngbot bot added this to the needsTriage milestone Apr 8, 2022
@bgotink
Copy link
Contributor Author

bgotink commented Apr 8, 2022

Yeah I discovered that behaviour while investigating the error in our angular 14 branch. There's only one very specific case where we run into this situation: our e2e tests.

These are defined as a run-script in our package.json: "e2e": "ng e2e --configuration ci", and one of our pipelines then runs this via yarn e2e --configuration release. This turns out fine, ci is superfluous in this scenario.

@alan-agius4 alan-agius4 self-assigned this Apr 8, 2022
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Apr 8, 2022
dgp1130 pushed a commit that referenced this issue Apr 11, 2022
With this change we add a Yargs middleware that normalizes non Array options when the argument has been provided multiple times.

By default, when an option is non array and it is provided multiple times in the command line, yargs
will not override it's value but instead it will be changed to an array unless `duplicate-arguments-array` is disabled.
But this option also have an effect on real array options which isn't desired.

See: yargs/yargs-parser#163 (comment)

Closes #22956
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
2 participants