From 2961aa546c5ab2c014da267b85ab1e0a5ca9f209 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Wed, 8 Nov 2023 17:57:05 +0100 Subject: [PATCH 1/6] issue-pr-contrib-metrics: fix typos, discussions, start/end Signed-off-by: Thilo Fromm --- .../workflows/issue-pr-contrib-metrics.yaml | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/issue-pr-contrib-metrics.yaml b/.github/workflows/issue-pr-contrib-metrics.yaml index 349a4d5..355f222 100644 --- a/.github/workflows/issue-pr-contrib-metrics.yaml +++ b/.github/workflows/issue-pr-contrib-metrics.yaml @@ -33,14 +33,11 @@ jobs: if [[ -n "${{inputs.start_date}}" && -n "${{inputs.end_date}}" ]] ; then start_date="${{inputs.start_date}}" end_date=${{inputs.end_date}} + else + start_date=$(date -d "last month" +%Y-%m-%d) + end_date=$(date -d "yesterday" +%Y-%m-%d) fi - # This runs at midnight so metrics from the previous month's 22nd are not included - # in the prev month's stats. - start_date=$(date -d "last month" +%Y-%m-22) - end_date=$(date -d "today" +%Y-%m-22) - - #Set an environment variable with the date range echo "START_DATE=$start_date" >> "$GITHUB_ENV" echo "END_DATE=$end_date" >> "$GITHUB_ENV" @@ -52,50 +49,56 @@ jobs: END_DATE: ${{ env.END_DATE }} # We explicitly list repos for our metrics here so temporary forks like # e.g. systemd, gentoo, or udev don't pollute the stats - REPOSITORY: "flatcar/nebraska,flatcar/flatcar-website,flatcar/flatcar-build-script,flatcar/baselayout,flatcar/bootengine,flatcar/coreos-cloudinit,flatcar/flatcar-dev-util,flatcar/init,flatcar/locksmith,flatcar/mantle,flatcar/mayday,flatcar/nss-altfiles,flatcar/scripts,flatcar/seismograph,flatcar/shim,flatcar/sysroot-wrappers,flatcar/toolbox,flatcar/torcx,flatcar/update-ssh-keys,flatcar/update_engine,flatcar/updateservicectl,flatcar/Flatcar,flatcar/flatcar-packer-qemu,flatcar/flatcar-ipxe-scripts,flatcar/flatcar-cloud-image-uploader,flatcar/flatcar-linux-update-operator,flatcar/flatcar-release-mirror,flatcar/flatcar-terraform,flatcar/sdnotify-proxy,flatcar/flatcar-automation,flatcar/nebraska-update-agent,flatcar/fleetlock,flatcar/flog,flatcar/ign-converter,flatcar/nomad-on-flatcar,flatcar/sysext-bakery,flatcar/reports,flatcar/flatcar-demos,flatcar/jitsi-server,flatcar/flatcar-mastodon,flatcar/ue-rs,flatcar/azure-marketplace-ingestion-api" + REPOSITORY: "flatcar/nebraska,flatcar/flatcar-website,flatcar/flatcar-build-scripts,flatcar/baselayout,flatcar/bootengine,flatcar/coreos-cloudinit,flatcar/flatcar-dev-util,flatcar/init,flatcar/locksmith,flatcar/mantle,flatcar/mayday,flatcar/nss-altfiles,flatcar/scripts,flatcar/seismograph,flatcar/shim,flatcar/sysroot-wrappers,flatcar/toolbox,flatcar/torcx,flatcar/update-ssh-keys,flatcar/update_engine,flatcar/updateservicectl,flatcar/Flatcar,flatcar/flatcar-packer-qemu,flatcar/flatcar-ipxe-scripts,flatcar/flatcar-cloud-image-uploader,flatcar/flatcar-linux-update-operator,flatcar/flatcar-release-mirror,flatcar/flatcar-terraform,flatcar/sdnotify-proxy,flatcar/flatcar-automation,flatcar/nebraska-update-agent,flatcar/fleetlock,flatcar/flog,flatcar/ign-converter,flatcar/nomad-on-flatcar,flatcar/sysext-bakery,flatcar/reports,flatcar/flatcar-demos,flatcar/jitsi-server,flatcar/flatcar-mastodon,flatcar/ue-rs,flatcar/azure-marketplace-ingestion-api" SPONSOR_INFO: "false" - name: Collect PR metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar is:pr created:${{ env.START_DATE }}..${{ env.END_DATE }}' + SEARCH_QUERY: 'org:flatcar is:pr -author:flatcar-infra created:${{ env.START_DATE }}..${{ env.END_DATE }}' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + IGNORE_USERS: "flatcar-infra,github-actions[bot]" - name: rename PR metrics file shell: bash run: | set -euo pipefail - mv issue-metrics.md pr-metrics.md + mv issue_metrics.md pr_metrics.md - name: Collect discussion metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar type:discussion created:${{ env.START_DATE }}..${{ env.END_DATE }}' + SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions created:${{ env.START_DATE }}..${{ env.END_DATE }}' - name: rename discussion metrics file shell: bash run: | set -euo pipefail - mv issue-metrics.md discussion-metrics.md + mv issue_metrics.md discussion_metrics.md - name: Collect issue metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} SEARCH_QUERY: 'org:flatcar is:issue created:${{ env.START_DATE }}..${{ env.END_DATE }}' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + IGNORE_USERS: "flatcar-infra,github-actions[bot]" - name: Assemble full report shell: bash run: | set -euo pipefail - mv contributors.md report.md + cat contributors.md > report.md echo -e "\n\n# Discussions Metrics" >> report.md - tail --lines=+2 discussion-metrics.md >> report.md + tail --lines=+2 discussion_metrics.md >> report.md # issues already have the correct headline - cat issue-metrics.md >> report.md + cat issue_metrics.md >> report.md echo -e "\n\n# Pull Requests Metrics" >> report.md - tail --lines=+2 pr-metrics.md >> report.md + tail --lines=+2 pr_metrics.md >> report.md - name: Create issue uses: peter-evans/create-issue-from-file@v4 From 86fdfd2195021cd563d72a90ef38fd7dd7506f80 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 9 Nov 2023 10:48:14 +0100 Subject: [PATCH 2/6] issue-pr-contrib-metrics.yaml: break down opened, closed, total items Signed-off-by: Thilo Fromm --- .../workflows/issue-pr-contrib-metrics.yaml | 118 ++++++++++++++++-- 1 file changed, 108 insertions(+), 10 deletions(-) diff --git a/.github/workflows/issue-pr-contrib-metrics.yaml b/.github/workflows/issue-pr-contrib-metrics.yaml index 355f222..a001ab1 100644 --- a/.github/workflows/issue-pr-contrib-metrics.yaml +++ b/.github/workflows/issue-pr-contrib-metrics.yaml @@ -52,22 +52,56 @@ jobs: REPOSITORY: "flatcar/nebraska,flatcar/flatcar-website,flatcar/flatcar-build-scripts,flatcar/baselayout,flatcar/bootengine,flatcar/coreos-cloudinit,flatcar/flatcar-dev-util,flatcar/init,flatcar/locksmith,flatcar/mantle,flatcar/mayday,flatcar/nss-altfiles,flatcar/scripts,flatcar/seismograph,flatcar/shim,flatcar/sysroot-wrappers,flatcar/toolbox,flatcar/torcx,flatcar/update-ssh-keys,flatcar/update_engine,flatcar/updateservicectl,flatcar/Flatcar,flatcar/flatcar-packer-qemu,flatcar/flatcar-ipxe-scripts,flatcar/flatcar-cloud-image-uploader,flatcar/flatcar-linux-update-operator,flatcar/flatcar-release-mirror,flatcar/flatcar-terraform,flatcar/sdnotify-proxy,flatcar/flatcar-automation,flatcar/nebraska-update-agent,flatcar/fleetlock,flatcar/flog,flatcar/ign-converter,flatcar/nomad-on-flatcar,flatcar/sysext-bakery,flatcar/reports,flatcar/flatcar-demos,flatcar/jitsi-server,flatcar/flatcar-mastodon,flatcar/ue-rs,flatcar/azure-marketplace-ingestion-api" SPONSOR_INFO: "false" - - name: Collect PR metrics + - name: New PRs opened (and still open) metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar is:pr -author:flatcar-infra created:${{ env.START_DATE }}..${{ env.END_DATE }}' + SEARCH_QUERY: 'org:flatcar is:pr is:open -author:flatcar-infra created:${{ env.START_DATE }}..${{ env.END_DATE }}' # "time to answer" only supported for discussions HIDE_TIME_TO_ANSWER: true + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true IGNORE_USERS: "flatcar-infra,github-actions[bot]" - - name: rename PR metrics file + - name: rename new PRs metrics file shell: bash run: | set -euo pipefail - mv issue_metrics.md pr_metrics.md + mv issue_metrics.md prs_opened.md + + - name: PRs closed metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'org:flatcar is:pr -author:flatcar-infra closed:${{ env.START_DATE }}..${{ env.END_DATE }}' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + IGNORE_USERS: "flatcar-infra,github-actions[bot]" + + - name: rename closed PRs metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md prs_closed.md + + - name: Total open PRs metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'org:flatcar is:pr is:open -author:flatcar-infra' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true + IGNORE_USERS: "flatcar-infra,github-actions[bot]" + + - name: rename open PR metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md prs_open.md - - name: Collect discussion metrics + - name: Collect discussion metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} @@ -78,27 +112,91 @@ jobs: run: | set -euo pipefail mv issue_metrics.md discussion_metrics.md + + - name: New issues opened (and still open) metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'org:flatcar is:issue is:open created:${{ env.START_DATE }}..${{ env.END_DATE }}' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true + IGNORE_USERS: "flatcar-infra,github-actions[bot]" + + - name: rename new issues opened metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md issues_opened.md + + - name: Issues closed metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'org:flatcar is:issue closed:${{ env.START_DATE }}..${{ env.END_DATE }}' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + IGNORE_USERS: "flatcar-infra,github-actions[bot]" + + - name: rename issues closed metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md issues_closed.md - - name: Collect issue metrics + - name: Total open Issues metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar is:issue created:${{ env.START_DATE }}..${{ env.END_DATE }}' + SEARCH_QUERY: 'org:flatcar is:issue is:open' # "time to answer" only supported for discussions HIDE_TIME_TO_ANSWER: true + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true IGNORE_USERS: "flatcar-infra,github-actions[bot]" + + - name: rename issues closed metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md issues_open.md + - name: Upload individual reports + uses: actions/upload-artifact@v3 + with: + retention-days: 32 + name: raw-reports + path: | + ./*.md + - name: Assemble full report shell: bash run: | set -euo pipefail + cat contributors.md > report.md + echo -e "\n\n# Discussions Metrics" >> report.md tail --lines=+2 discussion_metrics.md >> report.md - # issues already have the correct headline - cat issue_metrics.md >> report.md + + echo -e "\n\n# Issue Metrics" >> report.md + # remove full issues list from stats; we only want the summary + tail --lines=+2 issues_open.md | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' + + echo -e "\n## New Issues" >> report.md + tail --lines=+2 issues_opened.md >> report.md + echo -e "\n## Closed Issues" >> report.md + tail --lines=+2 issues_closed.md >> report.md + echo -e "\n\n# Pull Requests Metrics" >> report.md - tail --lines=+2 pr_metrics.md >> report.md + # remove full PRs list from stats; we only want the summary + tail --lines=+2 prs_open.md | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' + + echo -e "\n## New PRs" >> report.md + tail --lines=+2 prs_opened.md >> report.md + echo -e "\n## Closed PRs" >> report.md + tail --lines=+2 prss_closed.md >> report.md - name: Create issue uses: peter-evans/create-issue-from-file@v4 From a8b4bbf059b6d39a7bae671955520a9f264b69a8 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 9 Nov 2023 10:49:58 +0100 Subject: [PATCH 3/6] issue-pr-contrib-metrics: ignore dependabot Co-authored-by: Mathieu Tortuyaux Signed-off-by: Thilo Fromm --- .github/workflows/issue-pr-contrib-metrics.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/issue-pr-contrib-metrics.yaml b/.github/workflows/issue-pr-contrib-metrics.yaml index a001ab1..79ebeef 100644 --- a/.github/workflows/issue-pr-contrib-metrics.yaml +++ b/.github/workflows/issue-pr-contrib-metrics.yaml @@ -61,7 +61,7 @@ jobs: HIDE_TIME_TO_ANSWER: true # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true - IGNORE_USERS: "flatcar-infra,github-actions[bot]" + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - name: rename new PRs metrics file shell: bash @@ -76,7 +76,7 @@ jobs: SEARCH_QUERY: 'org:flatcar is:pr -author:flatcar-infra closed:${{ env.START_DATE }}..${{ env.END_DATE }}' # "time to answer" only supported for discussions HIDE_TIME_TO_ANSWER: true - IGNORE_USERS: "flatcar-infra,github-actions[bot]" + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - name: rename closed PRs metrics file shell: bash @@ -93,7 +93,7 @@ jobs: HIDE_TIME_TO_ANSWER: true # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true - IGNORE_USERS: "flatcar-infra,github-actions[bot]" + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - name: rename open PR metrics file shell: bash @@ -122,7 +122,7 @@ jobs: HIDE_TIME_TO_ANSWER: true # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true - IGNORE_USERS: "flatcar-infra,github-actions[bot]" + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - name: rename new issues opened metrics file shell: bash @@ -137,7 +137,7 @@ jobs: SEARCH_QUERY: 'org:flatcar is:issue closed:${{ env.START_DATE }}..${{ env.END_DATE }}' # "time to answer" only supported for discussions HIDE_TIME_TO_ANSWER: true - IGNORE_USERS: "flatcar-infra,github-actions[bot]" + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - name: rename issues closed metrics file shell: bash @@ -154,7 +154,7 @@ jobs: HIDE_TIME_TO_ANSWER: true # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true - IGNORE_USERS: "flatcar-infra,github-actions[bot]" + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - name: rename issues closed metrics file shell: bash From 3e1a27aa47e6df4e125e066d8f1a35e6c5b3e3c1 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 9 Nov 2023 11:19:36 +0100 Subject: [PATCH 4/6] issue-pr-contrib-metrics.yaml: fix awk redirect, filename typo --- .github/workflows/issue-pr-contrib-metrics.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/issue-pr-contrib-metrics.yaml b/.github/workflows/issue-pr-contrib-metrics.yaml index 79ebeef..ae30c0e 100644 --- a/.github/workflows/issue-pr-contrib-metrics.yaml +++ b/.github/workflows/issue-pr-contrib-metrics.yaml @@ -182,7 +182,9 @@ jobs: echo -e "\n\n# Issue Metrics" >> report.md # remove full issues list from stats; we only want the summary - tail --lines=+2 issues_open.md | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' + tail --lines=+2 issues_open.md \ + | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ + >> report.md echo -e "\n## New Issues" >> report.md tail --lines=+2 issues_opened.md >> report.md @@ -191,12 +193,14 @@ jobs: echo -e "\n\n# Pull Requests Metrics" >> report.md # remove full PRs list from stats; we only want the summary - tail --lines=+2 prs_open.md | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' + tail --lines=+2 prs_open.md \ + | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ + >> report.md echo -e "\n## New PRs" >> report.md tail --lines=+2 prs_opened.md >> report.md echo -e "\n## Closed PRs" >> report.md - tail --lines=+2 prss_closed.md >> report.md + tail --lines=+2 prs_closed.md >> report.md - name: Create issue uses: peter-evans/create-issue-from-file@v4 From e62d3fd0f128d5ed17c28bbcd4252455035033c3 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 9 Nov 2023 13:42:48 +0100 Subject: [PATCH 5/6] issue-pr-contrib-metrics: improve section header wording Signed-off-by: Thilo Fromm --- .github/workflows/issue-pr-contrib-metrics.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issue-pr-contrib-metrics.yaml b/.github/workflows/issue-pr-contrib-metrics.yaml index ae30c0e..7c84441 100644 --- a/.github/workflows/issue-pr-contrib-metrics.yaml +++ b/.github/workflows/issue-pr-contrib-metrics.yaml @@ -181,25 +181,28 @@ jobs: tail --lines=+2 discussion_metrics.md >> report.md echo -e "\n\n# Issue Metrics" >> report.md + + echo -e "\n## Open Issues Summary" >> report.md # remove full issues list from stats; we only want the summary tail --lines=+2 issues_open.md \ | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ >> report.md - echo -e "\n## New Issues" >> report.md + echo -e "\n## New Issues created (and still open)" >> report.md tail --lines=+2 issues_opened.md >> report.md - echo -e "\n## Closed Issues" >> report.md + echo -e "\n## Issues closed" >> report.md tail --lines=+2 issues_closed.md >> report.md echo -e "\n\n# Pull Requests Metrics" >> report.md + echo -e "\n## Open PRs Summary" >> report.md # remove full PRs list from stats; we only want the summary tail --lines=+2 prs_open.md \ | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ >> report.md - echo -e "\n## New PRs" >> report.md + echo -e "\n## New PRs created (and still open)" >> report.md tail --lines=+2 prs_opened.md >> report.md - echo -e "\n## Closed PRs" >> report.md + echo -e "\n## PRs closed" >> report.md tail --lines=+2 prs_closed.md >> report.md - name: Create issue From 6df81b244169a55eebdcf439e84490031cd44160 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 9 Nov 2023 15:17:03 +0100 Subject: [PATCH 6/6] issue-pr-contrib-metrics: detailed discussions, improved explanations. Signed-off-by: Thilo Fromm --- .../workflows/issue-pr-contrib-metrics.yaml | 213 ++++++++++++++---- 1 file changed, 172 insertions(+), 41 deletions(-) diff --git a/.github/workflows/issue-pr-contrib-metrics.yaml b/.github/workflows/issue-pr-contrib-metrics.yaml index 7c84441..4db4dfe 100644 --- a/.github/workflows/issue-pr-contrib-metrics.yaml +++ b/.github/workflows/issue-pr-contrib-metrics.yaml @@ -40,7 +40,10 @@ jobs: echo "START_DATE=$start_date" >> "$GITHUB_ENV" echo "END_DATE=$end_date" >> "$GITHUB_ENV" - + + # + # Contributors stats + # - name: Collect contributor metrics uses: github/contributors@v1 env: @@ -52,66 +55,105 @@ jobs: REPOSITORY: "flatcar/nebraska,flatcar/flatcar-website,flatcar/flatcar-build-scripts,flatcar/baselayout,flatcar/bootengine,flatcar/coreos-cloudinit,flatcar/flatcar-dev-util,flatcar/init,flatcar/locksmith,flatcar/mantle,flatcar/mayday,flatcar/nss-altfiles,flatcar/scripts,flatcar/seismograph,flatcar/shim,flatcar/sysroot-wrappers,flatcar/toolbox,flatcar/torcx,flatcar/update-ssh-keys,flatcar/update_engine,flatcar/updateservicectl,flatcar/Flatcar,flatcar/flatcar-packer-qemu,flatcar/flatcar-ipxe-scripts,flatcar/flatcar-cloud-image-uploader,flatcar/flatcar-linux-update-operator,flatcar/flatcar-release-mirror,flatcar/flatcar-terraform,flatcar/sdnotify-proxy,flatcar/flatcar-automation,flatcar/nebraska-update-agent,flatcar/fleetlock,flatcar/flog,flatcar/ign-converter,flatcar/nomad-on-flatcar,flatcar/sysext-bakery,flatcar/reports,flatcar/flatcar-demos,flatcar/jitsi-server,flatcar/flatcar-mastodon,flatcar/ue-rs,flatcar/azure-marketplace-ingestion-api" SPONSOR_INFO: "false" - - name: New PRs opened (and still open) metrics + # + # Q&A Discussions stats + # + - name: All unanswered Q&A summary metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar is:pr is:open -author:flatcar-infra created:${{ env.START_DATE }}..${{ env.END_DATE }}' - # "time to answer" only supported for discussions - HIDE_TIME_TO_ANSWER: true + SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions category:Q&A is:unanswered' # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true - IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - - - name: rename new PRs metrics file + - name: rename open discussion metrics file shell: bash run: | set -euo pipefail - mv issue_metrics.md prs_opened.md + mv issue_metrics.md discussion_qna_open.md - - name: PRs closed metrics + - name: New Q&A opened (and still unanswered) metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar is:pr -author:flatcar-infra closed:${{ env.START_DATE }}..${{ env.END_DATE }}' - # "time to answer" only supported for discussions - HIDE_TIME_TO_ANSWER: true - IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" + SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions category:Q&A is:unanswered created:${{ env.START_DATE }}..${{ env.END_DATE }}' + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true + - name: rename open discussion metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md discussion_qna_opened.md - - name: rename closed PRs metrics file + - name: Q&A Discussions answered metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions category:Q&A is:answered created:${{ env.START_DATE }}..${{ env.END_DATE }}' + - name: rename open discussion metrics file shell: bash run: | set -euo pipefail - mv issue_metrics.md prs_closed.md + mv issue_metrics.md discussion_qna_closed.md - - name: Total open PRs metrics + # + # Regular Discussions stats + # + - name: All open Discussions summary metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar is:pr is:open -author:flatcar-infra' - # "time to answer" only supported for discussions - HIDE_TIME_TO_ANSWER: true + SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions -category:Q&A is:open' # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true - IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" + - name: rename open discussion metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md discussion_open.md - - name: rename open PR metrics file + - name: New Discussions opened (and still open) metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions -category:Q&A is:open created:${{ env.START_DATE }}..${{ env.END_DATE }}' + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true + - name: rename open discussion metrics file shell: bash run: | set -euo pipefail - mv issue_metrics.md prs_open.md - - - name: Collect discussion metrics + mv issue_metrics.md discussion_opened.md + + - name: Discussions closed metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions created:${{ env.START_DATE }}..${{ env.END_DATE }}' + SEARCH_QUERY: 'repo:flatcar/Flatcar type:discussions -category:Q&A closed:${{ env.START_DATE }}..${{ env.END_DATE }}' + - name: rename open discussion metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md discussion_closed.md + - - name: rename discussion metrics file + # + # Issues stats + # + - name: All open Issues summary metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'org:flatcar is:issue is:open' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" + - name: rename open issues metrics file shell: bash run: | set -euo pipefail - mv issue_metrics.md discussion_metrics.md + mv issue_metrics.md issues_open.md - name: New issues opened (and still open) metrics uses: github/issue-metrics@v2 @@ -123,7 +165,6 @@ jobs: # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - - name: rename new issues opened metrics file shell: bash run: | @@ -138,30 +179,65 @@ jobs: # "time to answer" only supported for discussions HIDE_TIME_TO_ANSWER: true IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" - - name: rename issues closed metrics file shell: bash run: | set -euo pipefail mv issue_metrics.md issues_closed.md - - - name: Total open Issues metrics + + # + # Pull Requests stats + # + - name: All open PRs summary metrics uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} - SEARCH_QUERY: 'org:flatcar is:issue is:open' + SEARCH_QUERY: 'org:flatcar is:pr is:open -author:flatcar-infra' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + # This metric measures items that are still open + HIDE_TIME_TO_CLOSE: true + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" + - name: rename open PR metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md prs_open.md + + - name: New PRs opened (and still open) metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'org:flatcar is:pr is:open -author:flatcar-infra created:${{ env.START_DATE }}..${{ env.END_DATE }}' # "time to answer" only supported for discussions HIDE_TIME_TO_ANSWER: true # This metric measures items that are still open HIDE_TIME_TO_CLOSE: true IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" + - name: rename new PRs metrics file + shell: bash + run: | + set -euo pipefail + mv issue_metrics.md prs_opened.md - - name: rename issues closed metrics file + - name: PRs closed metrics + uses: github/issue-metrics@v2 + env: + GH_TOKEN: ${{ secrets.GH_ACTION_METRICS_ORG_READ }} + SEARCH_QUERY: 'org:flatcar is:pr -author:flatcar-infra closed:${{ env.START_DATE }}..${{ env.END_DATE }}' + # "time to answer" only supported for discussions + HIDE_TIME_TO_ANSWER: true + IGNORE_USERS: "flatcar-infra,github-actions[bot],dependabot[bot]" + - name: rename closed PRs metrics file shell: bash run: | set -euo pipefail - mv issue_metrics.md issues_open.md - + mv issue_metrics.md prs_closed.md + + # + # Upload and post-process, create issue + # + - name: Upload individual reports uses: actions/upload-artifact@v3 with: @@ -178,31 +254,86 @@ jobs: cat contributors.md > report.md echo -e "\n\n# Discussions Metrics" >> report.md - tail --lines=+2 discussion_metrics.md >> report.md + echo -e "\n## Questions & Answers" >> report.md + echo -e "\n### Summary of all unanswered Questions" >> report.md + echo "These summary statistics include all currently unanswered Q&A discussions (openend at any point in the past)." \ + >> report.md + # remove full discussions list from stats; we only want the summary + tail --lines=+2 discussion_qna_open.md \ + | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ + >> report.md + + echo -e "\n### New Questions" >> report.md + echo -e "\nThese Q&A discussions were created between ${{ env.START_DATE }} - ${{ env.END_DATE }} and are still open." \ + >> report.md + tail --lines=+2 discussion_qna_opened.md >> report.md + + echo -e "\n### Answered Questions" >> report.md + echo -e "\nThese Q&A discussions were openend and also answered between ${{ env.START_DATE }} - ${{ env.END_DATE }}." \ + >> report.md + echo -e "(Discussions search is somewhat limited on Github; there's currently no way to search for discussions answered within a given timespan)" \ + >> report.md + tail --lines=+2 discussion_qna_closed.md >> report.md + + echo -e "\n## Other Discussions" >> report.md + echo -e "\n### Summary of open Discussions" >> report.md + echo "These summary statistics include all currently open discussions except Q&A (openend at any point in the past)." \ + >> report.md + # remove full discussions list from stats; we only want the summary + tail --lines=+2 discussion_open.md \ + | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ + >> report.md + + echo -e "\n## New discussions" >> report.md + echo -e "\nThese discussions (except Q&A) were created between ${{ env.START_DATE }} - ${{ env.END_DATE }} and are still open." \ + >> report.md + tail --lines=+2 discussion_opened.md >> report.md + + echo -e "\n## Discussions closed" >> report.md + echo -e "\nThese discussions (except Q&A) were opened at any point in the past and closed between ${{ env.START_DATE }} - ${{ env.END_DATE }}." \ + >> report.md + tail --lines=+2 discussion_closed.md >> report.md + echo -e "\n\n# Issue Metrics" >> report.md - echo -e "\n## Open Issues Summary" >> report.md + echo -e "\n## Summary of all open Issues" >> report.md + echo "These summary statistics include all currently open issues (openend at any point in the past)." \ + >> report.md # remove full issues list from stats; we only want the summary tail --lines=+2 issues_open.md \ | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ >> report.md - echo -e "\n## New Issues created (and still open)" >> report.md + echo -e "\n## New Issues" >> report.md + echo -e "\nThese issues were created between ${{ env.START_DATE }} - ${{ env.END_DATE }} and are still open." \ + >> report.md tail --lines=+2 issues_opened.md >> report.md + echo -e "\n## Issues closed" >> report.md + echo -e "\nThese issues were openend at any point in the past and were closed between ${{ env.START_DATE }} - ${{ env.END_DATE }}." \ + >> report.md tail --lines=+2 issues_closed.md >> report.md + echo -e "\n\n# Pull Requests Metrics" >> report.md - echo -e "\n## Open PRs Summary" >> report.md + + echo -e "\n## Summary of all open PRs" >> report.md + echo "These summary statistics include all currently open PRs (openend at any point in the past)." \ + >> report.md # remove full PRs list from stats; we only want the summary tail --lines=+2 prs_open.md \ | awk '/^\| Title \| URL \| Author \|/{silent=1} {if (silent==0) print $0}' \ >> report.md - echo -e "\n## New PRs created (and still open)" >> report.md + echo -e "\n## New PRs" >> report.md + echo -e "\nThese PRs were created between ${{ env.START_DATE }} - ${{ env.END_DATE }} and are still open." \ + >> report.md tail --lines=+2 prs_opened.md >> report.md + echo -e "\n## PRs closed" >> report.md + echo -e "\nThese PRs were openend at any point in the past and were closed between ${{ env.START_DATE }} - ${{ env.END_DATE }}." \ + >> report.md tail --lines=+2 prs_closed.md >> report.md - name: Create issue