Skip to content

Commit ad1a370

Browse files
ChrsMarkmx-psiandrzej-stencel
authored
[chore] add codeowner activity report workflow (#46015)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR adds a workflow that reports code-owners' activity. The workflow only focuses on components that are listed for stability at #44130 since that's the main priority for now. We can expand the report for all components in contrib but that might be a bit noisy. Similar work is done in other SIGs, i.e open-telemetry/opentelemetry-js#5898 <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Related to open-telemetry/opentelemetry-collector#14107 <!--Describe what testing was performed and which tests were added.--> #### Testing Running locally with: ```console export DRY_RUN=1 export GITHUB_TOKEN=ghp_foobarzet node -e " const { Octokit } = require('@octokit/rest'); const script = require('./.github/workflows/scripts/generate-codeowners-activity.js'); const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); script({ github: { rest: octokit }, context: { payload: { repository: { owner: { login: 'open-telemetry' } } } } }); " ``` <!--Describe the documentation added.--> #### Documentation ~ <!--Please delete paragraphs that you did not use before submitting.--> #### AI Usage disclaimer **_The script of this PR is crafted mainly by using Cursor_** taking inspiration from the Weekly Report workflow script: [/.github/workflows/scripts/generate-weekly-report.js](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/d0cd8a546f274e3aadbc43cf5cb5d693633365e4/.github/workflows/scripts/generate-weekly-report.js#L4) --------- Signed-off-by: ChrsMark <chrismarkou92@gmail.com> Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
1 parent 3a4a7ea commit ad1a370

2 files changed

Lines changed: 468 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow generates a code owner activity report as a GitHub issue.
2+
# It measures whether code owners have reviewed/replied to
3+
# PRs opened against each component (by component label).
4+
# We target at least 75% of each component's PRs to be reviewed by a code owner,
5+
# and each code owner to respond to at least 75% / n of their requested PRs (n = number of code owners for that component)
6+
# (at least 3 code owners are required for components aiming for stable).
7+
8+
name: 'Generate Code Owner Activity Report'
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
dry_run:
13+
description: 'Dry run (print report only, do not create issue)'
14+
required: false
15+
default: false
16+
type: boolean
17+
schedule:
18+
# run on the 1st of every month at 2am UTC
19+
- cron: "0 2 1 * *"
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
report:
26+
permissions:
27+
contents: read
28+
issues: write
29+
pull-requests: read
30+
runs-on: ubuntu-24.04
31+
if: ${{ github.repository_owner == 'open-telemetry' }}
32+
steps:
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
34+
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
35+
id: report
36+
env:
37+
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true' && 'true' || '0' }}
38+
with:
39+
retries: 3
40+
script: |
41+
const script = require('.github/workflows/scripts/generate-codeowners-activity.js')
42+
await script({github, context})

0 commit comments

Comments
 (0)