Commit graph

641 commits

Author SHA1 Message Date
Joey Perrott
cc34e5fb07 refactor: migrate scripts to prettier formatting (#53976)
Migrate formatting to prettier for scripts from clang-format

PR Close #53976
2024-01-19 10:22:06 +01:00
Joey Perrott
e12a10256c ci: migrate snapshot publishing from CircleCI to GHA (#51957)
Migrate the snapshot publishing from CircleCI to GHA

PR Close #51957
2023-10-05 10:53:22 -07:00
Pawel Kozlowski
b771539eb3 build: improve results logging in perf script (#51902)
Add git references when printing perf comparison results.

PR Close #51902
2023-09-26 09:09:01 -07:00
Paul Gschwendtner
aaad27b8df build: avoid shallow fetch for benchmark comparison (#50851)
Currently when `yarn benchmarks run-compare` is used, the local
repository could be converted to a shallow clone. This is not
a problem but might result in confusion. We avoid this by
not performing a shallow fetch when a comparison is initiated.

The performance gains seem neglegible.

PR Close #50851
2023-06-26 13:37:38 -07:00
Paul Gschwendtner
bdd8813451 build: print benchmark results at the end of yarn benchmarks run invocation (#50816)
We already collect and report benchmark results for comparison runs, but
for normal benchmark runs we should do the same to make the results
more discoverable (and not in the middle of Bazel output).

PR Close #50816
2023-06-23 14:19:17 -07:00
Paul Gschwendtner
254023a03c build: resolve benchmark compare ref from upstream if rev-parse fails
`rev-parse` returns the original ref name in stdout, even if it wasn't
able to resolve the reference. This was preventing the upstream
resolution from never happening- causing `main` to be never resolved
to the actual SHA.
2023-06-19 15:38:06 +02:00
Paul Gschwendtner
619c318dcb build: fix benchmark sha resolution breaking when compare ref is abbreviated (#50767)
When we fetch e.g. `main`, the branch name will not be available
locally, and `rev-parse` will fail later. We can make the logic
more safe by just using `FETCH_HEAD` then.

PR Close #50767
2023-06-19 13:04:02 +00:00
Paul Gschwendtner
17a95dac22 build: resolve benchmark compare SHA from PR branch or upstream remote (#50764)
If we try to resolve the benchmark compare ref (which may be just
`main`), we are just looking inside the PR branch- but that may
not include the `main` SHA. i.e. it's possible to run a comparison
where the PR is slightly behind of the `main` branch, or a comparison
commit from a different branch is used.

We fix this/ and simplify the logic by resolving the SHAs directly in
the TypeScript code, instead of relying on the rather brittle Bash.

Note that current solution still works, but we sometimes may not be able
to resolve to an actual SHA- causing issues as in 864bd72cb2

PR Close #50764
2023-06-19 12:54:54 +00:00
Paul Gschwendtner
1b3202ca3b build: more concise markdown output for benchmark compare results
We only show the full sample results if someone clicks the markdown
details spoiler button. Most of the time only the stats summary is
relevant.
2023-06-19 14:10:31 +02:00
Paul Gschwendtner
9a01ac3f49 build: add documentation for running benchmarks
Adds documentation for running benchmarks.
2023-06-19 14:10:31 +02:00
Paul Gschwendtner
bb52edee31 build: create script to run benchmarks and perform comparisons (#50745)
This commit creates a new script that solves the following use-cases:

 - Running benchmarks. It's not trivial to figure out the benchmark
   target names, and it's also easy to mess up the right Bazel flags.

 - Performing comparisons. When e.g. working on a runtime senstive
   change, it should be trivial to run benchmarks between the current
   working stage, and a base revision (e.g. `main`).

The script takes care of both these use-cases and comes with a
prompt-based command line tool experience.

The script will also be used by a future GitHub action that can run
comparisons triggered via GitHub PR comment (by trusted team members).

PR Close #50745
2023-06-18 19:32:34 +00:00
Paul Gschwendtner
6ea8e0df2a build: remove unused script from removed components CI job (#50429)
Removes a script that is no longer needed now that we have removed
the components repo CI job from the framework repository.

PR Close #50429
2023-05-23 17:18:27 +00:00
Greg Magolan
34d73019f3 build: start only the minimum number of Saucelabs browsers required (#50393)
This should save on Saucelabs resources so that if only one saucelabs test is run then only one set of browsers will be started.

PR Close #50393
2023-05-23 14:12:28 +00:00
Greg Magolan
51d22fa98d build: address review feedback; should be ready to land now... additional chars to meet commit msg formatting requirements (#49200)
plus more additional chars here

PR Close #49200
2023-05-15 09:21:46 -07:00
Greg Magolan
fd35d9c646 build: address review feedback; added scripts/test/run-saucelabs-tests.sh script for local testing (#49200)
more chars to meet the linters requirements

PR Close #49200
2023-05-15 09:21:46 -07:00
Paul Gschwendtner
71def16598 build: continue publishing @angular/bazel snapshot builds (#49583)
We are no longer publishing Angular Bazel to npm, but we are still
using it in the components repo. We should still publish it to
benefit from e.g. the APF v16 changes.

PR Close #49583
2023-03-24 10:35:31 -07:00
Alex Rickabaugh
c4d2a55c44 test: increase size tracking threshold to 5K / 5% (#49520)
This commit increases the threshold of payload size tracking tests from
500 bytes to 5,000 bytes, and from 1% to 5%. This is done to minimize merge
conflicts while still catching real regressions.

PR Close #49520
2023-03-21 20:30:04 +01:00
Paul Gschwendtner
42619bd670 build: remove puppeteer, remaining usages of webdriver-manager and migrate AIO production test to Bazel (#49025)
This commit does three things that all related and required to get
rid of `webdriver-manager`:

* Our puppeteer protractor setup in AIO relies on webdriver-manager
because we install a corresponding chromedriver based on the puppeteer
chromium version. We would like to get rid of this brittle setup.

* We don't use `puppeteer` in many places because we manage chromium and
the driver through Bazel. This commit removes the remaining puppeteer
usage and replaces it with the Bazel-managed canonical browser

* We need to migrate the AIO production URL tests to Bazel. These
weren't part of Aspect's migration. This is needed so that we can drop
puppeteer and use the Bazel browser setup.

* Migrates some at-runtime TS `ts-node` test setup to proper idiomatic
Bazel code. Needed because it depends on code that also had to be
migrated to Bazel given the production e2e test Bazel migration (above
points).

Note: The xregexp dependency had to be added to the root project because
`ts_library` does not support compilation deps from `@aio_npm`. This is
something we will fix anyway when we have a more modern toolchain!

PR Close #49025
2023-02-10 19:22:18 +00:00
Paul Gschwendtner
865e67fcb4 build: remove unused webdriver-manager code (#49009)
We no longer need webdriver-manager as everything is tested
using Bazel with the Bazel-managed browsers and chrome/gecko drivers.

The drivers and browser binaries are managed as part of dev-infra's
shared browser/driver configuration in `bazel/browsers`.

PR Close #49009
2023-02-10 08:25:58 +01:00
Paul Gschwendtner
5d2e461c3a build: remove components repo unit tests job (#48521)
After discussion initiated in the framework team (by kkostadinov),
the team has decided to not keeping the `components-repo-unit-tests`
job. This commit removes it.

PR Close #48521
2022-12-19 19:50:44 +00:00
Derek Cormier
9d4211e52b build(bazel): fix aio payload test to work with bazel output
Was pointing to legacy build dist folder.
2022-11-22 13:51:16 -07:00
Doug Parker
487ad9d0bb build: add --keep_going to components tests. (#47958)
This configures CI to run all the tests and report all the failures instead of aborting after the first one.

PR Close #47958
2022-11-03 17:52:38 -07:00
Paul Gschwendtner
739e689630 build: setup remote execution through shared command (#47537)
Sets up remote execution through a shared command.

PR Close #47537
2022-10-07 09:31:30 -07:00
Alan Agius
b2aa9ce3e5 build: update puppeteer to 18.0.5 (#47584)
This is needed as Angular does not support Chrome 93.

PR Close #47584
2022-09-30 10:53:04 -07:00
Paul Gschwendtner
b757b1387c build: update dev-infra packages and account for build-tooling split from ng-dev (#46976)
The dev-infra build tooling is now decoupled from `ng-dev`. This will
make it easier to update `ng-dev` without necessarily needing to upgrade
the whole build system, Bazel etc. This is useful when e.g. new release
tool features have been added and should also be ported to active LTS
branches.

PR Close #46976
2022-08-02 09:37:37 -07:00
Angular Robot
2808d889dc build: update dependency firebase-tools to v11 (#46779)
See associated pull request for more information.

PR Close #46779
2022-07-11 21:42:08 +00:00
Paul Gschwendtner
7562421353 ci: do not run firefox components repo tests (#46624)
It seems like the tag for Firefox web tests has changed, and we need to adjust our filter.
PR Close #46624
2022-06-29 12:56:45 -07:00
Joey Perrott
cb452e615f build: remove scripts and documentation about individual usage of RBE (#46515)
As there is little to no usage of RBE by individuals and we don't actively ensure
that the process and permissions are working for individuals the documentation is
best removed from the repo.

PR Close #46515
2022-06-27 10:50:08 -07:00
Joey Perrott
e026a9f174 build: remove the previous release scripts as they are unused (#46516)
With the completed migration to our new release tooling, the previous release
scripts are entirely unused.

PR Close #46516
2022-06-27 10:49:43 -07:00
Paul Gschwendtner
d248d83c17 build: convert release package build scripts to typescript (#46456)
Follow-up to: cce395a928.

PR Close #46456
2022-06-22 14:35:31 -07:00
Paul Gschwendtner
cce395a928 build: load ng-dev release package builder using CJS interop (#46454)
We need to switch the package builder to ESM or TS, like we did
in the components repo, but for now until we can, the release script
should work by loading the package builder CJS through the dynamic
import expression.

PR Close #46454
2022-06-22 09:14:07 -07:00
Paul Gschwendtner
736b5456ea ci: override existing snapshot tag if publish snapshot job is restarted (#46366)
If the snapshot publish job is manually being restarted, the tag in the
snapshot repo might already exist and the job will fail. We can just
forcibly re-create the tag (even if it will be at the same revision).

We use force mode in a couple of other command as well, such as `git
push` of the actual tag and snapshot revision/SHA.

PR Close #46366
2022-06-15 15:57:56 +00:00
Paul Gschwendtner
0bb8c48ae7 build: fix unbound variable error in build artifact script (#46076)
We recently had a couple of issues with the shallowing of snapshot
git repositories. In an attempt to fix this, parts of the publish
script of the COMP repo have been used, but variables have not been
updated properly.

This commit fixes an unbound variable, avoiding errors when snapshots
are published for a new branch (e.g. when we branch-off).

PR Close #46076
2022-05-23 13:26:32 -07:00
Joey Perrott
e1a93e4d7c build: manually unshallow the repo for builds publishing, use absolute paths (#45979)
Use the absolute path for the artifacts directory, as well as encapsulate the clone
vs init logic to prevent it from changing directories.

Manually remove the shallow marker so that git does not recognize this as a shallow repo.

PR Close #45979
2022-05-13 09:07:47 -07:00
Joey Perrott
0db2841ea2 build: use clone instead of init for creating the builds commit changes (#45975)
Rather than using git init to create an empty repo and then shallow fetch the
repo for a specific branch, we shallow clone the repository itself for the branch.
This prevents us from running into the issue of Github denying the push because it
comes from a shallow branch which does not map back to the repository.

PR Close #45975
2022-05-12 20:31:45 +00:00
Joey Perrott
3dcf25b83d build: set the default branch of the ephemeral repo for publishing build artifacts to main (#45974)
It looks like because the primary branch for our ephemeral repos doesn't match the build repos
we are pushing to it causes errors around shallow clones.  This attempts to prevent this.

PR Close #45974
2022-05-12 19:39:36 +00:00
Paul Gschwendtner
949927edda build: remove outdated/obsolete github PR utility scripts (#45868)
Removes scripts and documentation for tools which are no longer
actively used and likely do not work anyway at this point.

All of our PR-related tooling has moved into the `yarn ng-dev` command.
The `PR_REVIEW` markdown file is deleted since it was soley about
the legacy review scripts and the PR review workflow also does not
seem like the common/standard workflow Angular team members follow.

PR Close #45868
2022-05-04 16:29:27 -07:00
Paul Gschwendtner
68a6a075f4 build: clean up references to old master branch (#45856)
Cleans up all references to the `master` branch we renamed to
`main` across Angular.

PR Close #45856
2022-05-04 16:23:33 -07:00
Paul Gschwendtner
0231a363fe build: preparation for primary branch rename in the Angular repos (#45681)
Preparation for the framework repo as outlined our planning
document.

PR Close #45681
2022-04-19 20:19:46 -07:00
Paul Gschwendtner
31434943f1 build: disable payload size uploading within bazel (#45446)
Uploading payload size is unreliable from within Bazel. This is
because tests might not run for every commit, tests might have
been cached from a pull request RBE-build (causing payload uploading
to be skipped most of the time as every change comes from a PR)

We should disable the uploading as this is a fundamental problem
(good thing to note now) that we can solve with better payload
size tracking that we want to establish as part of dev-infra.

PR Close #45446
2022-03-25 16:50:09 -07:00
Paul Gschwendtner
1177b4e2f8 ci: make payload size tracking script work with CircleCI and Bazel limitation (#45444)
For quite some time now, since we started to use Bazel for integration tests, we
relied on some size tracking logic that did not actually fully work under Bazel.

It was thought that all the necessary CI push/PR information is available to the
Bazel test, but that was not the case. This was now fixed with the recent Rules NodeJS
v5 update where I made sure the `env.sh` variables are actually available before we
write them to the temporary file for the Bazel-access.

This now will unveil an issue because payload size goldens would start being based
on their branch name. e.g. the golden key in `13.3.x` should not be `master` but
`13.3.x`. This makes more sense than `master` as key, but makes things more
cumbersome and ideally we would not store the branch name at all (this is a larger
change though -- not worth now since we might refactor this anyway). For now we will
update the size tracking logic to always use `master` as golden key (like it worked
in the past year(s))

With the environment fix we now (again) start uploading payload size results to Firebase.
This did not work by accident either. The uploading logic is reliant on the CircleCI
commit range which is not working/reliable in upstream branches. This commit
removes this reliance on `COMMIT_RANGE` since it's not strictly necessary and
currently breaking renovate PRs. We can re-enable this when we have a solution with
CircleCI, or a workaround/resolution logic provided in e.g. `ng-dev ci determine-commit-range`.

PR Close #45444
2022-03-25 14:25:03 -07:00
Tobias Speicher
4ddcf81e61 refactor: replace deprecated String.prototype.substr() (#45397)
.substr() is deprecated so we replace it with functions which work similarily but aren't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

PR Close #45397
2022-03-24 11:48:09 -07:00
JiaLiPassion
886cfe82d0 ci: components CI test should use local zone.js build (#45277)
CI components test install the angular package from the local
version, but still use the zone.js from npm, so this commit let
components also install zone.js from local too.

PR Close #45277
2022-03-07 11:34:58 -08:00
Kristiyan Kostadinov
30c52ac126 build: add retry logic to postinstall script (#45252)
Several people on the team (myself included) have had issues where the `webdriver-manager` step of the `postinstall` script fails on the first run, but work correctly on the second one.

These changes attempt to simplify the workflow by retrying the script up to 3 times before giving up.

PR Close #45252
2022-03-03 09:13:25 -08:00
Paul Gschwendtner
df50af2bc5 ci: only build test targets for components repo unit test job (#44832)
To speed up the components CI job (avoiding it being a bottleneck in FW),
we will stop building everything in `src/...`, but rather only build targets
which are needed to run all tests within `src/...`.

This notably should avoid unnecessary NPM package building. Arguably that
part would also be valuable to have, but we already test the `ng_package`
rule in FW itself, plus we run snapshot tests in the components repo as well.

PR Close #44832
2022-01-27 09:22:23 -08:00
George Kalpakas
bc5e29592c build: use the latest version of Chrome (v93) in non-bazel tests (#43880)
This commit updates the version of Chrome used in non-bazel tests (via
Puppeteer) to the latest (v93).

PR Close #43880
2021-10-29 13:10:25 -07:00
Joey Perrott
00d801122c build: Use Ivy compiler for bazel builds by default (#43862)
Setting the angular_ivy_enabled environment variable to True will default Bazel builds to use the Ivy
compiler rather than defaulting to ViewEngine.

PR Close #43862
2021-10-19 10:06:54 -07:00
Joey Perrott
9f40d2a0ea ci: remove browserstack configuration (#43881)
Remove browserstack configuration from the repo as it is not used for our CI.

PR Close #43881
2021-10-18 15:00:22 -07:00
Paul Gschwendtner
baf8da0f0f ci: re-enable dev-app building in components-repo-unit-tests job (#43798)
Re-enables the building of the `src/dev-app` package in the components
repo when the components-repo-unit-test job runs. We previously disabled
the dev-app because it was not compatible with template typechecking of
ngtsc. This should be fixed now and can re-enable it.

This could be valuable for having some actual real test scenarios of
type checking.

PR Close #43798
2021-10-12 17:42:46 +00:00
Paul Gschwendtner
167fb2b37f ci: re-enable components-repo-unit-tests job after APF v13 adjustments (#43798)
The APF v13 changes have landed in the `angular/components` repository
so that the CI check can be re-enabled.

PR Close #43798
2021-10-12 17:42:46 +00:00