From edf513cb02668ccfdbaef22c0b5040230e81eca8 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Thu, 19 Feb 2026 17:37:22 +0000 Subject: [PATCH 1/8] maint: Add stale github action --- .github/workflows/stale.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000000..80b733c0ac --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,33 @@ +name: Mark stale PRs + +on: + schedule: + # hourly at minute 23 + - cron: "23 * * * *" + workflow_dispatch: + +permissions: + contents: read + +jobs: + stale: + permissions: + contents: read + issues: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-pr-stale: 14 + days-before-pr-close: 7 + days-before-issue-stale: -1 + days-before-issue-close: -1 + stale-pr-message: > + This PR has been automatically marked as stale because it has not had + any activity for 14 days. It will be closed if no further activity + occurs within 7 days of this comment. + close-pr-message: > + This PR has been closed due to inactivity. Please reopen if you would + like to continue working on it. From 6c33c0dd8e9a994f2a89c069bca247913183b4d7 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Thu, 19 Feb 2026 17:52:40 +0000 Subject: [PATCH 2/8] add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52bc006893..2491cad997 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Add stale PR GitHub Action + ([#4220](https://github.com/open-telemetry/opentelemetry-python/pull/4220)) + ### Added - `opentelemetry-instrumentation-asgi`: Add exemplars for `http.server.request.duration` and `http.server.duration` metrics From 7540707f25facf139f9d03639ceb8d08394de949 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Fri, 20 Feb 2026 09:48:41 +0000 Subject: [PATCH 3/8] add exempt PR labels --- .github/workflows/stale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 80b733c0ac..04137389a8 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -31,3 +31,4 @@ jobs: close-pr-message: > This PR has been closed due to inactivity. Please reopen if you would like to continue working on it. + exempt-pr-labels: "hold,WIP,blocked-by-spec,do not merge" From 22ca730f53a2800b8c76cbe19c98c9ae83936086 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Fri, 20 Feb 2026 09:49:20 +0000 Subject: [PATCH 4/8] increase close days to 14 --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 04137389a8..b66b796b19 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -21,13 +21,13 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-pr-stale: 14 - days-before-pr-close: 7 + days-before-pr-close: 14 days-before-issue-stale: -1 days-before-issue-close: -1 stale-pr-message: > This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity - occurs within 7 days of this comment. + occurs within 14 days of this comment. close-pr-message: > This PR has been closed due to inactivity. Please reopen if you would like to continue working on it. From c6378c554fe126122bd867775caa033a7e8e8f32 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Fri, 20 Feb 2026 09:57:34 +0000 Subject: [PATCH 5/8] update contributing.md for stale PRs --- CONTRIBUTING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 526d1a821d..650d0bd2b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,7 @@ Please also read the [OpenTelemetry Contributor Guide](https://github.com/open-t - [How to Receive Comments](#how-to-receive-comments) - [How to Get PRs Reviewed](#how-to-get-prs-reviewed) - [How to Get PRs Merged](#how-to-get-prs-merged) + - [Stale PRs](#stale-prs) - [Design Choices](#design-choices) - [Focus on Capabilities, Not Structure Compliance](#focus-on-capabilities-not-structure-compliance) - [Running Tests Locally](#running-tests-locally) @@ -241,6 +242,12 @@ A PR is considered to be **ready to merge** when: Any Approver / Maintainer can merge the PR once it is **ready to merge**. +### Stale PRs + +PRs with no activity for 14 days will be automatically marked as stale and closed after a further 14 days of inactivity. To prevent a PR from being marked stale, ensure there is regular activity (commits, comments, reviews, etc). + +Project managers can also exempt a PR from this by applying one of the following labels: `hold`, `WIP`, `blocked-by-spec`, `do not merge`. + ## Design Choices As with other OpenTelemetry clients, opentelemetry-python follows the From 362d93f9dbc3c0c912da6f3399957e7a370acdd4 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Mon, 23 Feb 2026 10:12:05 +0000 Subject: [PATCH 6/8] Update cron schedule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b66b796b19..085e88f9c0 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -3,7 +3,7 @@ name: Mark stale PRs on: schedule: # hourly at minute 23 - - cron: "23 * * * *" + - cron: "12 3 * * *" workflow_dispatch: permissions: From c6eb96e57f3cc840d112d58992990adb6f80ffcf Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Mon, 23 Feb 2026 10:17:14 +0000 Subject: [PATCH 7/8] update stale message --- .github/workflows/stale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b66b796b19..52e90b4ce5 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -28,6 +28,8 @@ jobs: This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. + + If you're still working on this, please add a comment or push new commits. close-pr-message: > This PR has been closed due to inactivity. Please reopen if you would like to continue working on it. From aba766fcb17552e0471b7cb74dd9e9c527605b70 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Mon, 23 Feb 2026 10:20:10 +0000 Subject: [PATCH 8/8] clean-up --- .github/workflows/stale.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 70524044f7..f212b5e035 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,7 +2,6 @@ name: Mark stale PRs on: schedule: - # hourly at minute 23 - cron: "12 3 * * *" workflow_dispatch: