Skip to content

build: update yarn to v1.16.0 #16260

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

Merged
merged 1 commit into from
Jun 12, 2019

Conversation

devversion
Copy link
Member

@devversion devversion commented Jun 11, 2019

Currently our version of Yarn is installed through the "angular/ngcontainer"
docker image. This is problematic because in order to be able to update
Yarn, we always need to update the docker image to a version that comes
with the desired Yarn version. Sometimes there is no docker image with the
desired latest Yarn version, and therefore we cannot easily update the Yarn version.

Additionally the latest Yarn versions contain various fixes for debugging timeout
issues (e.g. yarnpkg/yarn@024e9fe) and also have improved logic for restoring existing
node_modules. This is essential to take advantage of the CircleCI caching mechanism.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 11, 2019
@devversion devversion force-pushed the build/update-yarn-1.16.0 branch 2 times, most recently from 08850cb to 11b7a05 Compare June 11, 2019 06:27
Currently our version of Yarn is installed through the "angular/ngcontainer"
docker image. This is problematic because in order to be able to update
Yarn, we always need to update the docker image to a version that comes
with the desired Yarn version. Sometimes there is no docker image with the
desired latest Yarn version, and therefore we cannot easily update the Yarn version.

Additionally the latest Yarn versions contain various fixes for debugging timeout
issues and also have improved logic for restoring existing `node_modules`. This
is **essential** to take advantage of the CircleCI caching mechanism.
@devversion devversion force-pushed the build/update-yarn-1.16.0 branch from 11b7a05 to f32d5a1 Compare June 11, 2019 06:30
@devversion devversion marked this pull request as ready for review June 11, 2019 06:33
@devversion devversion requested a review from jelbourn as a code owner June 11, 2019 06:33
@devversion devversion added target: patch This PR is targeted for the next patch release pr: merge safe labels Jun 11, 2019
@jelbourn
Copy link
Member

@alexeagle should there just be a newer version of ngcontainer?

@devversion
Copy link
Member Author

devversion commented Jun 11, 2019

@jelbourn And that's part of the problem. It makes us dependent on a docker image that doesn't have a well-defined release process. e.g. no images for latest Bazel version etc.

Additionally IMO the ultimate goal is to only bring in Bazel through one of the official gcr.io docker images (which are automated & maintained) and everything else is hermetically brought in by Bazel (e.g. Yarn / NodeJS etc.)

This right now just gives us flexibility and decouples the Yarn version from the ngcontainer image. We did the same on angular/angular upon request from dev-infra. See: angular/angular@8d11627

@jelbourn
Copy link
Member

jelbourn commented Jun 11, 2019

My concern is that we're adding extra overhead to the CI that should be captured by the container, even at the cost of some convenience

@devversion
Copy link
Member Author

devversion commented Jun 11, 2019

Hmm. I see that point and would personally also prefer not installing it dynamically as Yarn can be provided by a docker image 😄 though we are currently in a weird state where we have different types of tasks:

  1. Tasks using Bazel
  2. Tasks using Bazel + Yarn
  3. Tasks using Yarn

Ideally we'd have one bazel image from gcr.io and one which comes with the appropriate Yarn & NodeJS version, but due to (2) we currently need a docker image that provides both. Also it's planned to remove ngcontainer according to: https://github.com/angular/angular/blob/master/.circleci/config.yml#L754 and https://github.com/angular/angular/tree/master/tools/ngcontainer#ngcontainer.

Another option would be to just use Bazel from Yarn, but it would feel more hermetic if there would be no global NodeJS / Yarn installation at all. Just a plain bazel image to guarantee hermetic behavior.

@alexeagle
Copy link
Contributor

I think you should check in yarn.js in the repo like we did for angular/angular and stop treating it like software that has to be installed on the computer.

@devversion
Copy link
Member Author

That would work too. I don't feel too strong about it. Happy to do whatever you all prefer 😄 I just want to get us to a more recent Yarn version since the current one does not seem to restore the cache properly and big packages like @bazel/bazel or @bazel/buildifier cause flaky CI timeouts (e.g. see here)

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I guess, if we don't have the resources to maintain the docker container

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jun 12, 2019
@mmalerba mmalerba merged commit 57b507b into angular:master Jun 12, 2019
RudolfFrederiksen pushed a commit to RudolfFrederiksen/material2 that referenced this pull request Jun 21, 2019
Currently our version of Yarn is installed through the "angular/ngcontainer"
docker image. This is problematic because in order to be able to update
Yarn, we always need to update the docker image to a version that comes
with the desired Yarn version. Sometimes there is no docker image with the
desired latest Yarn version, and therefore we cannot easily update the Yarn version.

Additionally the latest Yarn versions contain various fixes for debugging timeout
issues and also have improved logic for restoring existing `node_modules`. This
is **essential** to take advantage of the CircleCI caching mechanism.
andrewseguin pushed a commit that referenced this pull request Jul 2, 2019
Currently our version of Yarn is installed through the "angular/ngcontainer"
docker image. This is problematic because in order to be able to update
Yarn, we always need to update the docker image to a version that comes
with the desired Yarn version. Sometimes there is no docker image with the
desired latest Yarn version, and therefore we cannot easily update the Yarn version.

Additionally the latest Yarn versions contain various fixes for debugging timeout
issues and also have improved logic for restoring existing `node_modules`. This
is **essential** to take advantage of the CircleCI caching mechanism.
@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 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants