repo: adopt rust-lang label system (#136)

* contributing: add `Keeping track of issues and PRs` section

* add `labeler.yml`

* more labels

* update labels

* update `.github/labeler.yml`

* update `CONTRIBUTING.md`

* doc `.github` files

* wording fix

* add `A-dependency`
This commit is contained in:
hinto-janai 2024-05-26 19:57:21 -04:00 committed by GitHub
parent 59a49b93ab
commit 45656fe653
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 133 additions and 0 deletions

80
.github/labeler.yml vendored Normal file
View file

@ -0,0 +1,80 @@
# This file consists of rules determining which labels the
# `github-actions` bot should automatically label an issue/PR with.
# The CI that actually applies labels is in `.github/workflows/labeler.yml`.
#
# The main one used is the "if a file changed" rule.
# The format for this rule is:
#
# ```
# $LABEL_NAME:
# - changed-files:
# - any-glob-to-any-file: $PATH
# ```
#
# where $PATH can be:
# $DIRECTORY/*
# which means any file changed 1 level deep inside that directory or:
# $DIRECTORY/**
# which means any file changed within that directory or:
# $DIRECTORY/$FILE_NAME
# which means a specific file path or:
# $DIRECTORY/*.$FILE_EXTENSION
# which means any file 1 level deep in that directory with a certain file extension.
#
# For a detailed guide, see: <https://github.com/actions/labeler>.
#
# For a real example:
A-consensus: # This is the tag name
- changed-files: # Any changed file...
- any-glob-to-any-file: consensus/** # ...within the `consensus/` directory
# will cause the `github-actions` bot
# to add the `A-consensus` tag.
A-cryptonight:
- changed-files:
- any-glob-to-any-file: cryptonight/**
A-database:
- changed-files:
- any-glob-to-any-file: database/**
A-helper:
- changed-files:
- any-glob-to-any-file: helper/**
A-net:
- changed-files:
- any-glob-to-any-file: net/**
A-p2p:
- changed-files:
- any-glob-to-any-file: p2p/**
A-pruning:
- changed-files:
- any-glob-to-any-file: pruning/**
A-test-utils:
- changed-files:
- any-glob-to-any-file: test-utils/**
A-types:
- changed-files:
- any-glob-to-any-file: types/**
A-ci:
- changed-files:
- any-glob-to-any-file: .github/**
A-dependency:
- changed-files:
- any-glob-to-any-file: '**/Cargo.toml' # Any Cargo file in the entire repo
- any-glob-to-any-file: '**/Cargo.lock'
A-workspace:
- changed-files:
- any-glob-to-any-file: '*' # Any root file change
A-docs:
- changed-files:
- any-glob-to-any-file: '**/*.md' # Any file in the entire repo ending in `.md`

25
.github/workflows/labeler.yml vendored Normal file
View file

@ -0,0 +1,25 @@
# This action automatically applies GitHub labels
# based on the rules in the `.github/labeler.yml` file.
#
# For more info:
# - <https://github.com/actions/labeler>
# - <https://github.com/tokio-rs/tokio/blob/6c42d286b343f498ce29de2aab9358a0aedb081c/.github/workflows/labeler.yml>
name: "Labeler"
on:
- pull_request_target
permissions:
contents: read
jobs:
labeler:
permissions:
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true

View file

@ -38,3 +38,31 @@ After that, ensure all lints, tests, and builds are successful by running:
- Sort imports as core, std, third-party, Cuprate crates, current crate. - Sort imports as core, std, third-party, Cuprate crates, current crate.
- Follow the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines) - Follow the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines)
- Break the above rules when it makes sense - Break the above rules when it makes sense
## Keeping track of issues and PRs
The Cuprate GitHub repository has a lot of issues and PRs to keep track of. Cuprate makes use of generic labels and labels grouped by a prefixes to help with this.
Some labels will be [automatically added/removed](https://github.com/Cuprate/cuprate/tree/main/.github/labeler.yml) if certain file paths have been changed in a PR.
The following section explains the meaning of various labels used.
This section is primarily targeted at maintainers. Most contributors aren't able to set these labels.
| Labels | Description | Example |
|--------------|-------------|---------|
| [A-] | The **area** of the project an issue relates to. | `A-database`, `A-rpc`, `A-docs`
| [C-] | The **category** of an issue. | `C-cleanup`, `C-optimization`
| [D-] | Issues for **diagnostics**. | `D-confusing`, `D-verbose`
| [E-] | The **experience** level necessary to fix an issue. | `E-easy`, `E-hard`
| [I-] | The **importance** of the issue. | `I-crash`, `I-memory`
| [O-] | The **operating system** or platform that the issue is specific to. | `O-windows`, `O-macos`, `O-linux`
| [P-] | The issue **priority**. These labels can be assigned by anyone that understand the issue and is able to prioritize it, and remove the [I-prioritize] label. | `P-high`, `P-low`
| [wontfix] | Indicates an issue will not be fixed. | |
[A-]: https://github.com/Cuprate/cuprate/labels?q=A
[C-]: https://github.com/Cuprate/cuprate/labels?q=C
[D-]: https://github.com/Cuprate/cuprate/labels?q=D
[E-]: https://github.com/Cuprate/cuprate/labels?q=E
[I-]: https://github.com/Cuprate/cuprate/labels?q=I
[O-]: https://github.com/Cuprate/cuprate/labels?q=O
[P-]: https://github.com/Cuprate/cuprate/labels?q=P
[wontfix]: https://github.com/Cuprate/cuprate/labels?q=wontfix