Skip to content

Attempt and await all Docker cleanup without failing Dependabot jobs - #1753

Merged
jeffwidman merged 4 commits into
mainfrom
fix-await-image-cleanup
Aug 18, 2026
Merged

jeffwidman merged 4 commits into
mainfrom
fix-await-image-cleanup

Conversation

@jeffwidman

@jeffwidman jeffwidman commented Aug 10, 2026

Copy link
Copy Markdown
Member

Why

The cleanup post-action could return before Docker image cleanup finished, leaving stale updater and proxy images behind. This is most impactful on persistent self-hosted and GHES runners, where Docker state survives across jobs and unused images can accumulate over time.

Awaiting cleanup fixes that problem, but it also means Docker errors can propagate. One failed prune or image lookup should not prevent the remaining housekeeping, and a cleanup problem should not turn an otherwise successful Dependabot update into a failed job.

Behavior and impact

This PR makes cleanup best effort, fully awaited, and non-fatal. Network pruning, container pruning, and each updater or proxy image cleanup are attempted independently, so one failure cannot suppress the rest. Operation-level failures remain visible through error annotations, but they do not fail the Dependabot job.

As a result, persistent runners get more reliable cleanup without making update jobs less reliable. Individual image-removal failures remain informational because images may still be referenced or affected by normal Docker races.

Covered by focused unit and Docker integration tests; the checked-in action bundle has been rebuilt.

Copilot AI balanced review requested due to automatic review settings August 10, 2026 20:16
@jeffwidman
jeffwidman requested a review from a team as a code owner August 10, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jeffwidman jeffwidman changed the title Await Docker image cleanup Await Docker image cleanup to ensure GHES stale image cleanup succeeds Aug 10, 2026
Comment thread __tests__/cleanup.test.ts Outdated
The test mocked Dockerode end to end, so it only verified that cleanup awaited a promise supplied by the mock. It did not exercise Dockerode's promise implementation or prove that an image was removed.

The Docker-backed integration test already verifies cleanup through the real client and daemon, including the resulting image state immediately after cleanup resolves. Keep that as the authoritative coverage instead.
Comment thread src/cleanup.ts
Attempt network pruning, container pruning, and each updater or proxy image cleanup independently so one Docker error cannot suppress the remaining housekeeping work.

Await every repository cleanup and report operation-level failures with contextual error annotations without calling core.setFailed. Keep individual image-removal failures informational because images may still be referenced or encounter expected Docker races.

Add deterministic orchestration coverage, prevent duplicate import-time cleanup in the integration test, and rebuild the checked-in cleanup bundle.
@jeffwidman jeffwidman changed the title Await Docker image cleanup to ensure GHES stale image cleanup succeeds Attempt and await all Docker cleanup without failing Dependabot jobs Aug 18, 2026
# Conflicts:
#	dist/cleanup/index.js
#	dist/cleanup/index.js.map
@jeffwidman
jeffwidman merged commit a54a10f into main Aug 18, 2026
11 checks passed
@jeffwidman
jeffwidman deleted the fix-await-image-cleanup branch August 18, 2026 18:33
@pavera pavera mentioned this pull request Aug 27, 2026
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.

3 participants