Add github actions for PR and issue labeling (#8709)

* Added Issue Labeler, PR labeler, .github readme
* Updated README with Issue Template information, and regex to metrics
Co-authored-by: Kit Patella <kit@jepsen.io>
This commit is contained in:
Jono Sosulska 2020-10-05 10:43:21 -04:00 committed by GitHub
parent 896d143647
commit 0174b1c7c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 262 additions and 21 deletions

40
.github/README.md vendored Normal file
View File

@ -0,0 +1,40 @@
# Consul GitHub Configuration
## Overview
This file helps track the configuration of the `.github/` folder.
## Issue Templates
Issue templates are stored in `.github/ISSUE_TEMPLATE/` and follow the
[documentation](https://docs.github.com/en/github/building-a-strong-community/using-templates-to-encourage-useful-issues-and-pull-requests).
The `.github/ISSUE_TEMPLATE/config.yml` controls links out to other support
resources.
## GitHub Actions
GitHub Actions provides a pluggable architecture for creating simple automation.
An Action is made of at least two files, the `workflow` file and a config file.
All workflows are stored in `.github/workflows/`. Configuration files are stored
one directory higher, in `.github/`. The workflow and the configuration file
should be named the same when created. Create unique and clear names for these
files.
### Issue Labeler
Issues are labeled with
[RegEx Labeler](https://github.com/marketplace/actions/regex-issue-labeler).
This action supports simple regexes, and most string parsing.
### PR Labeler
PRs are labeled with [labeler](https://github.com/actions/labeler) action.
This supports glob parsing so that labels can be applied to changed files.
## Considered Actions
- [super-labeler-action](https://github.com/IvanFon/super-labeler-action) is an action that holds all the configuration in a single file. In setting up a basic configuration with 60 labels, the JSON config became ~1200 lines. This solution may be feaseable in the future, but wouldn't seem as scaleable. This also creates a single point of failure for the entire labeling system.
- [actions-label-commenter](https://github.com/peaceiris/actions-label-commenter) is an action that just responds based on tags, rather than tagging them as they come in. This would be helpful for responses for reoccuring types of messages.
- [top-issues-labeler](https://github.com/marketplace/actions/top-issues-labeler) labels the top ten issues based on number of :+1: 's on an inssue.

90
.github/issue-labeler.yml vendored Normal file
View File

@ -0,0 +1,90 @@
# archived/webui:
# backport/1.6:
# backport/1.7:
# backport/1.8:
# beta/1.8:
# blocks-release:
# crash:
# do-not-merge:
# help-wanted:
# needs-discussion:
# needs-investigation:
# post-beta:
# pr/dependencies:
# pr/needs-rebase:
# pr/needs-tests:
theme/acls:
- '(acl|ACL)'
# theme/agent-cache:
# theme/api:
theme/catalog:
- '(catalog|Catalog)'
theme/certificates:
- '(certificate|CA|Certificate\sAuthority)'
theme/cli:
- '(command-line|commandline|cli|command)'
theme/config:
- '(configuration_files|options#configuration_files)'
theme/connect:
- '(Connect|connect|service\smesh|mesh|proxy|gateway)'
theme/consul-nomad:
- '(nomad|Nomad)'
theme/consul-vault:
- '(vault|Vault)'
# theme/contributing:
theme/dns:
- '(dns|DNS)'
theme/envoy/xds:
- '(envoy|xds|xDS|XDS|Envoy)'
theme/federation-usability:
- '(WAN|wan|wan_fed|federation|fed)'
# theme/go-modules:
theme/health-checks:
- '(health-check|healthcheck|health\scheck)'
theme/ingress-gw:
- '(ingress|ingress-gateway|Ingress)'
# thementernal-cleanup:
theme/internals:
- '(raft|RAFT|SERF|serf|lifeguard|Lifeguard|gossip)'
theme/kubernetes:
- '(kubernetes|k8s|helm)'
theme/mesh-gw:
- 'mesh'
# theme/operator-usability:
theme/packaging:
- '(nix|Nix|RPM|rpm|DEB|deb|repository|systemd|upstart|Upstart|SystemD|brew|homebrew|choco|chocolatey)'
theme/performance:
- '(performance|requests\sper\ssecond)'
theme/service-metadata:
- '(meta-data|meta)'
theme/streaming:
- '(stream|streaming)'
theme/telemetry:
- '(circonis|statsd|dogstatsd|datadog|DataDog|prometheus|Prometheus|metric|metrics|trace|tracing)'
theme/terminating-gw:
- 'terminating'
theme/testing:
- '(unit\stest|functional\stest|integration\stest|e2e|E2E)'
theme/tls:
- '(mtls|mTLS|tls|TLS)'
theme/ui:
- '(ui|browser|chrome|firefox|IE|ie|Chrome)'
theme/windows:
- '(windows|Windows|Microsoft|microsoft)'
# thinking:
# type/bug:
type/ci:
- '(circle|circleci|CircleCI)'
# type/crash:
type/docs:
- '(docs\/|docs|consul\.io)'
# type/docs-cherrypick:
type/enhancement:
- '(new\sfeature|feature|feature\srequest)'
# type/good-first-issue:
# type/question:
# type/umbrella-☂️:
# version/0.8.3:
# waiting-pr-merge:
# waiting-reply:
# waiting-reply-🤖:

83
.github/pr-labeler.yml vendored Normal file
View File

@ -0,0 +1,83 @@
# backport/1.6:
# backport/1.7:
# backport/1.8:
# beta/1.8:
# blocks-release:
# crash:
# do-not-merge:
# help-wanted:
# needs-discussion:
# needs-investigation:
# post-beta:
pr/dependencies:
- vendor/**/*
- go.*
# pr/needs-rebase:
# pr/needs-tests:
theme/acls:
- acl/**/*
theme/agent-cache:
- agent/cache/**/*
theme/api:
- api/**/*
theme/catalog:
- agent/catalog/**/*
theme/certificates:
- tlsutil/**/*
theme/cli:
- command/**/*
theme/config:
- agent/config/**/*
theme/connect:
- connect/**/*
- agent/connect/**/*
# theme/consul-nomad:
# theme/consul-vault:
theme/contributing:
- .github/**/*
theme/dns:
- dns/**/*
theme/envoy/xds:
- agent/xds/**/*
# theme/federation-usability:
theme/health-checks:
- agent/health*
- api/health*
# theme/ingress-gw:
# theme/internal-cleanup:
theme/internals:
- lib/**/*
- types/**/*
# theme/kubernetes:
# theme/mesh-gw:
# theme/operator-usability:
# theme/performance:
# theme/service-metadata:
# theme/streaming:
theme/telemetry:
- logging/**/*
# theme/terminating-gw:
theme/testing:
- ./*test*/**/*
theme/tls:
- tlsutil/**/*
theme/ui:
- ui-v2/**/*
# theme/windows:
# thinking:
# type/bug:
type/ci:
- .circleci/*
# type/crash:
type/docs:
- website/**/*
type/docs-cherrypick:
- website/**/*
# type/enhancement:
# type/good-first-issue:
# type/question:
# type/umbrella-☂️:
# version/0.8.3:
# waiting-pr-merge:
# waiting-reply:
# waiting-reply-🤖:

15
.github/workflows/issue-labeler.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: "Issue Labeler"
on:
issues:
types: [opened, edited]
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v2.2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-labeler.yml
not-before: "2020-09-14T08:23:00Z"
enable-versioned-regex: 0

13
.github/workflows/pr-labeler.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/pr-labeler.yml
sync-labels: false