Skip to content

ci: run the cleanup on the slim runner - #13

Merged
viceice merged 1 commit into
mainfrom
viceice/cleanup-slim-runner
Nov 26, 2026
Merged

viceice merged 1 commit into
mainfrom
viceice/cleanup-slim-runner

Conversation

@viceice

@viceice viceice commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Changes

Context

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Use of AI in replying to PR comments

Who answers review comments:

  • @viceice will read and reply directly.
  • An agent will draft replies and @username will read them before they are posted.
  • An agent will draft replies and reply autonomously.
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified tests

The dry-run job of this pull request already runs on ubuntu-slim. The last backlog run took 18 minutes for its last 1,934 deletes and 41 pages; an hourly run without backlog has a few deletes and the same pages. A run that still hits MAX_DURATION stops cleanly, the next one continues.

Drafted by Claude Code (Claude Opus 5.5, medium effort) on behalf of @viceice.


Generated by Claude Code

The backlog is gone, a run only reads a few pages now. Like
renovatebot/docker-build-cache#114: ubuntu-slim, a 15 minutes job timeout
and MAX_DURATION 720s.

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
Claude-Session: https://claude.ai/code/session_01QDtJ4KzQDumLuVTjbJNkWv
@qodo-code-review

qodo-code-review Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Run package cleanup on ubuntu-slim with a 15-minute limit

⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

AI Description

• Move the cleanup job to ubuntu-slim now that the deletion backlog is cleared.
• Limit the job to 15 minutes and stop the script after 720 seconds.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The workflow and cleanup script form one bounded package-maintenance integration: the workflow supplies execution limits and the script reads and deletes eligible versions from the two configured packages.
  • No separate end-user behavior or independent functional scope is evidenced.
Sources

.github/workflows/cleanup.yml[56-58]

          MAX_UNTAGGED_AGE: 7
          # in seconds, before the job timeout
          MAX_DURATION: 720

.github/workflows/cleanup.yml[27-32]

  cleanup:
    if: github.event_name != 'pull_request'
    # the backlog is gone, a run only reads the pages; slim jobs end after 15 minutes
    runs-on: ubuntu-slim
    # the script stops after MAX_DURATION
    timeout-minutes: 15
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, the cleanup job used ubuntu-latest, a 55-minute job timeout, and the script's 2700-second default unless overridden.
  • After, it uses ubuntu-slim, a 15-minute timeout, and an explicit 720-second MAX_DURATION.
  • The new correctness condition is that cleanup must remain operationally effective when page reads, retries, deletes, and runner startup all fit within the shorter execution window.
  • This is a direct configuration threshold applied by existing budget checks, not a new algorithm, state protocol, or downstream data transformation.
Sources

.github/workflows/cleanup.yml[27-32]

  cleanup:
    if: github.event_name != 'pull_request'
    # the backlog is gone, a run only reads the pages; slim jobs end after 15 minutes
    runs-on: ubuntu-slim
    # the script stops after MAX_DURATION
    timeout-minutes: 15

.github/workflows/cleanup.yml[56-58]

          MAX_UNTAGGED_AGE: 7
          # in seconds, before the job timeout
          MAX_DURATION: 720
Potential damage 🟡 Medium 🩹 Recoverable

  • If the cleanup capability is unavailable or reaches the shorter execution budget before completing its pages, eligible old versions remain temporarily.
  • A later successful scheduled or manual run can perform the cleanup; reverting restores the previous execution settings but does not itself remove versions already left behind.
  • The assessment assumes the configured runner starts and the script retains its existing permissions and API behavior.
  • Reverting restores the prior runner and time settings for future runs.
  • Versions missed during the shorter run require a later cleanup run; no external compensation or data reconstruction is indicated.
Sources

.github/workflows/cleanup.yml[27-32]

  cleanup:
    if: github.event_name != 'pull_request'
    # the backlog is gone, a run only reads the pages; slim jobs end after 15 minutes
    runs-on: ubuntu-slim
    # the script stops after MAX_DURATION
    timeout-minutes: 15

.github/workflows/cleanup.yml[56-58]

          MAX_UNTAGGED_AGE: 7
          # in seconds, before the job timeout
          MAX_DURATION: 720
Assessed commit 69bbddb
Diagram

graph TD
  A["Scheduled or manual run"] --> B["Slim cleanup job"] --> C["Cleanup script"] --> D["Package API"]
  B --> E["15-minute job limit"]
  C --> F["720-second stop"]
Loading
High-Level Assessment

Use the existing MAX_DURATION control with the shorter job timeout; no script change is needed. Keeping the longer ubuntu-latest job was considered but does not match the reported smaller workload.

Files changed (1) +6 / -3

Other (1) +6 / -3
cleanup.ymlRun cleanup on ubuntu-slim with shorter time limits +6/-3

Run cleanup on ubuntu-slim with shorter time limits

• Moves the non-PR cleanup job from ubuntu-latest to ubuntu-slim and reduces its timeout from 55 to 15 minutes. Sets MAX_DURATION to 720 seconds so the script stops before the job timeout; the PR dry-run job is unchanged.

.github/workflows/cleanup.yml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1)

Grey Divider


View low (1)
Informational
1. Cleanup recovers a backlog about four times slower 🐞 Bug
Description
The cleanup job's timeout-minutes drops from 55 to 15 and MAX_DURATION is set to 720, so
.github/cleanup.sh stops issuing requests after about 12 minutes instead of the previous 45-minute
default. If a new backlog of handoff or untagged versions builds up, each hourly run now deletes
roughly a quarter of what it did, so clearing it takes several times more hours and the cleanup
job's ceiling is reached sooner.
Code

.github/workflows/cleanup.yml[R31-32]

+    # the script stops after MAX_DURATION
+    timeout-minutes: 15
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The cleanup job now runs with `timeout-minutes: 15` and `MAX_DURATION: 720` (about 12 minutes of deletes per hourly run), down from 55 minutes and the script's 2700-second default. This is a fourfold cut in backlog throughput, justified only by the observation that the current backlog is gone.

## Fix Focus Areas
- .github/workflows/cleanup.yml[31-32]
- .github/workflows/cleanup.yml[56-58]

## Recommended Fix
Either keep the slim runner but document in the workflow comment how many runs a backlog of a given size needs, so future maintainers know the cost of recovery, or make the window configurable through a workflow input so an operator can raise `MAX_DURATION` for a manual catch-up run. Do not change the timeout without a matching `MAX_DURATION` margin of at least 2-3 minutes.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@viceice
viceice merged commit dccc257 into main Nov 26, 2026
3 checks passed
@viceice
viceice deleted the viceice/cleanup-slim-runner branch November 26, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant