Skip to content

Commit da52634

Browse files
committed
build: set up PullApprove for reviews
Replaces Github's code review assignments with PullApprove which is a bit more configurable and which can help reduce noise for the team.
1 parent cd22ab6 commit da52634

File tree

6 files changed

+112
-106
lines changed

6 files changed

+112
-106
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
run: |
3333
bazel build //:entry_points_manifest
3434
pnpm check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
35-
- name: Check OWNERS file
36-
run: pnpm ownerslint
35+
- name: Validate pull approve configuration
36+
run: pnpm ng-dev pullapprove verify
3737
- name: Check for component id collisions
3838
run: pnpm detect-component-id-collisions
3939
- name: Check style lint

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
run: |
3131
bazel build //:entry_points_manifest
3232
pnpm check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
33-
- name: Check OWNERS file
34-
run: pnpm ownerslint
33+
- name: Validate pull approve configuration
34+
run: pnpm ng-dev pullapprove verify
3535
- name: Check for component id collisions
3636
run: pnpm detect-component-id-collisions
3737
- name: Check style lint

.pullapprove.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
version: 3
2+
3+
# Add users here if they're temporarily unavailable.
4+
#availability:
5+
# users_unavailable: []
6+
7+
# Meta field that goes unused by PullApprove to allow for defining aliases to be
8+
# used throughout the config.
9+
meta:
10+
no-groups-above-this-active: &no-groups-above-this-active len(groups.active.exclude("components-team")) == 0
11+
12+
defaults: &defaults
13+
reviews:
14+
# Authors provide their approval implicitly, this approval allows for a reviewer
15+
# from a group not to need a review specifically for an area of the repository
16+
# they own. This is coupled with the `required-minimum-review` group which requires
17+
# that all PRs are reviewed by at least one team member who is not the author of
18+
# the PR.
19+
author_value: 1
20+
21+
# turn on 'draft' support
22+
# https://docs.pullapprove.com/config/github-api-version/
23+
# https://developer.github.com/v3/previews/#draft-pull-requests
24+
github_api_version: 'shadow-cat-preview'
25+
26+
# https://docs.pullapprove.com/config/overrides/
27+
# Note that overrides are processed in order.
28+
overrides:
29+
# For PRs which are still being worked on, either still in draft mode or indicated through WIP in
30+
# title or label, PullApprove stays in a pending state until its ready for review.
31+
- if: "draft or 'WIP' in title or 'PR state: WIP' in labels"
32+
status: pending
33+
explanation: 'Waiting to send reviews as PR is WIP'
34+
# Disable PullApprove on specific PRs by adding the `PullApprove: disable` label
35+
- if: "'PullApprove: disable' in labels"
36+
status: success
37+
explanation: "PullApprove skipped because of 'PullApprove: disable' label"
38+
# If no file matching based groups are active, report this pull request as failing. Most likely,
39+
# the PR author would need to update the PullApprove config, or create new group.
40+
- if: len(groups.active) == 0
41+
status: failure
42+
explanation: 'At least one group must match this PR. Please update an existing review group, or create a new group.'
43+
44+
groups:
45+
components-infra:
46+
<<: *defaults
47+
conditions:
48+
- author not in ["angular-robot"]
49+
- >
50+
contains_any_globs(files, [
51+
'.bazel_fix_commands.json',
52+
'.bazelignore',
53+
'.bazelrc',
54+
'.bazelversion',
55+
'.firebaserc',
56+
'.git-blame-ignore-revs',
57+
'.gitignore',
58+
'.npmrc',
59+
'.nvmrc',
60+
'.pullapprove.yml',
61+
'firebase.json',
62+
'LICENSE',
63+
'renovate.json',
64+
'tsconfig.json',
65+
'.github/**/{*,.*}',
66+
'.husky/**/{*,.*}',
67+
'.ng-dev/**/{*,.*}',
68+
'.vscode/**/{*,.*}',
69+
'scripts/**/{*,.*}',
70+
'test/**/{*,.*}',
71+
'tools/**/{*,.*}',
72+
])
73+
reviews:
74+
request: 1 # Request at least one review
75+
required: 1 # Require that all PRs have approval from at least one of the users in the group
76+
author_value: 0 # The author of the PR cannot provide an approval for themself
77+
reviewers:
78+
users:
79+
- crisbeto
80+
- devversion
81+
- andrewseguin
82+
- josephperrott
83+
84+
components-team:
85+
<<: *defaults
86+
conditions:
87+
- *no-groups-above-this-active
88+
- >
89+
contains_any_globs(files, [
90+
'**/{.*,*}/**',
91+
'**/{.*,*}',
92+
])
93+
reviews:
94+
request: 2 # Request at least two reviews
95+
required: 1 # Require that all PRs have approval from at least one of the users in the group
96+
author_value: 0 # The author of the PR cannot provide an approval for themself
97+
reviewers:
98+
users:
99+
- adolgachev
100+
- crisbeto
101+
- mmalerba
102+
- andrewseguin
103+
- wagnermaciel
104+
- tjshiu
105+
- ok7sai
106+
- ~devversion
107+
- ~josephperrott

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@
2727
"test-local": "pnpm -s test --local",
2828
"test-firefox": "pnpm -s test --firefox",
2929
"test-tsec": "pnpm bazelisk test //... --build_tag_filters=tsec --test_tag_filters=tsec",
30-
"lint": "pnpm -s tslint && pnpm -s stylelint && pnpm -s ownerslint && pnpm -s ng-dev format changed --check",
30+
"lint": "pnpm -s tslint && pnpm -s stylelint && pnpm -s ng-dev format changed --check",
3131
"e2e": "bazel test //src/... --build_tag_filters=e2e --test_tag_filters=e2e --build_tests_only",
3232
"deploy-dev-app": "node ./scripts/deploy-dev-app.js",
3333
"breaking-changes": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/breaking-changes.mts",
3434
"check-entry-point-setup": "node ./scripts/check-entry-point-setup.mjs",
3535
"check-package-externals": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/check-package-externals.mts",
3636
"format": "pnpm -s ng-dev format changed",
3737
"cherry-pick-patch": "ts-node --project tools/cherry-pick-patch/tsconfig.json tools/cherry-pick-patch/cherry-pick-patch.ts",
38-
"ownerslint": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/ownerslint.mts",
3938
"detect-component-id-collisions": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/detect-component-id-collisions.mts",
4039
"tslint": "tslint -c tslint.json --project ./tsconfig.json",
4140
"stylelint": "stylelint \"(src|docs)/**/*.+(css|scss)\" --config .stylelintrc.json",

scripts/ownerslint.mts

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)