Skip to content

Commit 82765d7

Browse files
committed
New runner-images job and CLI command
1 parent da4a0ab commit 82765d7

11 files changed

Lines changed: 593 additions & 1 deletion

File tree

.github/workflows/autofix.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,29 @@ jobs:
6565
HAS_VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY && 'true' || '' }}
6666
run: uv --no-progress run --frozen -- repomatic setup-guide
6767

68+
runner-images:
69+
name: 🖥️ Runner images
70+
# Schedule-only: the announcements come from actions/runner-images, so they
71+
# change on GitHub's clock rather than on any push here, and a weekly read
72+
# is well inside the months of notice a deprecation carries. Not gated
73+
# against workflow_call: called that way the job runs in the caller's
74+
# context and manages the caller's own issue. See
75+
# repomatic/runner_images.py for why the announcement feed is the source.
76+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
77+
runs-on: ubuntu-slim
78+
permissions:
79+
issues: write
80+
steps:
81+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
82+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
83+
with:
84+
version: "0.12.1"
85+
- name: Manage runner images issue
86+
env:
87+
GH_TOKEN: ${{ secrets.REPOMATIC_PAT || github.token }}
88+
REPOMATIC_PAT: ${{ secrets.REPOMATIC_PAT }}
89+
run: uv --no-progress run --frozen -- repomatic runner-images
90+
6891
metadata:
6992
name: 🧬 Project metadata
7093
# Skipping this job propagates to every `needs: metadata` job below, so the

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Teach the `repomatic-ship` skill to reconcile bundled skills and agents as a third pass, judge a false-positive autofix PR against current `main` before writing a lint rule for it, and tell a superseded intra-cycle measurement from a genuine contradiction.
99
- **Breaking:** the `update-dep-graph` job moved from `autofix.yaml` into the release engine, its only firing moment being a release push. A required check or `needs:` edge naming it under Autofix must follow.
1010
- **Breaking:** manual version-bump commits now read `` [changelog] Bump minor version to `vX.Y.0` ``: every version-machinery commit carries the `[changelog] ` prefix, and anything matching the old unprefixed titles must follow.
11+
- New `runner-images` job and CLI command, opening an issue that lists GitHub's open runner-image announcements and flags the ones retiring or affecting an image the repo runs on.
1112
- Autofix jobs no longer run on version-bump pushes: the 16 remaining jobs only re-checked machine-generated, ship-gated commits, and drift stays covered by the next push and the weekly sweep.
1213
- The tool runner now retries a download up to 3 times on transient network failures, instead of failing the job on a one-off TLS or truncation error.
1314
- Standalone binary tests now run for every healthy target when a sibling build fails, instead of being skipped wholesale.

docs/repomatic.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,15 @@
326326
:undoc-members:
327327
```
328328

329+
## `repomatic.runner_images` module
330+
331+
```{eval-rst}
332+
.. automodule:: repomatic.runner_images
333+
:members:
334+
:show-inheritance:
335+
:undoc-members:
336+
```
337+
329338
## `repomatic.setup_guide` module
330339

331340
```{eval-rst}

docs/tests.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,15 @@
405405
:undoc-members:
406406
```
407407

408+
## `tests.test_runner_images` module
409+
410+
```{eval-rst}
411+
.. automodule:: tests.test_runner_images
412+
:members:
413+
:show-inheritance:
414+
:undoc-members:
415+
```
416+
408417
## `tests.test_setup_guide` module
409418

410419
```{eval-rst}

docs/workflows.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ This workflow runs on every push to `main` and on a **weekly schedule** so quiet
7171
- upstream `kdeldycke/repomatic` repo, `workflow_call` events
7272
- `setup-guide = false` in `[tool.repomatic]`
7373

74+
#### 🖥️ Runner images (`runner-images`)
75+
76+
- Reads the open `Announcement`-labelled issues of [`actions/runner-images`](https://github.com/actions/runner-images/issues?q=is%3Aissue+is%3Aopen+label%3AAnnouncement), which cover both newly available images and images entering deprecation, and maintains a single issue listing them
77+
- Sorts an announcement to the top and names the image in an **Affects** column when it acts on a runner the repo runs on, read from the announcement's `Possible impact` section so a migration *destination* is never reported as affected
78+
- Nothing bumps a `runs-on:` value automatically (Dependabot rewrites `uses:` references, `sync-workflow-pins` rewrites version literals), so a retirement otherwise arrives as a failing build with no warning
79+
- Automatically closes the issue once GitHub has closed every open announcement
80+
- **Runs on**: the weekly schedule and manual `workflow_dispatch` only, since the feed changes on GitHub's clock rather than on any push here
81+
7482
*Formatters* — rewrite files to enforce canonical style:
7583

7684
#### 🐍 Format Python (`format-python`)

repomatic/cli.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
from .init_project import run_init
161161
from .labels import apply_labels
162162
from .lint_repo import (
163+
KNOWN_RUNNERS,
163164
run_repo_lint,
164165
)
165166
from .mailmap import Mailmap, remove_header
@@ -188,6 +189,7 @@
188189
parse_component_entries,
189190
valid_file_ids,
190191
)
192+
from .runner_images import manage_runner_images_issue
191193
from .setup_guide import manage_setup_guide
192194
from .sync_ops import (
193195
OPERATIONS_BY_NAME,
@@ -2008,6 +2010,30 @@ def broken_links(
20082010
)
20092011

20102012

2013+
@repomatic.command(
2014+
short_help="Manage runner image announcements issue", section=_section_github
2015+
)
2016+
@_require_token(_token_mod, "validate_gh_token_env")
2017+
def runner_images() -> None:
2018+
"""Report GitHub's open runner image announcements as an issue.
2019+
2020+
Reads the Announcement-labelled issues of actions/runner-images, which cover
2021+
both newly available images and images entering deprecation, and maintains a
2022+
single issue listing them. Announcements naming an image this repository
2023+
runs on are sorted first and flagged.
2024+
2025+
Nothing bumps a runs-on: value automatically, so a retirement otherwise
2026+
lands as a failing build with no warning.
2027+
2028+
Requires the gh CLI to be installed and authenticated.
2029+
2030+
\b
2031+
Example:
2032+
repomatic runner-images
2033+
"""
2034+
manage_runner_images_issue(KNOWN_RUNNERS)
2035+
2036+
20112037
@repomatic.command(
20122038
short_help="Manage setup guide issue lifecycle", section=_section_github
20132039
)

0 commit comments

Comments
 (0)