ci: stop the lint job's apt step hanging for six minutes - #123
Merged
Conversation
The unconditional `apt-get update` added to satisfy review on #122 was fine on the PR runs (~5s) and then sat for six minutes on the first master push, still in progress when it was cancelled. Nothing was wrong with the tree; apt was just slow. That is a bad trade for this job in particular. Its argument for existing -- and for carrying a push trigger at all -- is that it answers in seconds, and it was made to depend on a network fetch it does not normally need. ubuntu-latest ships PyYAML. So import first and install only if that fails. The dependency is still handled rather than assumed, which was the point of the review finding, but a working runner pays nothing for it. `if` rather than `python3 -c 'import yaml' && exit 0`, because under `bash -e` the latter fails the step on the branch where the import fails -- exactly when the install needs to run. Both paths checked under -e. Also timeout-minutes: 10. The default is six hours, which is how a step that hangs rather than fails occupies a runner and tells nobody. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more' |
PR Summary by QodoCI: avoid slow apt updates in lint job by installing PyYAML only when missing
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #122.
The unconditional
apt-get updateI added there to satisfy the PyYAML review finding was fine on the PR runs (~5s) and then sat for six minutes on the first master push, still in progress when I cancelled it (run 32156242103). Nothing was wrong with the tree — apt was just slow.That's a bad trade for this job specifically. Its argument for existing, and for carrying a push trigger at all, is that it answers in seconds; I made it depend on a network fetch it doesn't normally need.
ubuntu-latestships PyYAML.Change
Import first, install only if that fails. The dependency is still handled rather than assumed — which was the point of the finding — but a working runner pays nothing for it.
ifrather thanpython3 -c 'import yaml' && exit 0: underbash -ethe latter fails the step on precisely the branch where the install needs to run. Both paths verified under-e, the missing case simulated by shadowing the module onPYTHONPATH.Plus
timeout-minutes: 10. The default is six hours, which is how a step that hangs rather than fails occupies a runner and tells nobody.Notes
run:block is itself parse-checked by the linter it belongs to — 23 blocks, clean.nothing that reaches a build), because ci: close the if that cost last night's release, and parse-check the rest #122 classifiedlint.ymlas no-build. Before that classification this would have queued all 107.fifix from ci: close the if that cost last night's release, and parse-check the rest #122 is on master andmaster.ymlis unchanged here.🤖 Generated with Claude Code