Skip to content

Commit a3e68b3

Browse files
committed
Merge branch 'master' of github.com:angular/components into giorag/chip-list-focus-last-chip-on-backspace-v2
2 parents f15c7a0 + 70ff528 commit a3e68b3

File tree

2,309 files changed

+98847
-19188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,309 files changed

+98847
-19188
lines changed

.bazelrc

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@ query --output=label_kind
3737
# By default, failing tests don't print any output, it goes to the log file
3838
test --test_output=errors
3939

40-
#################################
41-
# Release configuration. #
42-
# Run with "--config=release" #
43-
#################################
40+
####################################
41+
# Stamping configurations. #
42+
# Run with "--config=release" or #
43+
# "--config=snapshot-build". #
44+
####################################
4445

4546
# Configures script to do version stamping.
4647
# See https://docs.bazel.build/versions/master/user-manual.html#flag--workspace_status_command
4748
build:release --workspace_status_command="node ./tools/bazel-stamp-vars.js"
4849
build:release --stamp
4950

51+
build:snapshot-build --workspace_status_command="node ./tools/bazel-stamp-vars.js --snapshot"
52+
build:snapshot-build --stamp
53+
5054
################################
5155
# View Engine / Ivy toggle #
5256
################################
@@ -77,7 +81,6 @@ build:remote --host_cpu=k8
7781
# Setup the remote build execution servers.
7882
build:remote --remote_cache=remotebuildexecution.googleapis.com
7983
build:remote --remote_executor=remotebuildexecution.googleapis.com
80-
build:remote --tls_enabled=true
8184
build:remote --auth_enabled=true
8285

8386
# Setup the toolchain and platform for the remote build execution. The platform
@@ -92,10 +95,18 @@ build:remote --host_platform=//tools:rbe_platform
9295
build:remote --platforms=//tools:rbe_platform
9396
build:remote --extra_toolchains=@rbe_default//config:cc-toolchain
9497

95-
# Setup Build Event Service
96-
build:remote --bes_backend=buildeventservice.googleapis.com
97-
build:remote --bes_timeout=30s
98-
build:remote --bes_results_url="https://source.cloud.google.com/results/invocations/"
98+
################################
99+
# --config=build-results #
100+
################################
101+
102+
# Sets up Build Event Service if the `builds-results` configuration is used. We
103+
# do not upload build results by default as this makes us reliant on external servers
104+
# that could cause builds to fail unnecessarily. If desired, build result uploading
105+
# can be manually uploaded, but given that the build event service server has been
106+
# less stable than the remote executors, we do not want to degrade CI stability.
107+
build:build-results --bes_backend=buildeventservice.googleapis.com
108+
build:build-results --bes_timeout=60s
109+
build:build-results --bes_results_url="https://source.cloud.google.com/results/invocations/"
99110

100111
# Set remote caching settings
101112
build:remote --remote_accept_cached=true

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.0
1+
4.0.0

.circleci/config.yml

Lines changed: 97 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ var_5: &job_defaults
2626
docker:
2727
- image: *docker_image
2828

29-
# Job step for checking out the source code from GitHub. This also ensures that the source code
30-
# is rebased on top of master.
31-
var_6: &checkout_code
32-
checkout:
33-
# After checkout, rebase on top of master. By default, PRs are not rebased on top of master,
34-
# which we want. See https://discuss.circleci.com/t/1662
35-
post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
36-
3729
# Restores the cache that could be available for the current Yarn lock file. The cache usually
3830
# includes the node modules and the Bazel repository cache.
3931
var_7: &restore_cache
@@ -143,19 +135,50 @@ var_21: &slack_notify_on_failure
143135
run:
144136
name: "Notifying team about job failure"
145137
when: on_fail
146-
command: ./scripts/circleci/notify-slack-job-failure.sh
138+
command: node ./scripts/circleci/notify-slack-job-failure.js
147139

148140
# -----------------------------
149141
# Container version of CircleCI
150142
# -----------------------------
151143
version: 2.1
152144

145+
# Configures CircleCI orbs for this pipeline. Orbs allow consumption of publicly shared
146+
# CircleCI commands, jobs, configuration elements or executors. Read more about orbs here:
147+
# https://circleci.com/docs/2.0/orb-intro/
148+
orbs:
149+
# Set up the `queue` orb that allows us to queue up builds across jobs. We use it
150+
# to make sure that snapshot builds are not deployed out of order, resulting in Git
151+
# push conflicts.
152+
queue: eddiewebb/queue@1.5.0
153+
154+
155+
commands:
156+
checkout_and_rebase:
157+
description: Checkout and rebase the repository
158+
steps:
159+
- checkout
160+
- run:
161+
name: Set up environment
162+
environment:
163+
CIRCLE_GIT_BASE_REVISION: << pipeline.git.base_revision >>
164+
CIRCLE_GIT_REVISION: << pipeline.git.revision >>
165+
command: ./.circleci/env.sh
166+
- run:
167+
name: Rebase PR on target branch
168+
# After checkout, rebase on top of target branch.
169+
command: |
170+
if [ -n "$CIRCLE_PR_NUMBER" ]; then
171+
# User is required for rebase.
172+
git config user.name "angular-ci"
173+
git config user.email "angular-ci"
174+
node .circleci/rebase-pr.js
175+
fi
176+
153177
# -----------------------------------------------------------------------------------------
154178
# Job definitions. Jobs which are defined just here, will not run automatically. Each job
155179
# must be part of a workflow definition in order to run for PRs and push builds.
156180
# -----------------------------------------------------------------------------------------
157181
jobs:
158-
159182
# -----------------------------------
160183
# Job to test that everything builds with Bazel
161184
# -----------------------------------
@@ -165,7 +188,7 @@ jobs:
165188
environment:
166189
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
167190
steps:
168-
- *checkout_code
191+
- checkout_and_rebase
169192
- *restore_cache
170193
- *setup_bazel_ci_config
171194
- *setup_bazel_remote_execution
@@ -187,7 +210,7 @@ jobs:
187210
environment:
188211
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
189212
steps:
190-
- *checkout_code
213+
- checkout_and_rebase
191214
- *restore_cache
192215
- *setup_bazel_ci_config
193216
- *setup_bazel_remote_execution
@@ -209,7 +232,7 @@ jobs:
209232
environment:
210233
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
211234
steps:
212-
- *checkout_code
235+
- checkout_and_rebase
213236
- *restore_cache
214237
- *setup_bazel_ci_config
215238
- *setup_bazel_remote_execution
@@ -228,14 +251,17 @@ jobs:
228251
environment:
229252
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
230253
steps:
231-
- *checkout_code
254+
- checkout_and_rebase
232255
- *restore_cache
233256
- *setup_bazel_ci_config
234257
- *setup_bazel_remote_execution
235258
- *yarn_install
236259
- *setup_bazel_binary
237260

238-
- run: bazel test src/... --build_tag_filters=e2e --test_tag_filters=e2e --build_tests_only
261+
# Run e2e tests. Note that protractor test targets are flaky sometimes, so we run them
262+
# with flaky test attempts. This means that Bazel will re-run a failed e2e test target
263+
# a second time to ensure it's a real test failure. This improves CI stability.
264+
- run: yarn e2e --flaky_test_attempts=2
239265
- *slack_notify_on_failure
240266

241267
# ------------------------------------------------------------------------------------------
@@ -248,7 +274,7 @@ jobs:
248274
environment:
249275
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
250276
steps:
251-
- *checkout_code
277+
- checkout_and_rebase
252278
- *restore_cache
253279
- *setup_bazel_ci_config
254280
- *setup_bazel_remote_execution
@@ -269,7 +295,7 @@ jobs:
269295
BROWSER_STACK_USERNAME: "angularteam1"
270296
BROWSER_STACK_ACCESS_KEY: "CaXMeMHD9pr5PHg8N7Jq"
271297
steps:
272-
- *checkout_code
298+
- checkout_and_rebase
273299
- *restore_cache
274300
- *setup_bazel_ci_config
275301
- *yarn_install
@@ -291,7 +317,7 @@ jobs:
291317
# a rate limit exception.
292318
KARMA_PARALLEL_BROWSERS: 2
293319
steps:
294-
- *checkout_code
320+
- checkout_and_rebase
295321
- *restore_cache
296322
- *setup_bazel_ci_config
297323
- *yarn_install
@@ -304,8 +330,11 @@ jobs:
304330
# ----------------------------------
305331
lint:
306332
<<: *job_defaults
333+
environment:
334+
CI_GIT_BASE_REVISION: << pipeline.git.base_revision >>
335+
CI_GIT_REVISION: << pipeline.git.revision >>
307336
steps:
308-
- *checkout_code
337+
- checkout_and_rebase
309338
- *restore_cache
310339
- *setup_bazel_ci_config
311340
- *yarn_install
@@ -324,10 +353,20 @@ jobs:
324353
yarn check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
325354
326355
- run: yarn ng-dev format changed --check << pipeline.git.base_revision >>
356+
- run:
357+
name: Check Commit Message (PR Only)
358+
# Only run the commit message checks on pull requests since we can't do
359+
# much about any failures that have made it into the main branch.
360+
command: |
361+
if [ -n "$CIRCLE_PR_NUMBER" ]; then
362+
yarn ng-dev commit-message validate-range --range $CI_COMMIT_RANGE
363+
fi
327364
- run: yarn ownerslint
365+
- run: yarn check-mdc-tests
328366
- run: yarn stylelint
329367
- run: yarn tslint
330368
- run: yarn -s ts-circular-deps:check
369+
- run: yarn check-mdc-exports
331370

332371
- *slack_notify_on_failure
333372
- *save_cache
@@ -342,15 +381,23 @@ jobs:
342381
environment:
343382
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
344383
steps:
345-
- *checkout_code
384+
- checkout_and_rebase
346385
- *restore_cache
347386
- *setup_bazel_ci_config
348387
- *setup_bazel_remote_execution
349388
- *yarn_install
350389
- *setup_bazel_binary
351390

352391
- run: yarn build
353-
- run: yarn check-release-output
392+
- run:
393+
name: Checking release output
394+
command: |
395+
pkg_json_version=$(node -pe "require('./package.json').version")
396+
expected_version="${pkg_json_version}-sha-$(git rev-parse --short HEAD)"
397+
yarn check-release-output ${expected_version}
398+
- run:
399+
name: Checking tooling scripts
400+
command: yarn check-tools
354401

355402
# TODO(devversion): replace this with bazel tests that run Madge. This is
356403
# cumbersome and doesn't guarantee no circular deps for other entry-points.
@@ -389,7 +436,7 @@ jobs:
389436
upload_release_packages:
390437
<<: *job_defaults
391438
steps:
392-
- *checkout_code
439+
- checkout_and_rebase
393440
- *restore_cache
394441
- *attach_release_output
395442
- *yarn_install
@@ -410,7 +457,7 @@ jobs:
410457
environment:
411458
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
412459
steps:
413-
- *checkout_code
460+
- checkout_and_rebase
414461
- *restore_cache
415462
- *attach_release_output
416463
- *setup_bazel_ci_config
@@ -426,7 +473,18 @@ jobs:
426473
# The components examples package is not a release package, but we publish it
427474
# as part of this job to the docs-content repository. It's not contained in the
428475
# attached release output, so we need to build it here.
429-
- run: bazel build src/components-examples:npm_package --config=release
476+
- run: yarn build-docs-content
477+
478+
# Ensures that we do not push the snapshot artifacts upstream until all previous
479+
# snapshot build jobs have completed. This helps avoiding conflicts when multiple
480+
# commits have been pushed (resulting in multiple concurrent snapshot publish jobs).
481+
# We increase the confidence threshold so that it queries the CircleCI API a second time
482+
# after a delay. We do this as the CircleCI API does not refresh immediately when a job
483+
# completes/starts, and this will improve stability of the queue step. See source:
484+
# https://github.com/eddiewebb/circleci-queue/commit/5d42add5bbcff5e8ac7fe189448a61fea98b0839.
485+
- queue/until_front_of_line:
486+
confidence: "2"
487+
430488
- run: ./scripts/circleci/publish-snapshots.sh
431489
- *slack_notify_on_failure
432490

@@ -437,7 +495,7 @@ jobs:
437495
<<: *job_defaults
438496
resource_class: xlarge
439497
steps:
440-
- *checkout_code
498+
- checkout_and_rebase
441499
- *restore_cache
442500
- *attach_release_output
443501
- *yarn_install
@@ -461,7 +519,7 @@ jobs:
461519
<<: *job_defaults
462520
resource_class: xlarge
463521
steps:
464-
- *checkout_code
522+
- checkout_and_rebase
465523
- *restore_cache
466524
- *attach_release_output
467525
- *setup_snapshot_builds
@@ -488,7 +546,7 @@ jobs:
488546
environment:
489547
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
490548
steps:
491-
- *checkout_code
549+
- checkout_and_rebase
492550
- *restore_cache
493551
- *setup_bazel_ci_config
494552
- *setup_bazel_remote_execution
@@ -509,7 +567,7 @@ jobs:
509567
environment:
510568
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
511569
steps:
512-
- *checkout_code
570+
- checkout_and_rebase
513571
- *restore_cache
514572
- *setup_bazel_ci_config
515573
- *setup_bazel_remote_execution
@@ -529,7 +587,7 @@ jobs:
529587
environment:
530588
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
531589
steps:
532-
- *checkout_code
590+
- checkout_and_rebase
533591
- *restore_cache
534592
- *setup_bazel_ci_config
535593
- *setup_bazel_remote_execution
@@ -550,13 +608,20 @@ jobs:
550608
environment:
551609
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
552610
steps:
553-
- *checkout_code
611+
- checkout_and_rebase
554612
- *restore_cache
555613
- *setup_bazel_ci_config
556614
- *setup_bazel_remote_execution
557615
- *yarn_install
558616
- *setup_bazel_binary
559-
- run: yarn integration-tests
617+
# TODO: Re-enable when there are integration tests that should run with Ivy.
618+
# Currently this command fails as there are no tests.
619+
# - run: yarn integration-tests
620+
- run:
621+
name: Running size integration tests (failures are reported in Slack only).
622+
command: |
623+
# If the size integration tests fail, report the failure to a dedicated #components-ci-size-tracking Slack channel.
624+
yarn integration-tests:size-test || node ./scripts/circleci/notify-slack-job-failure.js components-ci-size-tracking
560625
- run: yarn integration-tests:view-engine
561626
- *slack_notify_on_failure
562627

@@ -569,7 +634,7 @@ jobs:
569634
environment:
570635
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
571636
steps:
572-
- *checkout_code
637+
- checkout_and_rebase
573638
- *restore_cache
574639
- *setup_bazel_binary
575640
- *setup_bazel_ci_config

0 commit comments

Comments
 (0)