From 311cda31feb21ced655c226749f43fc7e8885d75 Mon Sep 17 00:00:00 2001 From: Laurence Jones Date: Mon, 5 Dec 2022 15:58:19 +0000 Subject: [PATCH] Governance v1 (#1844) * v1 * Update wording * The area stuff needs a little work * add enhancement to pr's * Update governance and feature request template --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 10 +- .github/governance.yml | 101 ++++++++++++++++++++ .github/release-drafter.yml | 7 ++ .github/workflows/governance-bot.yaml | 30 ++++++ 5 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 .github/governance.yml create mode 100644 .github/workflows/governance-bot.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index cacb5fa5f..d694ed277 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,6 +1,6 @@ name: Bug report description: Report a bug encountered while operating crowdsec -labels: bug +labels: kind/bug body: - type: textarea id: problem diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 6449ceefe..7692d6c55 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,6 +1,5 @@ name: Feature request description: Suggest an improvement or a new feature -labels: enhancement body: - type: textarea id: feature @@ -8,6 +7,15 @@ body: label: What would you like to be added? description: | Significant feature requests are unlikely to make progress as issues. Please consider engaging on discord (discord.gg/crowdsec) and forums (https://discourse.crowdsec.net), instead. + value: | + For feature request please pick a kind label by removing `` that wrap the example lines below + + + + + + + validations: required: true diff --git a/.github/governance.yml b/.github/governance.yml new file mode 100644 index 000000000..344db580a --- /dev/null +++ b/.github/governance.yml @@ -0,0 +1,101 @@ +version: v1 + +issue: + captures: + - regex: 'version: v*(.+)-[rc*]?' + github_release: true + ignore_case: true + label: 'version/$CAPTURED' + + - regex: 'Platform: *(windows?|ms|wins?|microsoft).*' + label: 'os/win' + ignore_case: true + + - regex: 'Platform: *(freebsd|bsd).*' + label: 'os/freebsd' + ignore_case: true + + - regex: 'Platform: *(linux|linus|lin).*' + label: 'os/linux' + ignore_case: true + + - regex: 'Platform: *(macos|mac|apple|macintosh|macbook).*' + label: 'os/mac' + ignore_case: true + + labels: + - prefix: triage + list: ['accepted'] + multiple: false + author_association: + collaborator: true + member: true + owner: true + needs: + comment: | + @$AUTHOR: Thanks for opening an issue, it is currently awaiting triage. + + In the meantime, you can: + + 1. Check [Crowdsec Documentation](https://docs.crowdsec.net/) to see if your issue can be self resolved. + 2. You can also join our [Discord](https://discord.gg/crowdsec). + 3. Check [Releases](https://github.com/crowdsecurity/crowdsec/releases/latest) to make sure your agent is on the latest version. + + - prefix: kind + list: ['feature', 'bug', 'packaging', 'enhancement'] + multiple: false + author_association: + author: true + collaborator: true + member: true + owner: true + needs: + comment: | + @$AUTHOR: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process. + * `/kind feature` + * `/kind enhancement` + * `/kind bug` + * `/kind packaging` + + - prefix: os + list: ['mac', 'win', 'linux', 'freebsd'] + multiple: true + +pull_request: + labels: + - prefix: kind + multiple: false + list: [ 'feature', 'enhancement', 'fix', 'chore', 'dependencies'] + needs: + comment: | + @$AUTHOR: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically. + * `/kind feature` + * `/kind enhancement` + * `/kind fix` + * `/kind chore` + * `/kind dependencies` + status: + context: 'Kind Label' + description: + success: Ready for review & merge. + failure: Missing kind label to generate release automatically. + + - prefix: area + list: [ "agent", "local-api", "cscli", "security", "configuration"] + multiple: true + needs: + comment: | + @$AUTHOR: There are no area labels on this PR. You can add as many areas as you see fit. + * `/area agent` + * `/area local-api` + * `/area cscli` + * `/area security` + * `/area configuration` + + - prefix: priority + multiple: false + list: [ 'urgent', 'important' ] + author_association: + collaborator: true + member: true + owner: true \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 8ed6bcf13..f56c03d49 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -2,12 +2,15 @@ categories: - title: 'New Features' labels: - 'new feature' + - 'kind/feature' - title: 'Improvements' labels: + - 'kind/enhancement' - 'enhancement' - 'improvement' - title: 'Bug Fixes' labels: + - 'kind/fix' - 'fix' - 'bugfix' - 'bug' @@ -15,6 +18,10 @@ categories: labels: - 'documentation' - 'doc' + - title: 'Chore / Deps' + labels: + - 'kind/dependencies' + - 'kind/chore' tag-template: "- $TITLE @$AUTHOR (#$NUMBER)" template: | ## Changes diff --git a/.github/workflows/governance-bot.yaml b/.github/workflows/governance-bot.yaml new file mode 100644 index 000000000..5c08cabf5 --- /dev/null +++ b/.github/workflows/governance-bot.yaml @@ -0,0 +1,30 @@ +# .github/workflow/governance.yml + +on: + pull_request_target: + types: [ synchronize, opened, labeled, unlabeled ] + issues: + types: [ opened, labeled, unlabeled ] + issue_comment: + types: [ created ] + +# You can use permissions to modify the default permissions granted to the GITHUB_TOKEN, +# adding or removing access as required, so that you only allow the minimum required access. +permissions: + contents: read + issues: write + pull-requests: write + statuses: write + checks: write + +jobs: + governance: + name: Governance + runs-on: ubuntu-latest + steps: + # Semantic versioning, lock to different version: v2, v2.0 or a commit hash. + - uses: BirthdayResearch/oss-governance-bot@v3 + with: + # You can use a PAT to post a comment/label/status so that it shows up as a user instead of github-actions + github-token: ${{secrets.GITHUB_TOKEN}} # optional, default to '${{ github.token }}' + config-path: .github/governance.yml # optional, default to '.github/governance.yml'