Browse Source

Governance v1 (#1844)

* v1

* Update wording

* The area stuff needs a little work

* add enhancement to pr's

* Update governance and feature request template
Laurence Jones 2 years ago
parent
commit
311cda31fe

+ 1 - 1
.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

+ 9 - 1
.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
+
+
+        <!-- /kind feature -->
+        <!-- Completely new feature not currently available  -->
+
+        <!-- /kind enhancement -->
+        <!-- Feature is available but this extends or adds extra functionality -->
     validations:
       required: true
 

+ 101 - 0
.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

+ 7 - 0
.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

+ 30 - 0
.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'