[ci] Stop jobs hanging on apt by restoring the cached apt action and bounding raw apt calls - #18518
Conversation
…bounding raw apt calls
|
@esphbot review |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #18518 +/- ##
=======================================
Coverage 88.75% 88.75%
=======================================
Files 68 68
Lines 15398 15398
Branches 2332 2332
=======================================
Hits 13667 13667
Misses 1421 1421
Partials 310 310 🚀 New features to boost your workflow:
|
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
…g pre-install best effort, and gate ci-status on the apt cache seed
|
@esphbot review |
|
Re-reviewed at that commit. All four prior findings resolved. Retry budget now 480 s under a 600 s cap. Two nits left, both non-blocking: flat 60 s bound could hard-fail a congested mirror, and |
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
…t cache step for what it installs
|
@esphbot review |
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
…ep its retry ladder inside a third of the job budget
|
@esphbot review |
overkill for this case. could consider if it gets copied more |
… are spent on the working fallback
|
@esphbot review |
Files now match the expected proto files.
Agreed. Two copies, both correct today. Extracting a composite action for one shared ladder buys little. Dropping this finding. |
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
…call cannot stall, and skip the index refresh when the image's lists suffice
|
@esphbot review |
|
👋 Hi there! This PR modifies 2 file(s) with codeowners. @esphome/core - As codeowner(s) of the affected files, your review would be appreciated! 🙏 Note: Automatic review request may have failed, but you're still welcome to review. |
There was a problem hiding this comment.
Pull request overview
This PR updates ESPHome’s GitHub Actions workflows to prevent CI jobs from hanging on slow/unresponsive apt mirrors by reintroducing cached apt installs where they can be shared, and by adding explicit time bounds around remaining raw apt usage.
Changes:
- Add a push-only
seed-apt-cachejob to populate a shared apt cache entry forlibsdl2-devandccache, and restore that cache in pull-request-only jobs to avoid unbounded apt work. - Switch
integration-testsandtest-build-components-splitto use the cached apt action, and pinintegration-teststoubuntu-24.04to match the seeded environment. - Add time bounding/backstops for the CodSpeed benchmarks apt behavior (job timeout + bounded pre-install of
libc6-dbg) and wrap PR-onlyci-api-proto.ymlapt usage with bounded retries/timeouts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds apt cache seeding/restoring for shared PR jobs; pins runner image where needed; bounds benchmark job apt behavior. |
| .github/workflows/ci-api-proto.yml | Wraps PR-only apt installs with bounded timeouts/retry logic to avoid hangs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
PR Review — [ci] Stop jobs hanging on apt by restoring the cached apt action and bounding raw apt callsMerge-ready. The rewrite since the last review ( What this revision gets right:
Two non-blocking notes:
🟢 Suggestions
1. Quote the cache `version` so a future `1.10` bump does not collide with `1.1`
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
decline remaining bot suggestions YAGNI and also already addressed above |
|
tagged for backport since somewhere between 20-30% of jobs currently get stuck and this will likely affect the release https://github.com/esphome/esphome/actions?query=is%3Ain_progress |
…bounding raw apt calls (esphome#18518)
What does this implement/fix?
Jobs that run plain
apt-get updateon the runner are hanging on a slow apt mirror; on #18513 the component batch job is stuck in its apt step and the CodSpeed job is stuck inside the CodSpeed action, which installs libc6-dbg with its own unbounded apt call. Steps that go throughawalsh128/cache-apt-pkgs-actionare fine, a cache hit never touches apt.This brings the cached apt action back for
integration-testsandtest-build-components-split(removed in #17463 because pull request runs each wrote their own cache copy) and adds aseed-apt-cachejob that runs only on pushes with the same package list and version, so the single shared entry is written on dev and pull request jobs always hit it and never save. The benchmarks job gets a 30 minute timeout and pre-installs libc6-dbg with a bounded retry loop so the CodSpeed runner skips apt;ci-api-proto.ymlis pull request only so nothing could seed it, it keeps plain apt wrapped in the same bounded retry loop. The cached apt action has no--no-install-recommends, so the component batch job goes back to the package set it had before #17463 with the recommended packages of libsdl2-dev included;seed-apt-cacheis listed inci-statusso a broken seed is visible on dev instead of quietly bringing per pull request cache copies back.Same fixes as esphome/esphome-device-builder#2586 and esphome/esphome-device-builder#2603.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome.io with documentation (if applicable):
Pull request in developers.esphome.io with developer documentation (if applicable):
Test Environment
Example entry for
config.yaml:# Example config.yamlChecklist:
tests/folder).If user exposed functionality or configuration variables are added/changed: