diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..1a71a24 --- /dev/null +++ b/.github/labeler.yml @@ -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: . +# +# 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` diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..381b7dd --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,25 @@ +# This action automatically applies GitHub labels +# based on the rules in the `.github/labeler.yml` file. +# +# For more info: +# - +# - + +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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc07f0c..742ebae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. - Follow the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines) - 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 \ No newline at end of file