Commit Graph

18 Commits

Author SHA1 Message Date
George Kalpakas 9b5299131b ci: remove change type from uploaded payload size data (#33987)
The change type was only recorded for `aio/` and was not correct anyway.
For example:
- It considered `package.json` changes as `application` (even if only
  `package.json` and `yarn.lock` had changed).
- It failed to account for changes in `@angular/*` dependencies, when
  using the locally built Angular packages (instead reporting them as
  `other`).
- It only looked at the last commit, so it failed to provide accurate
  information for multi-commit builds (which are rare, but possible).

For the above reasons (and because there is no straight-forward way of
fixing it), this commit removes the change type from the uploaded data.
If necessary, it is still possible to find the type of changes from the
uploaded info (e.g. extract the associated commits and look at their
changes using git).

PR Close #33987
2019-11-25 16:36:07 -05:00
George Kalpakas 9bc8864d03 ci: always track and check payload size data for angular.io (#33987)
As part of the `payload-size` npm script in `aio/package.json` (which is
run on CI), the sizes of the angular.io app bundles are checked to
ensure they do not exceed certain limits and are also uploaded to
Firebase to be available for later analysis. The uploaded data include
the type of the changes (dependencies only, application only, or both).
The type of changes is inferred by looking at the files that have
changed inside the `aio/` directory.

When the `payload-size.sh` script was first introduced, the only files
that could affect bundle sizes were inside the `aio/` directory.
Therefore, the script would skip uploading the data and checking the
sizes if no changes were detected inside the `aio/` directory.

However, this assumption stopped being valid over time. For example:
- We started tracking/checking bundle sizes when building the angular.io
  app with the locally built Angular packages (which live outside the
  `aio/` directory.
- Due to CircleCI limitations, the `CI_COMMIT_RANGE` environment
  variable (which is used for determining what files have been affected)
  stopped reflecting the whole commit range of the build and only
  included the last commit instead.

Based on the above, there were many cases were size data would not be
uploaded to Firebase, even when they may have been affected (because the
affecting changes were outside `aio/` - e.g. in framework packages).
This makes it harder to analyze size regressions, because important
data-points are missing.

Even worse, in these cases, the sizes were not even checked against the
specified limits, thus making it possible for size regressions to go
unnoticed (unless caught by other similar tests).

This commit fixes the `scripts/ci/payload-size.sh` script to always
track and check payload sizes for angular.io bundles.

NOTE: This change will result in more data being recorded (i.e.
      recording data when it is not possible for the bundle sizes to
      have been affected by the changes). This is still preferable to
      failing to record and/or check when sizes could have been
      affected.

PR Close #33987
2019-11-25 16:36:07 -05:00
George Kalpakas b6dfc8b08c ci: log calculated file sizes for each build (#33099)
The `payload-size.sh` script is mainly used on CI to calculate, check
and potentially save (on non-PR builds) the sizes of the bundles for
various apps (including angular.io). If everything goes well (i.e. the
checks pass, meaning that the sizes did not increase above the specified
threshold) nothing is shown in the CI logs.

In some cases, it is useful to be able to see what the sizes were in a
specific build; e.g. for debugging purposes or when investigating a
gradual increase that happened over time. (Some of this info is
available on https://size.angular.io/, but not all.)

Previously, the only way to find out what the sizes were for a specific
build was to checkout the corresponding commit locally and build the
target app, which in turn requires building all Angular packages and can
take some time. Given that the sizes are already calculated on CI, this
was a waste.

This commit makes it easy to find out the bundle sizes for a specific
build/commit by always printing out the calculated sizes (thus making
them show up in the CI logs).

PR Close #33099
2019-10-15 16:48:29 +00:00
George Kalpakas b5eda603a2 ci: work around `CIRCLE_COMPARE_URL` not being available wih CircleCI Pipelines (#32537)
The commit range that is associated with a CI build is used for a couple
of things (mostly related to payload-size tracking):
- Determine whether a size change was caused by application code or
  dependencies (or both).
- Add the messages of the commits associated with the build (and thus
  the payload-size change).

NOTE: The commit range is only used on push builds.

Previously, the commit range was computed based on the
`CIRCLE_COMPARE_URL` environment variable. With [CircleCI Pipelines][1]
enabled, `CIRCLE_COMPARE_URL` is no longer available and the commit
range cannot be reliably detected.

This commit switches `CI_COMMIT_RANGE` to only include the last commit.
This can be less accurate in some rare cases, but is true in the
majority of cases (on push builds). Additionally, it stores the CircleCI
build URL in the database along with the payload data, so the relevant
info can be retrieved when needed.

[1]: https://circleci.com/docs/2.0/build-processing

PR Close #32537
2019-09-09 12:21:44 -04:00
George Kalpakas 4c45aa39e4 ci: re-enable payload size tracking (#31138)
Payload size tracking was temporarily disabled in #31057, due to
`CIRCLE_COMPARE_URL` stopping being available. It turned out this was
related to turning on the new [Pipelines][1] feature, which was required
for testing Windows on CircleCI.

Since then, we have turned `Pipelines` off and got `CIRCLE_COMPARE_URL`
back (e.g. see [build 362971][2]). According to CircleCI, failing to
populate `CIRCLE_COMPARE_URL` with `Pipelines` on is a bug and they are
working on fixing it.

[1]: https://circleci.com/docs/2.0/build-processing/
[2]: https://circleci.com/gh/angular/angular/362971

Fixes #31121

PR Close #31138
2019-06-19 15:55:10 -07:00
George Kalpakas 48d11d5fa0 ci: temporarily disable payload size tracking (#31057)
The `CIRCLE_COMPARE_URL` is not available in builds any more since we
enabled `Pipelines` on CircleCI. We have contected CircleCI, but until
this is solved we cannot get the commit range and thus disabling
uploading of payload size data to avoid broken builds.

PR Close #31057
2019-06-14 09:19:17 -07:00
Paul Gschwendtner c7d1890aaa build: remove travisci leftovers (#27979)
PR Close #27979
2019-01-09 10:41:16 -08:00
George Kalpakas 5e2ce9b2a6 build: clean up `*.gz` files created by `payload-size.sh` (#26746)
These files are not needed once the size has been calculated and there
is no point in keeping them around.

Deleting them prevents, for example, uploading unnecessary files from
`aio/dist/` to Firebase (because `deploy-to-firebase.sh` runs the
payload size checks right before deploying).

PR Close #26746
2018-10-25 21:17:52 -04:00
George Kalpakas 9b8a244a15 ci: fix `payload-size.sh` (#26377)
PR Close #26377
2018-10-23 14:35:38 -07:00
George Kalpakas 3b24e0edb6 build: use CI-provider independent variable names (#26377)
PR Close #26377
2018-10-23 14:35:37 -07:00
Igor Minar 7e8cee6b61 build: fix aio size tracking, we need to use node_modules local to aio (#23328)
This fixes an issue introduced by 4f0cae0676 which removed firebase from the root node_modules.

PR Close #23328
2018-04-11 23:14:23 -07:00
Yuan Gao e7cdb9f660 ci(core): Improve the payload size message (#20786)
PR Close #20786
2017-12-05 21:46:10 -08:00
George Kalpakas 7e7ff2e0aa ci: fix the payload-size checking scripts (#20683)
The scripts were accidentally broken in #20524. More specifically, when a limit
was exceeded the script would break while trying to log an error message due to
a missing `commit` variable.
This commit fixes it and also does some minor clean-up (improve docs, use more
descriptive variable names, remove dead code, etc).

PR Close #20683
2017-12-04 14:52:15 -08:00
tinayuangao ac93f1235e ci: Update 1% payload size test (#20524)
PR Close #20524
2017-11-21 22:28:28 -06:00
tinayuangao f7c9b941cb ci(aio): Add payload size percentage changes check to payload size task (#19908) 2017-11-03 15:20:09 -07:00
George Kalpakas 23f2bea353 ci(aio): correctly serialize commit messages with "double-quotes" (#19183)
PR Close #19183
2017-09-19 17:00:22 -07:00
Misko Hevery 3d2ee6c3fe build: fix build; missing firebase-tools 2017-08-25 08:17:13 -07:00
Yuan Gao 4eb1f91bee ci(aio): Refactored payload size script, add script to track payload (#18517)
PR Close #18517
2017-08-18 22:27:38 -05:00