-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build: set up PullApprove for reviews #32459
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
base: main
Are you sure you want to change the base?
Conversation
a41cfff to
adf0e86
Compare
.pullapprove.yml
Outdated
| 'pnpm-workspace.yaml', | ||
| 'README.md', | ||
| 'SECURITY.md', | ||
| 'tslint.json', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of listing out all these top-level files, but I'm not sure if there's a way to:
- Have the
components-teamown all files by default. - Have some infra-specific files be owned by the
components-infrateam.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could have a rule for components-team that doesn't have any file matching conditions, but has a condition that no other rule above it matches.
The rules are processed in order in the yaml, so if you have a components-infra group that matches it, you can then later just have the other rule match "everything that isn't already matched"
I think...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/pullapprove-test
version: 3
# Add users here if they're temporarily unavailable.
#availability:
# users_unavailable: []
# Meta field that goes unused by PullApprove to allow for defining aliases to be
# used throughout the config.
meta:
no-groups-above-this-active: &no-groups-above-this-active len(groups.active.exclude("components-team")) == 0
defaults: &defaults
reviews:
# Authors provide their approval implicitly, this approval allows for a reviewer
# from a group not to need a review specifically for an area of the repository
# they own. This is coupled with the `required-minimum-review` group which requires
# that all PRs are reviewed by at least one team member who is not the author of
# the PR.
author_value: 1
# turn on 'draft' support
# https://docs.pullapprove.com/config/github-api-version/
# https://developer.github.com/v3/previews/#draft-pull-requests
github_api_version: 'shadow-cat-preview'
# https://docs.pullapprove.com/config/overrides/
# Note that overrides are processed in order.
overrides:
# For PRs which are still being worked on, either still in draft mode or indicated through WIP in
# title or label, PullApprove stays in a pending state until its ready for review.
- if: "draft or 'WIP' in title or 'PR state: WIP' in labels"
status: pending
explanation: 'Waiting to send reviews as PR is WIP'
# Disable PullApprove on specific PRs by adding the `PullApprove: disable` label
- if: "'PullApprove: disable' in labels"
status: success
explanation: "PullApprove skipped because of 'PullApprove: disable' label"
# If no file matching based groups are active, report this pull request as failing. Most likely,
# the PR author would need to update the PullApprove config, or create new group.
- if: len(groups.active) == 0
status: failure
explanation: 'At least one group must match this PR. Please update an existing review group, or create a new group.'
groups:
components-infra:
<<: *defaults
conditions:
- author not in ["angular-robot"]
- >
contains_any_globs(files, [
'.bazel_fix_commands.json',
'.bazelignore',
'.bazelrc',
'.bazelversion',
'.firebaserc',
'.git-blame-ignore-revs',
'.gitignore',
'.npmrc',
'.nvmrc',
'.pullapprove.yml',
'firebase.json',
'LICENSE',
'renovate.json',
'tsconfig.json',
'.github/**/{*,.*}',
'.husky/**/{*,.*}',
'.ng-dev/**/{*,.*}',
'.vscode/**/{*,.*}',
'scripts/**/{*,.*}',
'test/**/{*,.*}',
'tools/**/{*,.*}',
])
reviews:
request: 1 # Request at least one review
required: 1 # Require that all PRs have approval from at least one of the users in the group
author_value: 0 # The author of the PR cannot provide an approval for themself
reviewers:
users:
- crisbeto
- devversion
- andrewseguin
- josephperrott
components-team:
<<: *defaults
conditions:
- *no-groups-above-this-active
- >
contains_any_globs(files, [
'**/{.*,*}/**',
'**/{.*,*}',
])
reviews:
request: 2 # Request at least two reviews
required: 1 # Require that all PRs have approval from at least one of the users in the group
author_value: 0 # The author of the PR cannot provide an approval for themself
reviewers:
users:
- adolgachev
- crisbeto
- mmalerba
- andrewseguin
- wagnermaciel
- tjshiu
- ok7sai
- ~devversion
- ~josephperrottReplaces Github's code review assignments with PullApprove which is a bit more configurable and which can help reduce noise for the team.
Replaces Github's code review assignments with PullApprove which is a bit more configurable and which can help reduce noise for the team.