Skip to content

Further deployment cleanup to drain all ghcr-ci entries#4337

Open
mitchdz wants to merge 5 commits intoNVIDIA:mainfrom
mitchdz:paginate-cleanup
Open

Further deployment cleanup to drain all ghcr-ci entries#4337
mitchdz wants to merge 5 commits intoNVIDIA:mainfrom
mitchdz:paginate-cleanup

Conversation

@mitchdz
Copy link
Copy Markdown
Collaborator

@mitchdz mitchdz commented Apr 16, 2026

listDeployments returns 30 results by default. The cleanup job
deleted one page per cron tick, but ghcr-ci deployments accumulate
faster than that (~14 per CI run). Old deployments were never fully
drained, leaving "temporarily deployed to ghcr-ci" entries on PR
timelines indefinitely.

Signed-off-by: mdzurick <mitch_dz@hotmail.com>
mitchdz added 4 commits April 16, 2026 11:03
Signed-off-by: mdzurick <mitch_dz@hotmail.com>
1. github.paginate() → github.paginate.iterator() — streams one page
     at a time instead of loading 76K deployments into memory
  2. Promise.all → Promise.allSettled — partial failures don't crash the
     batch; counts successes and stops when rate-limited
  3. BATCH 100 → 50 — stays within GitHub's secondary rate limit (~100
     concurrent API calls)
  4. Fixed indentation — object properties now indented properly
     relative to their braces
  5. response.data — iterator yields response objects, so .data is used
     correctly to access the deployment array per page

Signed-off-by: mdzurick <mitch_dz@hotmail.com>
  - No pagination at all. Fetches page 1 repeatedly with listDeployments
    (50 items per call). After deleting those, the next fetch returns
the next batch since the old ones are gone.
  - Capped at 200 deletions per run (MAX_PER_RUN). Uses ~408 API calls
    per environment per run, well within the 15,000/hour budget shared
with CI.
  - Still uses Promise.allSettled so a single 403 doesn't crash the
    step. Stops gracefully on partial failures.

Signed-off-by: mdzurick <mitch_dz@hotmail.com>
Signed-off-by: mdzurick <mitch_dz@hotmail.com>
@mitchdz mitchdz changed the title Paginate deployment cleanup to drain all ghcr-ci entries Further deployment cleanup to drain all ghcr-ci entries Apr 16, 2026
github-actions Bot pushed a commit that referenced this pull request Apr 16, 2026
@github-actions
Copy link
Copy Markdown

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

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