From 76190c71fc7d924867967ac0bcabef46ea278af5 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Mon, 6 Apr 2020 09:42:02 -0700 Subject: [PATCH] ci: migrate payload size tracking goldens to the golden directory (#36455) This change is part of a larger effort to migrate all golden type tracking files to a single location. Additionally, this makes it a bit easier to manage file ownership in pullapprove. PR Close #36455 --- .pullapprove.yml | 3 +-- aio/scripts/payload.sh | 2 +- goldens/BUILD.bazel | 4 ++++ .../size-tracking/aio-payloads.json | 0 .../size-tracking/integration-payloads.json | 0 integration/BUILD.bazel | 4 ---- integration/angular_integration_test.bzl | 4 ++-- integration/cli-hello-world-lazy-rollup/README.md | 2 +- integration/cli-hello-world-lazy/README.md | 2 +- 9 files changed, 10 insertions(+), 11 deletions(-) rename aio/scripts/_payload-limits.json => goldens/size-tracking/aio-payloads.json (100%) rename integration/_payload-limits.json => goldens/size-tracking/integration-payloads.json (100%) diff --git a/.pullapprove.yml b/.pullapprove.yml index 96fc749d04..2c922dbabb 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -1031,8 +1031,7 @@ groups: - *can-be-global-approved - > contains_any_globs(files, [ - 'aio/scripts/_payload-limits.json', - 'integration/_payload-limits.json' + 'goldens/size-tracking/**' ]) reviewers: users: diff --git a/aio/scripts/payload.sh b/aio/scripts/payload.sh index 51606ba9f4..96667f7913 100755 --- a/aio/scripts/payload.sh +++ b/aio/scripts/payload.sh @@ -12,4 +12,4 @@ source ../scripts/ci/payload-size.sh # Provide node_modules from aio NODE_MODULES_BIN=$PROJECT_ROOT/aio/node_modules/.bin/ -trackPayloadSize "$target" "dist/*.js" true "${thisDir}/_payload-limits.json" +trackPayloadSize "$target" "dist/*.js" true "$PROJECT_ROOT/goldens/size-tracking/aio-payloads.json" diff --git a/goldens/BUILD.bazel b/goldens/BUILD.bazel index 00320ff634..5ce0cc2a75 100644 --- a/goldens/BUILD.bazel +++ b/goldens/BUILD.bazel @@ -1,5 +1,9 @@ package(default_visibility = ["//visibility:public"]) +exports_files([ + "size-tracking/integration-payloads.json", +]) + filegroup( name = "public-api", srcs = glob([ diff --git a/aio/scripts/_payload-limits.json b/goldens/size-tracking/aio-payloads.json similarity index 100% rename from aio/scripts/_payload-limits.json rename to goldens/size-tracking/aio-payloads.json diff --git a/integration/_payload-limits.json b/goldens/size-tracking/integration-payloads.json similarity index 100% rename from integration/_payload-limits.json rename to goldens/size-tracking/integration-payloads.json diff --git a/integration/BUILD.bazel b/integration/BUILD.bazel index 74e9f3a5cf..13201362f9 100644 --- a/integration/BUILD.bazel +++ b/integration/BUILD.bazel @@ -1,9 +1,5 @@ load(":angular_integration_test.bzl", "angular_integration_test") -exports_files([ - "_payload-limits.json", -]) - # Some integration ports must be managed manually to be unique and in other # cases the tests are able to select a random free port. # diff --git a/integration/angular_integration_test.bzl b/integration/angular_integration_test.bzl index 93304e2e91..8800251e80 100644 --- a/integration/angular_integration_test.bzl +++ b/integration/angular_integration_test.bzl @@ -108,10 +108,10 @@ def _angular_integration_test(name, **kwargs): elif commands == "payload_size_tracking": commands = DEFAULT_COMMANDS + [ "$(rootpath @nodejs//:yarn_bin) build", - "$(rootpath //:scripts/ci/track-payload-size.sh) %s dist/*.js true ${RUNFILES}/angular/$(rootpath //integration:_payload-limits.json)" % name, + "$(rootpath //:scripts/ci/track-payload-size.sh) %s dist/*.js true ${RUNFILES}/angular/$(rootpath //goldens:size-tracking/integration-payloads.json)" % name, ] data = data + [ - "//integration:_payload-limits.json", + "//goldens:size-tracking/integration-payloads.json", "//:scripts/ci/track-payload-size.sh", "//:scripts/ci/payload-size.sh", "//:scripts/ci/payload-size.js", diff --git a/integration/cli-hello-world-lazy-rollup/README.md b/integration/cli-hello-world-lazy-rollup/README.md index 22f916e642..be39b9fed1 100644 --- a/integration/cli-hello-world-lazy-rollup/README.md +++ b/integration/cli-hello-world-lazy-rollup/README.md @@ -2,4 +2,4 @@ This test checks bundle sizes when there is a lazy module and experimentalRollupPass is used. It also checks if the `ngDevMode` global variable and string references in `packages/core/src/util/ng_dev_mode.ts` are correctly removed. -This test contains a lazy route to ensure `ngDevMode` removal happens even across chunks, and a payload size check in `../_payload-limits.json` to ensure extra code is not retained accidentally. +This test contains a lazy route to ensure `ngDevMode` removal happens even across chunks, and a payload size check in `/goldens/size-tracking/integration-payloads.json` to ensure extra code is not retained accidentally. diff --git a/integration/cli-hello-world-lazy/README.md b/integration/cli-hello-world-lazy/README.md index f8e10dda76..9778a30bb2 100644 --- a/integration/cli-hello-world-lazy/README.md +++ b/integration/cli-hello-world-lazy/README.md @@ -2,4 +2,4 @@ This test checks bundle sizes when there is a lazy module. It also checks if the `ngDevMode` global variable and string references in `packages/core/src/util/ng_dev_mode.ts` are correctly removed. -This test contains a lazy route to ensure `ngDevMode` removal happens even across chunks, and a payload size check in `../_payload-limits.json` to ensure extra code is not retained accidentally. +This test contains a lazy route to ensure `ngDevMode` removal happens even across chunks, and a payload size check in `/goldens/size-tracking/integration-payloads.json` to ensure extra code is not retained accidentally.