From cb2eb144e4ed24ea1deeea59d47ce47bc912b19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20G=C3=B3mez=20Mor=C3=B3n?= Date: Wed, 20 Jul 2022 18:19:48 +0200 Subject: [PATCH] Adding support for GH dashboard (#187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Gómez --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.yml | 1 + .github/workflows/.env | 9 +++ .github/workflows/clossing-issues.yml | 21 ++++++ .github/workflows/comments.yml | 53 ++++++++++++++ .github/workflows/move-closed-issues.yml | 51 ++++++++++++++ .github/workflows/moving-cards.yml | 81 ++++++++++++++++++++++ .github/workflows/triage.yml | 64 +++++++++++++++++ 8 files changed, 281 insertions(+) create mode 100644 .github/workflows/.env create mode 100644 .github/workflows/clossing-issues.yml create mode 100644 .github/workflows/comments.yml create mode 100644 .github/workflows/move-closed-issues.yml create mode 100644 .github/workflows/moving-cards.yml create mode 100644 .github/workflows/triage.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 658fc40d2d6e..f801d74e8623 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,5 +1,6 @@ name: 🐞 Bug description: Create a report to help us improve +labels: ["tech-issues"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 7c812014aa08..085418b44033 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,5 +1,6 @@ name: "\U0001F680 Feature request" description: Suggest an idea for this project +labels: ["feature-request"] body: - type: markdown attributes: diff --git a/.github/workflows/.env b/.github/workflows/.env new file mode 100644 index 000000000000..650f8c054000 --- /dev/null +++ b/.github/workflows/.env @@ -0,0 +1,9 @@ +BITNAMI_TEAM='["bitnami-bot","jotamartos","alemorcuq","agomezmoron","carrodher","corico44","dgomezleon","fmulero","FraPazGal","javsalgar","gongomgra","joancafom","marcosbc","aoterolorenzo","CeliaGMqrz","Mauraza","mdhont","migruiz4","rafariossaa","beltran-rubo","recena"]' +SUPPORT_TEAM='["alemorcuq","carrodher","fmulero","FraPazGal","javsalgar","joancafom","migruiz4","rafariossaa"]' +TRIAGE_TEAM='["carrodher","fmulero", "javsalgar","rafariossaa"]' +IN_PROGRESS_COLUMN_ID=19026822 +TRIAGE_COLUMN_ID=19026814 +SOLVED_COLUMN_ID=19026825 +ON_HOLD_COLUMN_ID=19026824 +BITNAMI_COLUMN_ID=19026814 +PENDING_COLUMN_ID=19026823 diff --git a/.github/workflows/clossing-issues.yml b/.github/workflows/clossing-issues.yml new file mode 100644 index 000000000000..abaf22105ea8 --- /dev/null +++ b/.github/workflows/clossing-issues.yml @@ -0,0 +1,21 @@ +name: '[Support] Close Solved issues' +on: + schedule: + # Hourly + - cron: '0 * * * *' + +permissions: + issues: write + repository-projects: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v4 + with: + any-of-labels: 'solved' + stale-issue-label: 'solved' + days-before-stale: 0 + days-before-close: 0 + repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/comments.yml b/.github/workflows/comments.yml new file mode 100644 index 000000000000..4466e21fefac --- /dev/null +++ b/.github/workflows/comments.yml @@ -0,0 +1,53 @@ +name: '[Support] Organizing cards based on comments' +on: + issue_comment: + types: + - created +permissions: + repository-projects: write + issues: write + +concurrency: + group: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }} + cancel-in-progress: false + +jobs: + comments_handler: + runs-on: ubuntu-latest + steps: + - name: Repo checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Load .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: .github/workflows/ + - name: Move into Pending + uses: peter-evans/create-or-update-project-card@v2 + if: ${{ (!contains(github.event.issue.labels.*.name, 'bitnami')) && contains(fromJson(env.BITNAMI_TEAM), github.event.comment.user.login) }} + with: + project-name: Support + column-name: Pending + token: "${{ secrets.GHPROJECT_TOKEN }}" + - name: Move into In Progress + uses: peter-evans/create-or-update-project-card@v2 + if: ${{ contains(github.event.issue.labels.*.name, 'in-progress') && (!contains(fromJson(env.BITNAMI_TEAM), github.event.comment.user.login)) }} + with: + project-name: Support + column-name: In progress + token: "${{ secrets.GHPROJECT_TOKEN }}" + - name: Move into Triage + uses: peter-evans/create-or-update-project-card@v2 + if: ${{ ((contains(github.event.issue.labels.*.name, 'triage')) || (contains(github.event.issue.labels.*.name, 'solved'))) && (!contains(fromJson(env.BITNAMI_TEAM), github.event.comment.user.login)) }} + with: + project-name: Support + column-name: Triage + token: "${{ secrets.GHPROJECT_TOKEN }}" + - name: Label as triage back + # Only if commented when solved + if: ${{ contains(github.event.issue.labels.*.name, 'solved') }} + uses: andymckay/labeler@1.0.4 + with: + add-labels: "triage" + remove-labels: "solved" \ No newline at end of file diff --git a/.github/workflows/move-closed-issues.yml b/.github/workflows/move-closed-issues.yml new file mode 100644 index 000000000000..e5b66a474b9e --- /dev/null +++ b/.github/workflows/move-closed-issues.yml @@ -0,0 +1,51 @@ +name: '[Support] Move closed issues' +on: + issues: + types: + - closed + pull_request_target: + types: + - closed + +permissions: + issues: write + repository-projects: write + +concurrency: + group: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }} + cancel-in-progress: false + +jobs: + send_to_solved: + runs-on: ubuntu-latest + steps: + - name: Repo checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Load .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: .github/workflows/ + - name: Preparing string variables + run: | + TRIAGE_TEAM_STRING=${TRIAGE_TEAM/[/} + TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING/]/} + TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING//'"'/} + # creating env variable "on the fly" + echo "TRIAGE_TEAM_STRING=$TRIAGE_TEAM_STRING" >> $GITHUB_ENV + - name: Send to the Solved column + uses: peter-evans/create-or-update-project-card@v2 + with: + project-name: Support + # If the author comes from Bitnami, send it to Bitnami. Otherwise, all to Triage + column-name: 'Solved' + token: "${{ secrets.GHPROJECT_TOKEN }}" + issue-number: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }} + - name: Solved labeling + # Only if moved into Solved + uses: andymckay/labeler@1.0.4 + with: + repo-token: "${{ secrets.GHPROJECT_TOKEN }}" + add-labels: "solved" + remove-labels: "in-progress, on-hold, triage" \ No newline at end of file diff --git a/.github/workflows/moving-cards.yml b/.github/workflows/moving-cards.yml new file mode 100644 index 000000000000..7d8b84273b53 --- /dev/null +++ b/.github/workflows/moving-cards.yml @@ -0,0 +1,81 @@ +# This workflow is built to manage the triage support by using GH issues. +name: '[Support] Cards movements' +on: + project_card: + types: + - moved + +permissions: + repository-projects: read + issues: write + +concurrency: + # Cards are special + group: ${{ github.event.project_card.content_url }} + cancel-in-progress: false + +jobs: + label-card: + runs-on: ubuntu-latest + steps: + - name: Repo checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Load .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: .github/workflows/ + # Now handling the needed labeling + - name: On hold labeling + # Only if moved into on hold + if: ${{ github.event.project_card.column_id == env.ON_HOLD_COLUMN_ID }} + uses: andymckay/labeler@1.0.4 + with: + repo-token: "${{ secrets.GHPROJECT_TOKEN }}" + add-labels: "on-hold" + remove-labels: "triage" + - name: In progress labeling + # Only if moved into In progress + if: ${{ github.event.project_card.column_id == env.IN_PROGRESS_COLUMN_ID }} + uses: andymckay/labeler@1.0.4 + with: + repo-token: "${{ secrets.GHPROJECT_TOKEN }}" + add-labels: "in-progress" + remove-labels: "on-hold, triage" + - name: Solved labeling + # Only if moved into Solved + if: ${{ github.event.project_card.column_id == env.SOLVED_COLUMN_ID }} + uses: andymckay/labeler@1.0.4 + with: + repo-token: "${{ secrets.GHPROJECT_TOKEN }}" + add-labels: "solved" + remove-labels: "in-progress, on-hold, triage" + assign-assignee-if-needed: + runs-on: ubuntu-latest + steps: + - name: Repo checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Load .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: .github/workflows/ + - name: Preparing string variables + run: | + SUPPORT_TEAM_STRING=${SUPPORT_TEAM/[/} + SUPPORT_TEAM_STRING=${SUPPORT_TEAM_STRING/]/} + SUPPORT_TEAM_STRING=${SUPPORT_TEAM_STRING//'"'/} + # creating env variable "on the fly" + echo "SUPPORT_TEAM_STRING=$SUPPORT_TEAM_STRING" >> $GITHUB_ENV + - name: Assign to a person to work on it + # Only if moved into In progress FROM Triage + if: ${{ github.event.project_card.column_id == env.IN_PROGRESS_COLUMN_ID && github.event.changes != null && github.event.changes.column_id && github.event.changes.column_id.from == env.TRIAGE_COLUMN_ID }} + uses: pozil/auto-assign-issue@v1.7.3 + with: + numOfAssignee: 1 + assignees: ${{ env.SUPPORT_TEAM_STRING }} + removePreviousAssignees: true + # teams: XXX + repo-token: "${{ secrets.GHPROJECT_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml new file mode 100644 index 000000000000..2c1f1b6b3c87 --- /dev/null +++ b/.github/workflows/triage.yml @@ -0,0 +1,64 @@ +# This workflow is built to manage the triage support by using GH issues. +name: '[Support] Organize triage' +on: + issues: + types: + - reopened + - opened + pull_request_target: + types: + - reopened + - opened +permissions: + repository-projects: write + issues: write + +concurrency: + group: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }} + cancel-in-progress: false + +jobs: + # For any opened or reopened issue, should be sent into Triage + send_to_board: + runs-on: ubuntu-latest + steps: + - name: Repo checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Load .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: .github/workflows/ + - name: Preparing string variables + run: | + TRIAGE_TEAM_STRING=${TRIAGE_TEAM/[/} + TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING/]/} + TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING//'"'/} + # creating env variable "on the fly" + echo "TRIAGE_TEAM_STRING=$TRIAGE_TEAM_STRING" >> $GITHUB_ENV + - name: Assign to a person to work on it + uses: pozil/auto-assign-issue@v1.7.3 + with: + numOfAssignee: 1 + assignees: ${{ env.TRIAGE_TEAM_STRING }} + removePreviousAssignees: false + # teams: XXX + repo-token: "${{ secrets.GHPROJECT_TOKEN }}" + - name: Send to the board + if: ${{ github.actor != 'bitnami-bot' }} + uses: peter-evans/create-or-update-project-card@v2 + with: + project-name: Support + # If the author comes from Bitnami, send it to Bitnami. Otherwise, all to Triage + column-name: ${{ (contains(fromJson(env.BITNAMI_TEAM), github.actor)) && 'From Bitnami' || 'Triage' }} + token: "${{ secrets.GHPROJECT_TOKEN }}" + issue-number: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }} + - name: Triage labeling + # Only if moved into Solved + uses: andymckay/labeler@1.0.4 + with: + repo-token: "${{ secrets.GHPROJECT_TOKEN }}" + add-labels: ${{ (!contains(fromJson(env.BITNAMI_TEAM), github.actor)) && 'triage' || 'bitnami' }} + # For reopened issues + remove-labels: "solved" \ No newline at end of file