diff --git a/.bazelversion b/.bazelversion index be57528b92..44d4d72062 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1,3 +1,3 @@ -2.1.1 +3.2.0 # [NB: this comment has to be after the first line, see https://github.com/bazelbuild/bazelisk/issues/117] # When updating the Bazel version you also need to update the RBE toolchains version in package.bzl diff --git a/.circleci/README.md b/.circleci/README.md index 881c43260d..cddaf76fe8 100644 --- a/.circleci/README.md +++ b/.circleci/README.md @@ -12,8 +12,8 @@ We use this as a symmetric AES encryption key to encrypt tokens like a GitHub token that enables publishing snapshots. To create the github_token file, we take this approach: -- Find the angular-builds:token in http://valentine +- Find the angular-builds:token in the internal pw database - Go inside the CircleCI default docker image so you use the same version of openssl as we will at runtime: `docker run --rm -it circleci/node:10.12` - echo "https://[token]:@github.com" > credentials - openssl aes-256-cbc -e -in credentials -out .circleci/github_token -k $KEY -- If needed, base64-encode the result so you can copy-paste it out of docker: `base64 github_token` \ No newline at end of file +- If needed, base64-encode the result so you can copy-paste it out of docker: `base64 github_token` diff --git a/.circleci/bazel.linux.rc b/.circleci/bazel.linux.rc index afb8fd47f1..9ecef0e1c6 100644 --- a/.circleci/bazel.linux.rc +++ b/.circleci/bazel.linux.rc @@ -19,4 +19,12 @@ build --local_ram_resources=14336 # All build executed remotely should be done using our RBE configuration. build:remote --google_default_credentials + +# Upload to GCP's Build Status viewer to allow for us to have better viewing of execution/build +# logs. This is only done on CI as the BES (GCP's Build Status viewer) API requires credentials +# from service accounts, rather than end user accounts. +build:remote --bes_backend=buildeventservice.googleapis.com +build:remote --bes_timeout=30s +build:remote --bes_results_url="https://source.cloud.google.com/results/invocations/" + build --config=remote diff --git a/.circleci/config.yml b/.circleci/config.yml index da85f1baed..3b1267df96 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ var_4_win: &cache_key_win_fallback v7-angular-win-node-12-{{ checksum ".bazelver # Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the # cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable. -var_5: &components_repo_unit_tests_cache_key v7-angular-components-448523bffffecd2b53a3d2854c3051b6b7a3934f +var_5: &components_repo_unit_tests_cache_key v7-angular-components-f428c00465dfcf8a020237f22532480eedbd2cb6 var_6: &components_repo_unit_tests_cache_key_fallback v7-angular-components- # Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and @@ -67,9 +67,6 @@ var_10: &only_on_master # **NOTE 1**: Pin to exact images using an ID (SHA). See https://circleci.com/docs/2.0/circleci-images/#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version. # (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.) # **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix. -# **NOTE 3**: If you change the version of the `*-browsers` docker image, make sure the -# `--versions.chrome` arg in `integration/bazel-schematics/test.sh` specifies a -# ChromeDriver version that is compatible with the Chrome version in the image. executors: default-executor: parameters: @@ -120,7 +117,7 @@ commands: sudo apt-get update # Install GTK+ graphical user interface (libgtk-3-0), advanced linux sound architecture (libasound2) # and network security service libraries (libnss3) & X11 Screen Saver extension library (libssx1) - # which are dependendies of chrome & needed for karma & protractor headless chrome tests. + # which are dependencies of chrome & needed for karma & protractor headless chrome tests. # This is a very small install which takes around 7s in comparing to using the full # circleci/node:x.x.x-browsers image. sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1 @@ -163,7 +160,7 @@ commands: description: Sets up a domain that resolves to the local host. steps: - run: - name: Preparing environment for running tests on Saucelabs. + name: Preparing environment for running tests on Sauce Labs. command: | # For SauceLabs jobs, we set up a domain which resolves to the machine which launched # the tunnel. We do this because devices are sometimes not able to properly resolve @@ -175,13 +172,13 @@ commands: setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev) - run: # Sets up a local domain in the machine's host file that resolves to the local - # host. This domain is helpful in Saucelabs tests where devices are not able to + # host. This domain is helpful in Sauce Labs tests where devices are not able to # properly resolve `localhost` or `127.0.0.1` through the sauce-connect tunnel. name: Setting up alias domain for local host. command: echo "127.0.0.1 $SAUCE_LOCALHOST_ALIAS_DOMAIN" | sudo tee -a /etc/hosts # Normally this would be an individual job instead of a command. - # But startup and setup time for each invidual windows job are high enough to discourage + # But startup and setup time for each individual windows job are high enough to discourage # many small jobs, so instead we use a command for setup unless the gain becomes significant. setup_win: description: Setup windows node environment @@ -380,6 +377,10 @@ jobs: test_aio: executor: default-executor + parameters: + debugArtifactsDir: + type: string + default: aio/dist/size-debug-artifacts steps: - custom_attach_workspace - init_environment @@ -398,6 +399,15 @@ jobs: - run: yarn --cwd aio test-a11y-score-localhost # Check the bundle sizes. - run: yarn --cwd aio payload-size + # When `payload-size` check fails, copy the files that were checked into `debugArtifactsDir`. + - run: + when: on_fail + name: Prepare JS bundles to be stored as artifacts + command: node aio/scripts/prepare-size-debug-artifacts aio << parameters.debugArtifactsDir >> + # Store files in `debugArtifactsDir` (if any) as artifacts for debugging purposes. + - store_artifacts: + path: << parameters.debugArtifactsDir >> + destination: aio # Run unit tests for Firebase redirects - run: yarn --cwd aio redirects-test @@ -413,6 +423,9 @@ jobs: test_aio_local: parameters: + debugArtifactsDir: + type: string + default: aio/dist/size-debug-artifacts viewengine: type: boolean default: false @@ -431,6 +444,15 @@ jobs: - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE # Check the bundle sizes. - run: yarn --cwd aio payload-size aio-local<<# parameters.viewengine >>-viewengine< parameters.viewengine >> + # When `payload-size` check fails, copy the files that were checked into `debugArtifactsDir`. + - run: + when: on_fail + name: Prepare JS bundles to be stored as artifacts + command: node aio/scripts/prepare-size-debug-artifacts aio-local<<# parameters.viewengine >>-viewengine< parameters.viewengine >> << parameters.debugArtifactsDir >> + # Store files in `debugArtifactsDir` (if any) as artifacts for debugging purposes. + - store_artifacts: + path: << parameters.debugArtifactsDir >> + destination: aio test_aio_tools: executor: default-executor @@ -599,8 +621,8 @@ jobs: - run: name: Decrypt github credentials # We need ensure that the same default digest is used for encoding and decoding with - # openssl. Openssl versions might have different default digests which can cause - # decryption failures based on the installed openssl version. https://stackoverflow.com/a/39641378/4317734 + # OpenSSL. OpenSSL versions might have different default digests which can cause + # decryption failures based on the installed OpenSSL version. https://stackoverflow.com/a/39641378/4317734 command: 'openssl aes-256-cbc -d -in .circleci/github_token -md md5 -k "${KEY}" -out ~/.git_credentials' - run: ./scripts/ci/publish-build-artifacts.sh @@ -734,8 +756,8 @@ jobs: - run: yarn --cwd packages/zone.js promisetest - run: yarn --cwd packages/zone.js promisefinallytest - run: yarn bazel build //packages/zone.js:npm_package && - cp dist/bin/packages/zone.js/npm_package/dist/zone-mix.js ./packages/zone.js/test/extra/ && - cp dist/bin/packages/zone.js/npm_package/dist/zone-patch-electron.js ./packages/zone.js/test/extra/ && + cp dist/bin/packages/zone.js/npm_package/bundles/zone-mix.umd.js ./packages/zone.js/test/extra/ && + cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/ && yarn --cwd packages/zone.js electrontest - run: yarn --cwd packages/zone.js jesttest diff --git a/.circleci/env.sh b/.circleci/env.sh index 20cc3e3b2f..88ad302440 100755 --- a/.circleci/env.sh +++ b/.circleci/env.sh @@ -74,7 +74,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo" setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git" setPublicVar COMPONENTS_REPO_BRANCH "master" # **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`. -setPublicVar COMPONENTS_REPO_COMMIT "448523bffffecd2b53a3d2854c3051b6b7a3934f" +setPublicVar COMPONENTS_REPO_COMMIT "f428c00465dfcf8a020237f22532480eedbd2cb6" #################################################################################################### diff --git a/.circleci/trigger-webhook.js b/.circleci/trigger-webhook.js index 77860186bc..88c1b700dc 100644 --- a/.circleci/trigger-webhook.js +++ b/.circleci/trigger-webhook.js @@ -60,14 +60,15 @@ if (require.resolve === module) { // Helpers function _main(args) { - triggerWebhook(...args). - then(({statusCode, responseText}) => (200 <= statusCode && statusCode < 400) ? - console.log(`Status: ${statusCode}\n${responseText}`) : - Promise.reject(new Error(`Request failed (status: ${statusCode}): ${responseText}`))). - catch(err => { - console.error(err); - process.exit(1); - }); + triggerWebhook(...args) + .then( + ({statusCode, responseText}) => (200 <= statusCode && statusCode < 400) ? + console.log(`Status: ${statusCode}\n${responseText}`) : + Promise.reject(new Error(`Request failed (status: ${statusCode}): ${responseText}`))) + .catch(err => { + console.error(err); + process.exit(1); + }); } function postJson(url, data) { @@ -77,15 +78,12 @@ function postJson(url, data) { const statusCode = res.statusCode || -1; let responseText = ''; - res. - on('error', reject). - on('data', d => responseText += d). - on('end', () => resolve({statusCode, responseText})); + res.on('error', reject) + .on('data', d => responseText += d) + .on('end', () => resolve({statusCode, responseText})); }; - request(url, opts, onResponse). - on('error', reject). - end(JSON.stringify(data)); + request(url, opts, onResponse).on('error', reject).end(JSON.stringify(data)); }); } diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.md b/.github/ISSUE_TEMPLATE/1-bug-report.md index 1424df5367..39b3eb6862 100644 --- a/.github/ISSUE_TEMPLATE/1-bug-report.md +++ b/.github/ISSUE_TEMPLATE/1-bug-report.md @@ -32,13 +32,13 @@ Existing issues often contain information about workarounds, resolution, or prog ## 🔬 Minimal Reproduction https://stackblitz.com/... -
For more details on how a library project is structured you can refer the Library Project Files
-要了解关于库项目结构的更多信息,参见库项目文件。
-You can use the monorepo model to use the same workspace for multiple projects. See Setting up for a multi-project workspace.
-你可以使用单一仓库(monorepo)模式将同一个工作空间用于多个项目。请参见设置多项目工作区。
+ + For more details on how a library project is structured, refer to the [Library project files](guide/file-structure#library-project-files) section of the [Project File Structure guide](guide/file-structure). + + 要了解关于库项目的目录结构的详细信息,参见[项目文件结构](guide/file-structure)中的[库项目文件](guide/file-structure#library-project-files)部分。 + + You can use the monorepo model to use the same workspace for multiple projects. + See [Setting up for a multi-project workspace](guide/file-structure#multiple-projects). + + 你可以使用单一仓库(monorepo)模式将同一个工作空间用于多个项目。参见[建立多项目型工作区](guide/file-structure#multiple-projects)。 +