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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The analytics prompt shouldn't run in CI environments #14563

Closed
mattlewis92 opened this issue May 29, 2019 · 6 comments 路 Fixed by #14572
Closed

The analytics prompt shouldn't run in CI environments #14563

mattlewis92 opened this issue May 29, 2019 · 6 comments 路 Fixed by #14572

Comments

@mattlewis92
Copy link
Contributor

mattlewis92 commented May 29, 2019

馃悶 Bug report

Command (mark with an x)

npm install

Is this a regression?

Yes, the previous version in which this bug was not present was:

v7 and below

Description

When upgrading to v8 the analytics prompt breaks CI as it hangs infinitely waiting for the user to choose to enable it or not

馃敩 Minimal Reproduction

Run npm install on a v8 cli project on CI. For example: https://travis-ci.org/mattlewis92/angular-calendar/builds/538499347

Attempting to disable analytics on the project then fails as the config it adds to angular.json is invalid

ng analytics project off

Screenshot 2019-05-29 at 09 57 39

馃敟 Exception or Error

Screenshot 2019-05-29 at 09 53 42

馃實 Your Environment


Angular CLI: 8.0.0
Node: 12.1.0
OS: darwin x64
Angular: 8.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.0
@angular-devkit/build-angular      0.800.0
@angular-devkit/build-ng-packagr   0.800.0
@angular-devkit/build-optimizer    0.800.0
@angular-devkit/build-webpack      0.800.0
@angular-devkit/core               8.0.0
@angular-devkit/schematics         8.0.0
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.0.0
@schematics/angular                8.0.0
@schematics/update                 0.800.0
ng-packagr                         5.2.0
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0

Anything else relevant?

The is-ci package could be used to disable that prompt on CI envs: https://www.npmjs.com/package/is-ci

The analytics config needs to be added to the schema so it can be disabled at the project level

The workaround for now is to add this to travis.yml

before_install: npx @angular/cli analytics off
@mgechev
Copy link
Member

mgechev commented May 29, 2019

You can set this flag in your CI to disable the analytics. We'll work on fixing this in the next patch release.

@mattlewis92
Copy link
Contributor Author

Awesome, thanks @mgechev! btw it might be worth documenting the NG_CLI_ANALYTICS variable here: https://angular.io/analytics

@cyrilletuzi
Copy link
Contributor

I also have this issue. For info: it appeared during the CLI beta phase, then was fixed (it was OK in CLI v8.0.0-rc.4), and is here again in v8.0.0, so a commit between v8.0.0-rc.4 and 8.0.0 reintroduced this issue.

@tiffanychenn
Copy link

Still having this issue. I'm currently using v8.0.6 and building on concourse's CI. See screenshot below.

Screen Shot 2019-07-02 at 9 39 36 AM

@trazek
Copy link

trazek commented Jul 2, 2019

Still having this issue. I'm currently using v8.0.6 and building on concourse's CI. See screenshot below.

Screen Shot 2019-07-02 at 9 39 36 AM

The issue above is taking place when the CI process is installing dependencies. We have tried flipping an env variable to have the CLI not prompt this message with no luck

@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 Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants