Skip to content

Commit 96b8703

Browse files
feat: implement stale issue detector (SE-3-03)
Co-authored-by: DeveloperAlly <12529822+DeveloperAlly@users.noreply.github.com>
1 parent eee8afc commit 96b8703

5 files changed

Lines changed: 159 additions & 1 deletion

File tree

.github/workflows/docs-v2-issue-indexer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
repo,
115115
title: INDEX_TITLE,
116116
body: placeholderBody,
117-
labels: [TARGET_LABEL],
117+
labels: [TARGET_LABEL, 'status: pinned'],
118118
});
119119
indexIssue = created.data;
120120
console.log(`Created docs-v2 issue index #${indexIssue.number}`);

.github/workflows/issue-auto-label.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
'docs-v2': { color: '1d76db', description: 'Livepeer docs v2 issue scope' },
3737
'help wanted': { color: '008672', description: 'Community help requested' },
3838
'status: needs-triage': { color: 'fbca04', description: 'Needs initial maintainer triage' },
39+
'status: pinned': { color: 'e4e669', description: 'Pinned issue; exempt from stale detection and auto-close' },
3940
'type: bug': { color: 'd73a4a', description: 'Broken behavior or incorrect result' },
4041
'type: enhancement': { color: 'a2eeef', description: 'Improvement or new capability request' },
4142
'type: documentation': { color: '0075ca', description: 'Documentation issue or request' },
@@ -66,6 +67,8 @@ jobs:
6667
'kind: navigation-structure': { color: '5319e7', description: 'Docs page issue subtype: structural/navigation issue' },
6768
'scope: page': { color: '1d76db', description: 'Issue scoped to a specific docs page' },
6869
'status: needs-info': { color: 'd4c5f9', description: 'More detail needed from reporter' },
70+
'status: stale': { color: 'aaaaaa', description: 'No activity for 60+ days; will be closed if not updated' },
71+
'status: autoclosed': { color: '666666', description: 'Automatically closed after extended inactivity' },
6972
};
7073
7174
const escapeRegex = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Stale Issue Detector
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * *' # Daily at 03:00 UTC
6+
workflow_dispatch:
7+
8+
permissions:
9+
issues: write
10+
11+
concurrency:
12+
group: stale-issue-detector
13+
cancel-in-progress: true
14+
15+
jobs:
16+
stale:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Mark and close stale issues
20+
uses: actions/stale@v9
21+
with:
22+
# Label applied when an issue becomes stale
23+
stale-issue-label: 'status: stale'
24+
25+
# Label applied when a stale issue is closed
26+
close-issue-label: 'status: autoclosed'
27+
28+
# Days of inactivity before an issue is marked stale
29+
days-before-issue-stale: 60
30+
31+
# Days after being marked stale before the issue is closed
32+
days-before-issue-close: 14
33+
34+
# Comment posted when an issue is marked stale
35+
stale-issue-message: >
36+
This issue has been automatically marked as stale because it has not had
37+
activity in the last 60 days. It will be closed in 14 days unless updated
38+
or a maintainer removes the `status: stale` label.
39+
40+
41+
If this issue is still relevant, please:
42+
43+
- Add a comment with any new information or context
44+
45+
- Remove the `status: stale` label to reset the inactivity timer
46+
47+
48+
Thank you for contributing to Livepeer Docs!
49+
50+
# Comment posted when a stale issue is closed
51+
close-issue-message: >
52+
This issue has been automatically closed because it remained stale for
53+
14 days with no further activity. If the problem is still present, please
54+
open a new issue with up-to-date details.
55+
56+
# Labels that prevent an issue from being marked stale
57+
exempt-issue-labels: >
58+
status: pinned,
59+
priority: critical,
60+
priority: high,
61+
classification: urgent,
62+
classification: high,
63+
status: in-progress,
64+
status: needs-triage,
65+
status: needs-info
66+
67+
# Only operate on issues (not pull requests)
68+
days-before-pr-stale: -1
69+
days-before-pr-close: -1
70+
71+
# Limit to docs-v2 scoped issues
72+
only-labels: 'docs-v2'
73+
74+
# Allow up to 30 issues to be processed per run to stay within API rate limits
75+
operations-per-run: 30

v2/es/resources/documentation-guide/automations-workflows.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,46 @@ Los flujos de trabajo de GitHub Actions se encuentran en `.github/workflows/` y
281281

282282
---
283283

284+
#### Detector de incidencias obsoletas
285+
286+
**Archivo:** `.github/workflows/stale-issue-detector.yml`
287+
288+
**Propósito:** Marca y cierra automáticamente las incidencias de `docs-v2` que han estado inactivas durante un período prolongado.
289+
290+
**Disparadores:**
291+
- Diariamente a las 03:00 UTC (programado)
292+
- Ejecución manual desde la interfaz de GitHub Actions
293+
294+
**Lo que hace:**
295+
1. Analiza todas las incidencias abiertas de `docs-v2` en busca de inactividad
296+
2. Marca las incidencias con `status: stale` después de 60 días sin actividad
297+
3. Publica un comentario de advertencia explicando el estado obsoleto y cómo restablecerlo
298+
4. Cierra las incidencias obsoletas con `status: autoclosed` después de 14 días adicionales sin actividad
299+
5. Omite las incidencias protegidas por etiquetas de exención (ver más abajo)
300+
301+
**Etiquetas de exención (las incidencias con alguna de estas nunca se marcan como obsoletas):**
302+
- `status: pinned`
303+
- `priority: critical` o `priority: high`
304+
- `classification: urgent` o `classification: high`
305+
- `status: in-progress`
306+
- `status: needs-triage`
307+
- `status: needs-info`
308+
309+
**Ejecución manual:**
310+
1. Ir a Actions → Stale Issue Detector
311+
2. Hacer clic en "Run workflow"
312+
313+
**Secretos necesarios:** Ninguno (usa `GITHUB_TOKEN`)
314+
315+
**Notas para el mantenedor:**
316+
- Solo se procesan las incidencias con etiqueta `docs-v2`; las demás incidencias del repositorio no se ven afectadas
317+
- Eliminar la etiqueta `status: stale` de una incidencia restablece su temporizador de inactividad
318+
- Ajusta `days-before-issue-stale` y `days-before-issue-close` en el archivo de flujo para cambiar los umbrales
319+
- El límite de `operations-per-run` (30) evita superar los límites de la API de GitHub en acumulaciones grandes
320+
- Las solicitudes de extracción se excluyen intencionalmente (`days-before-pr-stale: -1`)
321+
322+
---
323+
284324
### Flujos de obtención de datos (GitHub Actions y n8n disponibles)
285325

286326
La implementación de GitHub Actions utiliza flujos dedicados divididos por fuente de datos (`update-forum-data.yml`, `update-ghost-blog-data.yml`, y `update-youtube-data.yml`). Las versiones de n8n de estos flujos también se mantienen para equipos que prefieren la orquestación de automatización externa.

v2/resources/documentation-guide/automations-workflows.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,46 @@ GitHub Actions workflows are located in `.github/workflows/` and run automatical
268268

269269
---
270270

271+
#### Stale Issue Detector
272+
273+
**File:** `.github/workflows/stale-issue-detector.yml`
274+
275+
**Purpose:** Automatically marks and closes `docs-v2` issues that have been inactive for an extended period.
276+
277+
**Triggers:**
278+
- Daily at 03:00 UTC (scheduled)
279+
- Manual dispatch from GitHub Actions UI
280+
281+
**What it does:**
282+
1. Scans all open `docs-v2` issues for inactivity
283+
2. Marks issues with `status: stale` after 60 days of no activity
284+
3. Posts a warning comment explaining the stale state and how to reset it
285+
4. Closes stale issues with `status: autoclosed` after a further 14 days of inactivity
286+
5. Skips issues protected by exempt labels (see below)
287+
288+
**Exempt labels (issues with any of these are never marked stale):**
289+
- `status: pinned`
290+
- `priority: critical` or `priority: high`
291+
- `classification: urgent` or `classification: high`
292+
- `status: in-progress`
293+
- `status: needs-triage`
294+
- `status: needs-info`
295+
296+
**Manual execution:**
297+
1. Go to Actions → Stale Issue Detector
298+
2. Click "Run workflow"
299+
300+
**Required secrets:** None (uses `GITHUB_TOKEN`)
301+
302+
**Maintainer notes:**
303+
- Only `docs-v2`-labeled issues are processed; other repo issues are unaffected
304+
- Removing the `status: stale` label from an issue resets its inactivity timer
305+
- Adjust `days-before-issue-stale` and `days-before-issue-close` in the workflow file to change the thresholds
306+
- The `operations-per-run` cap (30) prevents hitting GitHub API rate limits on large backlogs
307+
- Pull requests are intentionally excluded (`days-before-pr-stale: -1`)
308+
309+
---
310+
271311
### Data Fetching Workflows (GitHub Actions & n8n Available)
272312

273313
The GitHub Actions implementation uses dedicated workflows split by data source (`update-forum-data.yml`, `update-ghost-blog-data.yml`, and `update-youtube-data.yml`). N8n versions of these flows are also maintained for teams that prefer external automation orchestration.

0 commit comments

Comments
 (0)