Visitar URL original
build(docs-infra): use local version of Zone.js when testing against local packages by gkalpak · Pull Request #35780 · angular/angular · GitHub
The Wayback Machine - https://web.archive.org/web/20220321021919/https://github.com/angular/angular/pull/35780
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(docs-infra): use local version of Zone.js when testing against local packages #35780

Closed
wants to merge 4 commits into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Feb 29, 2020 •

In some cases, we want to test the AIO app or docs examples against the locally built Angular packages (for example to ensure that the changes in a commit do not introduce a breaking change). In order to achieve this, we have the ng-packages-installer script that handles updating a project's package.json file to use the locally built Angular packages (and appropriate versions for their (dev-/peer-)dependencies).

Previously, ng-packages-installer would only consider the locally built Angular packages (from dist/packages-dist/). However, given that Zone.js is now part of the angular/angular repo, it makes sense to also use the locally built Zone.js package (from dist/zone.js-dist/). Otherwise, the tests might fail for commits that update both the Angular packages (and related docs examples) and the Zone.js package. An example of such a simultaneous change (that would have broken tests) is #33838.

This commit updates the script to install the locally built Zone.js package (in addition to the Angular ones). The commit ensures that the Zone.js package will always be available alongside the Angular packages (i.e. that the Zone.js package will be built by the same script that builds the Angular packages and that the dist/zone.js-dist/ directory will be cached on CI).

Note: This problem was discovered while enabling docs examples unit tests in #34374.

@mary-poppins
Copy link

@mary-poppins mary-poppins commented Feb 29, 2020

@gkalpak gkalpak force-pushed the build-aio-use-local-zones branch from 8367c72 to cc93ccc Compare Feb 29, 2020
@pullapprove pullapprove bot requested a review from mhevery Feb 29, 2020
@mary-poppins
Copy link

@mary-poppins mary-poppins commented Feb 29, 2020

@gkalpak gkalpak force-pushed the build-aio-use-local-zones branch from cc93ccc to 6fdc27f Compare Feb 29, 2020
@mary-poppins
Copy link

@mary-poppins mary-poppins commented Feb 29, 2020

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Lgtm with a nit.

@@ -0,0 +1,13 @@
#!/usr/bin/env node
Copy link
Contributor

@IgorMinar IgorMinar Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of us have the original path to this file in our muscle memory. Can you please leave a placeholder script in the old location that will error instructing the developers to use the new path?

Also please leave a comment there that the placeholder can be removed two months from now (early May).

gkalpak added 3 commits Mar 4, 2020
This commit moves the build-related scripts
(`build-ivy-npm-packages.js`, `build-packages-dist.js` and
`package-builder.js`) to a dedicated directory to keep the `scripts/`
directory cleaner.

It also moves the logic for building the `zone.js` package to a separate
script, `zone-js-builder.js`, to make it re-usable. A subsequent commit
will use it to build the `zone.js` package when building the Ivy Angular
packages as well.
…al package detection

Previously, `NgPackagesInstaller` would only look for Angular local
packages and do so by listing all (deeply nested) files in
`dist/packages-dist/` and looking for `package.json` files nested two
levels deep (i.e. `dist/packages-dist/*/package.json`). Thus, it would
unnecessarily check a large number of files.

This commit changes the package detection logic to instead look for
a `package.json` file directly inside each subdirectory of
`dist/packages-dist/`, which speeds up the operation.
It also refactors the code to make it easier to look for packages in
other directories (besides `dist/packages-dist/`). This will be useful
in a subsequent commit to look for and use the locally built `zone.js`
package (from `dist/zone.js-dist/`).
…local packages

In some cases, we want to test the AIO app or docs examples against the
locally built Angular packages (for example to ensure that the changes
in a commit do not introduce a breaking change). In order to achieve
this, we have the `ng-packages-installer` script that handles updating
a project's `package.json` file to use the locally built Angular
packages (and appropriate versions for their (dev-/peer-)dependencies).

Previously, `ng-packages-installer` would only consider the locally
built Angular packages (from `dist/packages-dist/`). However, given that
Zone.js is now part of the `angular/angular` repo, it makes sense to
also use the locally built Zone.js package (from `dist/zone.js-dist/`).
Otherwise, the tests might fail for commits that update both the Angular
packages (and related docs examples) and the Zone.js package. An example
of such a simultaneous change (that would have broken tests) is angular#33838.

This commit updates the script to install the locally built Zone.js
package (in addition to the Angular ones). The commit ensures that the
Zone.js package will always be available alongside the Angular packages
(i.e. that the Zone.js package will be built by the same script that
builds the Angular packages and that the `dist/zone.js-dist/` directory
will be cached on CI).

Note: This problem was discovered while enabling docs examples unit
tests in angular#34374.
@gkalpak gkalpak force-pushed the build-aio-use-local-zones branch from 6fdc27f to e4b198a Compare Mar 4, 2020
@gkalpak gkalpak force-pushed the build-aio-use-local-zones branch from e4b198a to 2d9c2f3 Compare Mar 4, 2020
@mary-poppins
Copy link

@mary-poppins mary-poppins commented Mar 4, 2020

@gkalpak gkalpak removed the request for review from mhevery Mar 4, 2020
atscott added a commit that referenced this issue Mar 4, 2020
…al package detection (#35780)

Previously, `NgPackagesInstaller` would only look for Angular local
packages and do so by listing all (deeply nested) files in
`dist/packages-dist/` and looking for `package.json` files nested two
levels deep (i.e. `dist/packages-dist/*/package.json`). Thus, it would
unnecessarily check a large number of files.

This commit changes the package detection logic to instead look for
a `package.json` file directly inside each subdirectory of
`dist/packages-dist/`, which speeds up the operation.
It also refactors the code to make it easier to look for packages in
other directories (besides `dist/packages-dist/`). This will be useful
in a subsequent commit to look for and use the locally built `zone.js`
package (from `dist/zone.js-dist/`).

PR Close #35780
atscott added a commit that referenced this issue Mar 4, 2020
…local packages (#35780)

In some cases, we want to test the AIO app or docs examples against the
locally built Angular packages (for example to ensure that the changes
in a commit do not introduce a breaking change). In order to achieve
this, we have the `ng-packages-installer` script that handles updating
a project's `package.json` file to use the locally built Angular
packages (and appropriate versions for their (dev-/peer-)dependencies).

Previously, `ng-packages-installer` would only consider the locally
built Angular packages (from `dist/packages-dist/`). However, given that
Zone.js is now part of the `angular/angular` repo, it makes sense to
also use the locally built Zone.js package (from `dist/zone.js-dist/`).
Otherwise, the tests might fail for commits that update both the Angular
packages (and related docs examples) and the Zone.js package. An example
of such a simultaneous change (that would have broken tests) is #33838.

This commit updates the script to install the locally built Zone.js
package (in addition to the Angular ones). The commit ensures that the
Zone.js package will always be available alongside the Angular packages
(i.e. that the Zone.js package will be built by the same script that
builds the Angular packages and that the `dist/zone.js-dist/` directory
will be cached on CI).

Note: This problem was discovered while enabling docs examples unit
tests in #34374.

PR Close #35780
atscott added a commit that referenced this issue Mar 4, 2020
This commit moves the build-related scripts
(`build-ivy-npm-packages.js`, `build-packages-dist.js` and
`package-builder.js`) to a dedicated directory to keep the `scripts/`
directory cleaner.

It also moves the logic for building the `zone.js` package to a separate
script, `zone-js-builder.js`, to make it re-usable. A subsequent commit
will use it to build the `zone.js` package when building the Ivy Angular
packages as well.

PR Close #35780
atscott added a commit that referenced this issue Mar 4, 2020
…al package detection (#35780)

Previously, `NgPackagesInstaller` would only look for Angular local
packages and do so by listing all (deeply nested) files in
`dist/packages-dist/` and looking for `package.json` files nested two
levels deep (i.e. `dist/packages-dist/*/package.json`). Thus, it would
unnecessarily check a large number of files.

This commit changes the package detection logic to instead look for
a `package.json` file directly inside each subdirectory of
`dist/packages-dist/`, which speeds up the operation.
It also refactors the code to make it easier to look for packages in
other directories (besides `dist/packages-dist/`). This will be useful
in a subsequent commit to look for and use the locally built `zone.js`
package (from `dist/zone.js-dist/`).

PR Close #35780
atscott added a commit that referenced this issue Mar 4, 2020
…local packages (#35780)

In some cases, we want to test the AIO app or docs examples against the
locally built Angular packages (for example to ensure that the changes
in a commit do not introduce a breaking change). In order to achieve
this, we have the `ng-packages-installer` script that handles updating
a project's `package.json` file to use the locally built Angular
packages (and appropriate versions for their (dev-/peer-)dependencies).

Previously, `ng-packages-installer` would only consider the locally
built Angular packages (from `dist/packages-dist/`). However, given that
Zone.js is now part of the `angular/angular` repo, it makes sense to
also use the locally built Zone.js package (from `dist/zone.js-dist/`).
Otherwise, the tests might fail for commits that update both the Angular
packages (and related docs examples) and the Zone.js package. An example
of such a simultaneous change (that would have broken tests) is #33838.

This commit updates the script to install the locally built Zone.js
package (in addition to the Angular ones). The commit ensures that the
Zone.js package will always be available alongside the Angular packages
(i.e. that the Zone.js package will be built by the same script that
builds the Angular packages and that the `dist/zone.js-dist/` directory
will be cached on CI).

Note: This problem was discovered while enabling docs examples unit
tests in #34374.

PR Close #35780
@gkalpak gkalpak deleted the build-aio-use-local-zones branch Mar 4, 2020
atscott added a commit to atscott/angular that referenced this issue Mar 4, 2020
…against local packages (angular#35780)"

This reverts commit 7d832ae; breaks CI
with error `Concurrent upstream jobs persisted the same file(s) into the workspace:`
atscott added a commit that referenced this issue Mar 4, 2020
…against local packages (#35780)" (#35857)

This reverts commit 7d832ae; breaks CI
with error `Concurrent upstream jobs persisted the same file(s) into the workspace:`

PR Close #35857
atscott added a commit that referenced this issue Mar 4, 2020
…against local packages (#35780)" (#35857)

This reverts commit 7d832ae; breaks CI
with error `Concurrent upstream jobs persisted the same file(s) into the workspace:`

PR Close #35857
gkalpak added a commit to gkalpak/angular that referenced this issue Mar 4, 2020
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Apr 4, 2020

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants