Commit Graph

311 Commits

Author SHA1 Message Date
Joey Perrott e1c5cea2e7 fix(dev-infra): set the default LogLevel of GitClient logging to DEBUG (#41899)
Previously by default GitClient would log the commands it was executing at the
INFO level. This change moves the default level of this logging to DEBUG, while
still allowing callers of the methods to set the log level back to INFO.

PR Close #41899
2021-05-07 10:15:20 -04:00
Joey Perrott 4d7294d9f7 feat(dev-infra): include release notes in Github release entries when publishing (#41964)
Include the release notes entry for the release in the release created on Github.

PR Close #41964
2021-05-06 15:45:48 -04:00
Joey Perrott 393ce94718 feat(dev-infra): Set up new common release notes generation tooling (#41905)
Enables the new common release notes generation within the ng-dev release publishing
tooling.

PR Close #41905
2021-05-06 09:40:29 -04:00
Paul Gschwendtner 530e45f093 fix(dev-infra): publish script python check not working on windows (#41943)
We recently added a sanity check that ensures that `python` is
available for Bazel. The check relies on `/usr/bin/python` to check
if python is available w/ the correct version. The problem is
that on Windows there is no guarantee that the `/usr/bin` folder
exists, so the `ng-dev release publish` command always fails.

We fix this by just accessing the `env` binary that is also consulted
by scripts executed within Bazel actions. The `env` binary can be
assumed exist in the shell's `$PATH` and can point us to Python
as if it would be executed within Bazel.

PR Close #41943
2021-05-05 13:46:03 -07:00
Paul Gschwendtner 21c2a06811 fix(dev-infra): spawned child processes messing with tty output (#41948)
Currently we have a common utility method for running commands
in a child process. This method pipes all stdout and stderr, but sets
the `stdin` to `inherited`. This seemed to work as expected in terms of
allowing interactive commands being executed, but it messes with the
TTY in Windows (and potentially other platforms) so that colors and
prompts no longer work properly. See attached screenshot.

We fix this by not inheriting the stdin by default; but exposing
a dedicated method for interactive commands. This results in more
readable and obvious code too, so it's worth making this change
regardless of the TTY issues.

PR Close #41948
2021-05-05 13:45:28 -07:00
Paul Gschwendtner 19b12d7286 refactor(dev-infra): switch away from deprecated platform execution properties (#41941)
Bazel no longer recommends the use of `remote_execution_properties`
within `platform` definitions. Bazel intends to replace this attribute
with an object literal based attribute called `exec_properties`.

This simplifies the platform configuration and makes it more
readable. Additionally this make inheritance and overriding easier.

PR Close #41941
2021-05-04 21:09:30 -07:00
Paul Gschwendtner 5947239f89 fix(dev-infra): do not set lts dist tag on packages from release-candidate train (#41946)
Currently if a major release-train in the `release-candidate`/`feature-freeze`
phase becomes `latest`, we intend to set the NPM LTS dist tag for all packages
of the previous major (as the old release train in `latest` moves into LTS phase).

The logic for this exists but the release tool sets the NPM dist tag for
all packages of the new major. This means that the script might error if
a new package is part of the new major; or it could cause a deleted
package to not receive the LTS tag properly.

PR Close #41946
2021-05-04 21:07:57 -07:00
Zach Arend fdf2e02bff build: fix crash when validating commit messages (#41949)
Fixes a crash when running the `ValidateFileModule`.

PR Close #41949
2021-05-04 21:05:18 -07:00
Joey Perrott c0694bf538 fix(dev-infra): remove getBaseDir method from GitClient (#41898)
Remove the getBaseDir method from GitClient as the baseDir is determined
once during construction and does not need to be rediscovered.  The property
access should always be used.

PR Close #41898
2021-04-30 14:33:59 -07:00
George Kalpakas fff2ca540f fix(dev-infra): correctly detect prettier config (#41860)
This commit uses the correct property name (`prettier` vs `pretter`) to
check whether prettier is enabled via the config.

(It also fixes some typos in `dev-infra`.)

PR Close #41860
2021-04-28 09:21:09 -07:00
Joey Perrott 0140d04ced feat(dev-infra): create the prettier formatter for ng-dev format tooling (#41824)
Add support to use prettier for formatting using `ng-dev format`.

PR Close #41824
2021-04-27 12:23:05 -07:00
Joey Perrott b1ae31c712 fix(dev-infra): add github token requirement for discover-new-conflicts (#41825)
Add the github token option/requirement for the pr discover-new-conflicts
command.

PR Close #41825
2021-04-27 10:23:16 -07:00
Paul Gschwendtner 1b00533f8b test(dev-infra): publish test should not rely on external http request (#41767)
A test for the dev-infra publish tool currently relies on an external
http request by accident. This will break if we disallow internet
access within RBE containers.

PR Close #41767
2021-04-23 11:01:40 -07:00
Paul Gschwendtner 59bb24148e feat(dev-infra): create shared platform for remote execution (#41767)
Introduces a shared Bazel platform for remote execution builds
using Google cloud. Previously we used `bazel_toolchains` for
providing the platform w/ additional CPP and Java toolchains

`bazel_toolchains` no longer provides default toolchains with the
latest version, but provides a tool (linux and windows only) for
generating toolchain/platforms, which then need to be checked
into the repository. This is quite inconvenient and cumbersome
(especially with no macOS support), so we just provide our own
platform and CPP toolchain within `//dev-infra`. This is more
simple than all the effort we'd need to make the toolchain
generation tool work (while it would also increase the amount
of checked-in sources significantly; with more unused toolchains
for CPP or Java)

PR Close #41767
2021-04-23 11:01:40 -07:00
Joey Perrott a4a55f0687 fix(dev-infra): verify python3 is available before release (#41753)
Verify that the /usr/bin/python points to the python3 interpreter binary.

PR Close #41753
2021-04-21 17:31:22 -07:00
Alan Agius 8bfd9e886b build: update typed-graphqlify to version 3.1.1 (#41738)
Use latest version of typed-graphqlify

PR Close #41738
2021-04-21 17:30:28 -07:00
Alan Agius e00a9c1b99 build: update `chalk` to version 4.0.1 (#41738)
Update `chalk` to `4.0.1` so that it can be managed by Renovate.

PR Close #41738
2021-04-21 17:30:28 -07:00
George Kalpakas 7c353d452e refactor(dev-infra): remove unused argument from `publish` script (#41688)
Since recently, the `githubToken` parameter passed to the `ReleaseTool`
constructor is no longer used. This commit removes the unused parameter
and also the corresponding argument from the `publish` script.

PR Close #41688
2021-04-19 08:28:34 -07:00
George Kalpakas 8058396c52 docs(dev-infra): update jsdoc comments to reflect recent code changes (#41688)
PR Close #41688
2021-04-19 08:28:34 -07:00
George Kalpakas 5ba77f4f6a docs(dev-infra): fix typos in `dev-infra` docs/comments (#41688)
PR Close #41688
2021-04-19 08:28:34 -07:00
Joey Perrott 83d6a96163 feat(dev-infra): prevent pr merges of features or breaking changes on rc (#41660)
Prevent pull requests targeting `target: rc` from merging PRs with breaking
changes or features from being merged.

PR Close #41660
2021-04-16 13:09:47 -07:00
Joey Perrott dd4c3dba3f refactor(dev-infra): move `getRepoBaseDir()` to `GitClient` (#41527)
As `getRepoBaseDir()` relies on git, it should be a method on `GitClient` for retrieval
rather than its own utility outside of the common GitClient used for all git ineractions.

PR Close #41527
2021-04-15 11:28:12 -07:00
Joey Perrott a63cf7221b feat(dev-infra): prevent attempting to merge draft, closed or merged pull requests (#41604)
During pull request validation, assert that the pull request is not in
draft mode, already merged or already closed.

PR Close #41604
2021-04-14 15:44:55 -07:00
Joey Perrott 15c307b200 fix(dev-infra): only create authenticated github instance once in yargs (#41603)
Fix github token option for yargs to only create an authenticated token one time.

PR Close #41603
2021-04-13 11:50:48 -07:00
Alan Agius ed7d288364 build: update several dependencies (#41434)
With this change we update several dependencies to avoid Renovate creating a lot of PRs during onboarding. We also remove yarn workspaces as after further analysis these are not needed.

Certain dependencies such as `@octokit/rest`, `remark` and `@babel/*` have not been updated as they require a decent amount of work to update, and it's best to leave them for a seperate PR.

PR Close #41434
2021-04-12 16:46:29 -07:00
Joey Perrott 9bf8e5164d refactor(dev-infra): use a singleton for GitClient (#41515)
Creates a singleton class for GitClient rather than relying on creating an instance to
require being passed around throughout its usages.

PR Close #41515
2021-04-12 16:43:54 -07:00
Joey Perrott 4a69a7b952 feat(dev-infra): verify breaking changes are properly labeled before merging (#41546)
During merging with `ng-dev pr merge` tooling will ensure that pull requests are
properly labeled for breaking changes.  Pull requests with commits noting breaking
changes must also be labeled as such, additionally pull requests with breaking
change labels must contain commits noting breaking changes.

Fixes #38776

PR Close #41546
2021-04-12 10:11:17 -07:00
Joey Perrott 5e0d5a9ec2 feat(dev-infra): create ReleaseNotes class for generating release notes during publishing (#41476)
Generate release notes to be used for entries in both CHANGELOG.md files as well as
Github releases.

PR Close #41476
2021-04-09 07:49:48 -07:00
Joey Perrott 7e6989ee4b test(dev-infra): extract commit message build function into testing util function (#41476)
Creates a testing utility function to build commit message strings.

PR Close #41476
2021-04-09 07:49:48 -07:00
Joey Perrott 7a40d8cefd fix(dev-infra): use base ref name rather than sha for the githubTargetBranch (#41523)
After updating to use the v4 graphql api in the merge tooling, the githubTargetBranch
was set to be the sha of the latest commit rather than the branch name of the target
branch.  This caused our tooling to mismatch which branches were actually being targeted
with the effect that if a PR targeted only the patch branch (i.e. labeled `target: patch`
and targeting `11.2.x` in github)it would still expect to merge into both `11.2.x` and
`master`.  This is now corrected to once again use the branch name, restoring to the
previous functionality.

PR Close #41523
2021-04-08 15:18:02 -07:00
Joey Perrott c7d86bca21 feat(dev-infra): add support for `targetLabelExemptScopes` for merging (#41459)
Add a property, `targetLabelExemptScopes`, to the merge configuration allowing certain
scopes to be exempted from requirements for features and breaking changes only included
in PRs targetting certain labels.

PR Close #41459
2021-04-07 11:52:35 -07:00
Joey Perrott 7dba0711c2 feat(dev-infra): prevent merges for PRs with invalid breaking changes or commit types (#41459)
Check commits in pull requests to ensure the pr can be merged into the target branch. Confirms
that prs targeting minor do not contain breaking changes, and prs targeting patch or lts do not
contain breaking changes or `feat` commits.

PR Close #41459
2021-04-07 11:52:35 -07:00
Joey Perrott 2d3539f4df refactor(dev-infra): use graphql to query PRs in merge tooling (#41459)
Migrate to use graqhql to query for PR information during the validation and
preperation portions of the pr merge tooling.

PR Close #41459
2021-04-07 11:52:35 -07:00
Joey Perrott f98f379dd8 fix(dev-infra): make scopes for `test` and `refactor` commit types optional (#41486)
As the `test` and `refactor` commit types are not used in release notes and there
are solid use cases for having multiple scopes/scopeless uses of these types, they
are made to be optional instead of required on commits.

PR Close #41486
2021-04-07 09:40:31 -07:00
Joey Perrott c63d00e5b0 feat(dev-infra): update commit-message functions to properly type commits from git log (#41458)
For commits from git log entries additional fields are available such as the reference
hash and author name, update the utility functions in commit-message to include the
parsed fields.  Additionally define, per commit message type, whether to include the
commit in a release notes entry.

PR Close #41458
2021-04-06 10:04:53 -07:00
Joey Perrott ba3344ddbe feat(dev-infra): add utility method to GitClient to get latest SemVer tag (#41455)
Create a utility method for the latest git tag, sorted by committerdate, which
matches SemVer, representing the latest version released on the branch.

PR Close #41455
2021-04-06 10:04:31 -07:00
Joey Perrott 2cef385e43 feat(dev-infra): prevent `git push` from being called in dryRun mode (#41387)
Update GitClient to prevent the `push` command from being run in dryMode.

PR Close #41387
2021-04-05 08:57:13 -07:00
Joey Perrott f23406462b feat(dev-infra): create dry-run environment variable flag utils (#41387)
Create utility functions for adding a dry-run flag and checking the environment
for a dry run mode.

PR Close #41387
2021-04-05 08:57:13 -07:00
Alan Agius 64b979e12b fix(dev-infra): exclude node_modules from circular dependency checks (#41407)
With this change we exclude node_modules from circular dependency checks.

PR Close #41407
2021-04-02 15:47:33 -07:00
Joey Perrott a43f36babd fix(dev-infra): require npm login for all publishes via wombat proxy (#41422)
Due to an issue with wombat proxy returning the login state of the generated tokens,
we will need to require a login for all `ng-dev release publish` runs to ensure npm
login has occured.

PR Close #41422
2021-04-02 10:30:18 -07:00
Alan Agius c5e9944c42 fix(dev-infra): allow npm like scopes as commit message scopes (#41430)
In the CLI and Universal, we use the package name as commit message scope. The recent changes that introduced `conventional-commits-parser` in https://github.com/angular/angular/pull/41286 breaks the parsing of such commit scopes and caused commit validations to fail.

Example: https://app.circleci.com/pipelines/github/angular/angular-cli/14420/workflows/85feb5c9-184f-4088-b924-6b9e6c91f062/jobs/238446/parallel-runs/0/steps/0-102

PR Close #41430
2021-04-02 10:28:08 -07:00
Joey Perrott 381ea9d7d4 refactor(dev-infra): set up new method for checking range of commits (#41341)
Check a range of commits by retrieving the log files to be parsed with the expected
format for the parser.

This change is in part of a larger set of changes making the process for obtaining
and parsing commits for release note creation and message validation consistent.
This consistency will make it easier to debug as well as ease the design of tooling
which is built on top of these processes.

PR Close #41341
2021-04-01 11:30:26 -07:00
Joey Perrott 81a88c009c fix(dev-infra): use all non-header content for checking commit body length (#41367)
As discovered in #41316, commit body length checks should consider all of the non-header
content as the commit body rather than the conventional-commit-parser's current method
of considering everything after an issue/PR reference to be the footer.

PR Close #41367
2021-03-29 15:14:58 -07:00
Marios Radis a92a89b0eb docs: spelling changes in app.e2e-spec and validate-spec files (#41326)
PR Close #41326
2021-03-23 14:37:12 -07:00
Joey Perrott 0516fbb180 refactor(dev-infra): use conventional-commits-parser for commit parsing (#41286)
Use conventional-commits-parser for parsing commits for validation, this is being done
in anticipation of relying on this parser for release note creation.  Unifying how commits
are parsed will provide the most consistency in our tooling.

PR Close #41286
2021-03-23 13:10:47 -07:00
Joey Perrott 5eb7f3491f fix(dev-infra): remove commit message wizard and builder (#41280)
Removing commit message builder and wizard as they are unused and
unneeded.

PR Close #41280
2021-03-19 12:41:09 -07:00
Alan Agius e8cae22d66 feat(dev-infra): validate breaking changes commit messages (#41274)
With this change we valid breaking changes descriptions as per our contribution guidelines

See: 88fbc06677/CONTRIBUTING.md (commit-message-footer)

PR Close #41274
2021-03-19 12:39:19 -07:00
Kristiyan Kostadinov 59ef40988e feat(core): support TypeScript 4.2 (#41158)
Updates the repo to TypeScript 4.2 and tslib 2.1.0.

PR Close #41158
2021-03-17 09:10:25 -07:00
Joey Perrott 153e3a8960 test(dev-infra): fix test order failure in tests for the release command (#41023)
Depending on test order, the `_npmPackageInfoCache` contains information
which causes the prompt results to be slightly different text.

PR Close #41023
2021-03-08 10:33:07 -08:00
Joey Perrott 29043d9858 fix(dev-infra): properly tag github releases as prerelease as appropriate (#40999)
Previously all github releases created by the release tooling tagged
releases as `latest`. Instead releases which are created for the `next`
tag on NPM should be tagged as `prerelease` for github.

PR Close #40999
2021-02-26 15:16:55 -08:00
Joey Perrott f05715bcac fix(dev-infra): clear cached bazel outputs before building artifacts for publishing (#41000)
Clearing the cached bazel outputs before building the artifacts for
publishing prevents an intermittent error found when the version is
cached between publishes.

PR Close #41000
2021-02-26 15:16:01 -08:00
Alan Agius c362205882 build: update test to use new zone.js entry-points (#40823)
In CLI version 12, the old style of imports is no longer supported.

PR Close #40823
2021-02-24 07:58:29 -08:00
Joey Perrott c22ae5d9b9 fix(dev-infra): update npm package subsitutions to reflect no longer having an imported workspace (#40785)
Update replacements of the `//dev-infra/` piece of bazel path segments to reference the `@npm//`
workspace rather than creating its own workspace.

PR Close #40785
2021-02-11 09:13:00 -08:00
Joey Perrott aec2a2cbc2 fix(dev-infra): update build tooling for latest changes in rules_nodejs (#40710)
Update the build tooling to handle the changes in the latest version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:43 -08:00
Joey Perrott cbdb5e208e fix(dev-infra): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:43 -08:00
Joey Perrott dceede4f80 fix(dev-infra): wait for changelog to cherry pick to next branch (#40605)
Wait for the cherry-picked changelog to be merged into the next
branch before completing the task.

PR Close #40605
2021-01-28 09:02:57 -08:00
Joey Perrott d703d21656 fix(dev-infra): fix substitution string for component_benchmark (#40591)
Correct the substitution made to import ng_module from @angular/bazel,
rather than local to the repository.

PR Close #40591
2021-01-27 10:37:50 -08:00
Joey Perrott 27a818a0e7 fix(dev-infra): check and validate npm login state for release publishing (#40485)
Check and require logging into NPM before beginning the release process.

PR Close #40485
2021-01-27 10:34:21 -08:00
Joey Perrott 39b3cbbdf5 build: update .bazelversion (#40579)
Update to the latest version of bazel.

`4.0.0` introduced a breaking change on unnecessary backslashes and these
instance are corrected in this change.

PR Close #40579
2021-01-26 11:35:54 -08:00
Joey Perrott 158269cb94 feat(dev-infra): automatically add labels to release PRs (#40016)
Automatically add provided labels to PRs created for release.

PR Close #40016
2021-01-25 10:49:56 -08:00
Joey Perrott 64628a4d7d fix(dev-infra): write to unique log file for `FATAL_ERROR`s in release tooling (#40524)
Write to the unique log file, to prevent being overwritten, for `FATAL_ERROR`
failures in the release tooling.  This will help to assist in determining where
something goes wrong in the process as well as being able to resume the action.

PR Close #40524
2021-01-25 10:47:41 -08:00
Joey Perrott 2980d85b8c feat(dev-infra): support --no-branch-prompt to suppress the merge tool branch target confirmation (#40528)
Add support for a `--no-branch-prompt` flag for the `ng-dev pr merge` tool.  This
flag enables suppression of the confirmation prompt for which branches the specified
PR will merge into.

PR Close #40528
2021-01-25 10:45:57 -08:00
Alexey Elin cf02cf1e18 docs: remove duplicated the (#40434)
PR Close #40434
2021-01-14 11:33:57 -08:00
Joey Perrott 3d7e207a25 fix(dev-infra): detect multiple target labels as invalid (#40156)
When multiple target labels are applied to a PR, it should be considered
invalid as our tooling does not support a single PR targetting multiple
trains/versions.

PR Close #40156
2021-01-11 09:56:22 -08:00
Joey Perrott 7a819caef6 fix(dev-infra): delay checking if a closed pr has been merged by 30 seconds (#40181)
Delaying the check if a closed PR was closed by a merge or just closed by 30 seconds
allows for Github to have time to update the PR to be associated to the commit which
closed the PR.  Without this delay, a race condition can exist in which we check for
how a PR was closed before this association is made.

PR Close #40181
2021-01-08 09:38:19 -08:00
George Kalpakas 9057a0cc0b build: use the latest versions of Chrome (v87) and Firefox (v84) in tests (#40150)
This commit updates the versions of Chrome and Firefox used in tests -
both with Bazel and without (via Puppeteer) - to the latest:
- Chrome v87
- Firefox v84

PR Close #40150
2020-12-21 14:15:31 -08:00
George Kalpakas cb05fca1ba docs(dev-infra): add instructions for updating GeckoDriver in `browsers/README.md` (#40150)
This commit adds instructions in `dev-infra/browsers/README.md` on how
to update the version of GeckoDriver (the WebDriver implementation for
Firefox browsers).

NOTE:
The gecko driver download URLs perform redirection, so the `curl`
command needs to be run with the `-L/--location` option to follow
redirects. I updated all `curl` commands (even those that are not used
on gecko driver download URLs) for consistency.

PR Close #40150
2020-12-21 14:15:30 -08:00
George Kalpakas de2f73c131 build: fix instructions and process for updating Chrome version (#40150)
Previously, the instructions and process for updating the version of
Chrome ued in tests assumed that there was always going to be a
ChromeDriver version that corresponded to a Chrome version. For example,
if we wanted to use Chrome v87.0.4272.x, we assumed that there was going
to be ChromeDriver v87.0.4272.x. It turns out that this is not always
the case.

This commit updates the instructions and process for updating the Chrome
version to ensure a valid version of ChromeDriver will be used as well.

PR Close #40150
2020-12-21 14:15:30 -08:00
George Kalpakas be48ad28ea docs(dev-infra): fix command and typos in `browsers/README.md` (#40150)
This commit fixes the instructions in `dev-infra/browsers/README.md` to
use the `shasum` executable (instead of `sha256`, which does not exist
afaict).

The commit also fixes a couple of typos.

PR Close #40150
2020-12-21 14:15:30 -08:00
George Kalpakas 3aead9a95c docs(dev-infra): refactor `browsers/README.md` to use one sentence per line (#40150)
This commit refactor the `dev-infra/browsers/README.md` file to have one
sentence per line. This makes it consistent with other Markdown files in
the repository and makes diffs for future changes more readable.

This commit also uses proper Markdown numbered lists and fixes
indentation.

PR Close #40150
2020-12-21 14:15:30 -08:00
Joey Perrott c44baa4c5c feat(dev-infra): support --mode flag for building environment stamp (#40095)
When building the environment stamp, support two modes: release and snapshot

The release mode will always stamp using the current version of in the root package.json
and in snapshot mode will use a version stamp expressing a version based on the tag and
the number of commits from the tag.

PR Close #40095
2020-12-15 13:36:56 -08:00
Joey Perrott 634c393d35 fix(dev-infra): correct the environment variable to skip husky during merge (#40025)
With the migration to husky@5, the environment variable used to skip husky changed from
`HUSKY_SKIP_HOOKS` to `HUSKY`.  To continue skipping husky during the merge process as
expected, the environment variable used is updated.

PR Close #40025
2020-12-08 16:16:43 -08:00
Joey Perrott c043ecf317 fix(dev-infra): allow build-worker to be used in forked process (#40012)
Generates a local copy of the build-worker file to allow it to be loaded
at runtime in a forked process.

PR Close #40012
2020-12-08 12:06:51 -08:00
Joey Perrott 25e3dc594d refactor(dev-infra): separate retrieving targeted branches from printing them (#39897)
Separate retrieving targeted branches from printing the branches to allow for
other tools to better integrate with the results.

PR Close #39897
2020-12-08 08:54:08 -08:00
Joey Perrott d9356f2842 feat(dev-infra): close pull requests on merge which do not target master branch (#39979)
Previously, when a PR which does not target the master branch in the Github UI was
merged it would not close automatically.  This change detects when this case occurs
and closes the PR via the Github API.

For example:

  A PR which targets the 11.0.x branch in the Github UI has the `target: patch` label

This PR is only pushed into the 11.0.x branch, which does not trigger Github's
reference based actions to close the PR.

PR Close #39979
2020-12-07 09:47:30 -08:00
Charles Lyding 318255a5f8 build: support building with TypeScript 4.1 (#39571)
TypeScript 4.1 is now used to build and test within the repository.

PR Close #39571
2020-11-25 11:10:01 -08:00
Joey Perrott 5a49465ce0 fix(dev-infra): verify the version of generated build artifacts (#39789)
Verify the version of the generated build artifacts to ensure that
the version published to NPM is the version we expect.

PR Close #39789
2020-11-23 12:08:21 -08:00
Joey Perrott b1ebfb1cab feat(dev-infra): support squashing fixups in the `ng-dev pr rebase` command (#39747)
Adding support for squashing fixup commits during when rebasing can allow
for rebasing to better unblock things like merging.

PR Close #39747
2020-11-20 12:49:43 -08:00
Joey Perrott 881b77ef46 refactor(dev-infra): move `parseCommitMessagesForRange` into the parse file (#39747)
When attempting to actually rely on `parseCommitMessagesForRange`, it became apparent
that the function really belongs in the parse file, rather than utils.

PR Close #39747
2020-11-20 12:49:42 -08:00
Joey Perrott d1dca8ba92 feat(dev-infra): support command line arguments for restore-commit-message (#39739)
Allowing command line arguments to provide the file and source values to
the restore-commit-message command will assist in the the process of
upgrading to husky@5.

PR Close #39739
2020-11-18 11:11:40 -08:00
Joey Perrott 7261e393f1 refactor(dev-infra): extract the parsing of a range of commits into a util function (#39726)
A utility function to parse a range of commits allows for other tooling to assess
a range of commits.

PR Close #39726
2020-11-18 10:22:50 -08:00
Joey Perrott 2d79780384 fix(dev-infra): run caretaker checks asyncronously (#39086)
Run each check in the caretaker check process asyncronously.

PR Close #39086
2020-11-03 16:32:59 -08:00
Joey Perrott d0dd0e80f6 feat(dev-infra): provide tooling to check what branches a pr targets (#39504)
Create a command in the `ng-dev` toolset that allows user's to check
what branches a PR will merge into based on its targeting.

PR Close #39504
2020-11-03 14:55:24 -08:00
Joey Perrott be64f98076 fix(dev-infra): run fetches in the git client in quiet mode (#39503)
When fetch is run in normal mode, the `git-fetch-pack` plumbing command
outputs progress to stderr.  Since this is unnecessary progress
information for ng-dev usages, it should be suppressed instead.

PR Close #39503
2020-11-02 16:41:47 -08:00
Joey Perrott d6a765909b fix(dev-infra): update generated ng-dev compiled output (#39474)
Update to the new ng-dev generated script.

PR Close #39474
2020-10-29 09:55:26 -07:00
Joey Perrott 8106a7a11b fix(dev-infra): clean up output of `caretaker check` command (#39474)
Suppress the logging of the git command executed during the caretaker
check process.

PR Close #39474
2020-10-29 09:55:26 -07:00
Joey Perrott af8e547d86 feat(dev-infra): allow suppression of `GitClient`s verbose logging (#39474)
Some usages of the `GitClient` are better served by suppressing the
logging of lines that express what commands are being run. Many usages
of `GitClient` are contained within tools which are best served by
keeping the output clean as mostly read actions are occurring.

PR Close #39474
2020-10-29 09:55:26 -07:00
Joey Perrott 96769867ed fix(dev-infra): ensure hashbang is present in both published and local ng-devs (#39443)
The node hash bang was incidentally removed in the published ng-dev, it should
be included to allow for the command to be run without having to specify node.

PR Close #39443
2020-10-27 09:28:38 -07:00
Joey Perrott d331e09b71 refactor(dev-infra): create ng-dev executable locally in the repo (#39089)
Rather than running ng-dev via ts-node, going forward ng-dev is generated and run
locally via node.  Additionally, the generated file is tested on each commit to
ensure that the local generated version stays up to date.

PR Close #39089
2020-10-22 13:36:14 -07:00
Joey Perrott 767fdccf59 feat(dev-infra): prompt caretaker to confirm the merge branches on merge (#39333)
Perviously, it was not immediately clear what branches a PR would merge
into during the merge process.  This prompt allows for caretakers to
understand and acknowledge where the PR will merge to.

PR Close #39333
2020-10-19 12:06:16 -07:00
Joey Perrott 34dbba4a90 refactor(dev-infra): remove branches created for g3 comparison (#39137)
Previously, temporary branches were created to be used for comparison to
the g3 branch, instead comparisons are now done using the branches
latest shas.

PR Close #39137
2020-10-15 14:11:31 -07:00
George Kalpakas 96dd78e0c6 fix(dev-infra): detect all commit message keywords that can close a PR (#39229)
Previously, the `isCommitClosingPullRequest()` method (used in
`ng-dev release` to detect whether a commit is closing a PR based on
keywords found in the commit message) was only able to detect a subset
of the keywords supported by GitHub.

This is fine currently, because the merge script adds `PR Close #XYZ`
when merging a PR, but it might break in the future.

This commit makes the code more robust by ensuring the method can detect
all keywords supported by GitHub for automatically closing a PR based on
a commit message.

Original discussion:
https://github.com/angular/angular/pull/39135#discussion_r503440973

PR Close #39229
2020-10-12 12:02:48 -07:00
George Kalpakas c9b36f9150 fix(dev-infra): fix error message in `invokeSetNpmDistCommand()` function (#39229)
In #39135, the commit message string was accidentally changed from a
template literal to a regular string literal. This prevented the
`npmDistTag` variable from being correctly displayed in the error
message.

This commit fixes it by switching it back to a template literal.

NOTE:
This was pointed out in
https://github.com/angular/angular/pull/39135#discussion_r503361412, but
the PR was accidentally merged before the review feedback had been
addressed.

PR Close #39229
2020-10-12 12:02:48 -07:00
George Kalpakas c76dda6aeb fix(dev-infra): correctly check for commit that closes PR (#39135)
The `ng-dev release publish` command needs to check whether a commit
closed a pull request. This is implemented via checking the commit
message for specific closing keywords referencing the pull request
number.

The regex used previously failed to correctly ensure that the specified
pull request was referenced. For example, it would allow `#12345` to
also match for `#1234`.

This commit fixes the regex.

PR Close #39135
2020-10-12 10:47:13 -07:00
George Kalpakas 6947ceaf44 refactor(dev-infra): several code style and typo fixes (#39135)
This commit addresses comments from [my review][1] on PR #38656 (which
was merged without comments addressed). The changes are mostly related
to code style and typos.

[1]: https://github.com/angular/angular/pull/38656#pullrequestreview-482129333

PR Close #39135
2020-10-12 10:47:13 -07:00
Andrew Scott b2342d4116 feat(dev-infra): Add github links to caretaker checks (#39185)
This commit adds links to the PR/Issue for queries in the caretaker check.

PR Close #39185
2020-10-09 09:39:33 -07:00
Bjarki ca4ef61c06 build: bump Chromium to next stable version: 84.0.4147 (#39179)
Bump Chrome to the next stable release (84.0.4147) by following the
instructions in dev-infra/browsers/README.md.

With Chrome 86 about to be released as stable, the current local version
(Chrome 83) is starting to lag behind. It also contains a bug that
blocks Angular unit and integration tests from using Trusted Types.

PR Close #39179
2020-10-09 07:53:11 -07:00
Greg Magolan 42a164f522 build: upgrade angular build, integration/bazel and @angular/bazel package to rule_nodejs 2.2.0 (#39182)
Updates to rules_nodejs 2.2.0. This is the first major release in 7 months and includes a number of features as well
as breaking changes.

Release notes: https://github.com/bazelbuild/rules_nodejs/releases/tag/2.0.0

Features of note for angular/angular:

* stdout/stderr/exit code capture; this could be potentially be useful

* TypeScript (ts_project); a simpler tsc rule that ts_library that can be used in the repo where ts_library is too
  heavy weight

Breaking changes of note for angular/angular:

* loading custom rules from npm packages: `ts_library` is no longer loaded from `@npm_bazel_typescript//:index.bzl`
  (which no longer exists) but is now loaded from `@npm//@bazel/typescript:index.bzl`

* with the loading changes above, `load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")` is
  no longer needed in the WORKSPACE which also means that yarn_install does not need to run unless building/testing
  a target that depends on @npm. In angular/angular this is a minor improvement as almost everything depends on @npm.

* @angular/bazel package is also updated in this PR to support the new load location; Angular + Bazel users that
  require it for ng_package (ng_module is no longer needed in OSS with Angular 10) will need to load from
  `@npm//@angular/bazel:index.bzl`. I investigated if it was possible to maintain backward compatability for the old
  load location `@npm_angular_bazel` but it is not since the package itself needs to be updated to load from
  `@npm//@bazel/typescript:index.bzl` instead of `@npm_bazel_typescript//:index.bzl` as it depends on ts_library
  internals for ng_module.

* runfiles.resolve will now throw instead of returning undefined to match behavior of node require

Other changes in angular/angular:

* integration/bazel has been updated to use both ng_module and ts_libary with use_angular_plugin=true.
  The latter is the recommended way for rules_nodejs users to compile Angular 10 with Ivy. Bazel + Angular ViewEngine is
  supported with @angular/bazel <= 9.0.5 and Angular <= 8. There is still Angular ViewEngine example on rules_nodejs
  https://github.com/bazelbuild/rules_nodejs/tree/stable/examples/angular_view_engine on these older versions but users
  that want to update to Angular 10 and are on Bazel must switch to Ivy and at that point ts_library with
  use_angular_plugin=true is more performant that ng_module. Angular example in rules_nodejs is configured this way
  as well: https://github.com/bazelbuild/rules_nodejs/tree/stable/examples/angular. As an aside, we also have an
  example of building Angular 10 with architect() rule directly instead of using ts_library with angular plugin:
  https://github.com/bazelbuild/rules_nodejs/tree/stable/examples/angular_bazel_architect.

NB: ng_module is still required for angular/angular repository as it still builds ViewEngine & @angular/bazel
also provides the ng_package rule. ng_module can be removed in the future if ViewEngine is no longer needed in
angular repo.

* JSModuleInfo provider added to ng_module. this is for forward compat for future rules_nodejs versions.

PR Close #39182
2020-10-08 11:54:59 -07:00
Joey Perrott f3150223da feat(dev-infra): show CI status of all active release trains (#39067)
As part of the ng-dev caretaker check command, show the status of the
lastest CircleCI run for each active release train.

PR Close #39067
2020-10-05 10:23:34 -07:00
Joey Perrott c214cad2b4 Revert "build: upgrade angular build, integration/bazel and @angular/bazel package to rule_nodejs 2.2.0 (#37727)" (#39097)
This reverts commit db56cf18ba.

PR Close #39097
2020-10-02 10:56:53 -07:00