Repository navigation
feat(lint): retry workflow downloads and flag the ones that skip it - #246
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
5ae5f9c to
7892de1
Compare
roborev: Combined Review (
|
7892de1 to
1ed919d
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
|
Reworking this around a real bash parser and a download helper that only replaces the file after a full download, so a failed attempt can't leave a broken file behind. |
b96cd8d to
89eefdb
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
|
Back to draft while I drop the Windows runner guess, since reading "windows" out of the runner text could hide real findings on Linux jobs. The docs now say to set the shell explicitly on Windows. |
roborev: Combined Review (
|
Transient network failures can turn healthy workflow runs red. Retrying a download also needs to preserve the destination until the full response arrives, so consumers don't receive partial files. Shared helpers give repositories one retry policy. Checking executable shell calls keeps raw downloads and package installers from bypassing that policy.
…ot name Remove option-value tables for sudo, env, apt, and go, option skipping before installer subcommands, path and .exe normalization of command names, and the expanded installer row builder in favor of one table regex. Shorten the kit-download test to its two named cases.
Workflow downloads can bypass retry checks when installers place options before their subcommands or callers use executable paths and shell prefixes. Keep those spellings subject to the same retry policy. Implicit Windows shells can contain valid PowerShell that Bash cannot parse. Skip those scripts so the workflow check remains usable across runners.
Bash runs c\url as curl, so escaped command names must receive the same retry guidance as ordinary spellings. Document the check's launcher and installer limits so callers can judge its coverage.
Repeated guidance at one run key leaves users unable to identify which command needs retries. Each message needs enough context to find the command within the script. Clarify where allow comments apply and which installers the check covers so users can judge its coverage.
Failed downloads must preserve the destination and remove partial files. HTTP errors leave no partial file, so truncated responses are needed to exercise cleanup when every attempt fails. Keep scanner cases together so command-specific diagnostics share the same assertions.
CI rejects the installer condition under staticcheck QF1001. Preserve its behavior while meeting the lint rule.
Windows jobs use PowerShell by default, so treating their commands as Bash produces false download warnings. Keep explicit shell choices authoritative and continue checking runners selected through expressions conservatively.
Runner metadata can hide download findings when unrelated labels or comments contain Windows text. Shell declarations provide the choice this check needs without interpreting runner labels and expressions. Keep runner inference out of the scanner and document how Windows workflows select PowerShell explicitly.
Windows users need explicit shell guidance because the workflow checker and runner use different defaults. Keep that guidance concise so callers can choose the right shell for retry helpers and PowerShell steps.
4bfaf26 to
8e9b96c
Compare
roborev: Combined Review (
|
Findings pointed at the run key and gave a script line number, so in a long step a reader had to count lines to find the command. Literal blocks and one-line plain values now report the command's own file line and column. Two commands on one line now get separate positions. Other scalar styles fold or escape text, so their script positions do not map to the file. Those findings still point at the run key. Plain `yarn` and `yarn --frozen-lockfile` are the usual yarn v1 CI install commands, and the check missed both. Yarn with no subcommand now counts as an install. Version and help flags are excluded. kit-download failed with exit 126 when run as `bash kit-download` from its own directory, because the script path had no directory part. It now uses dirname, which returns "." in that case. The lint job ran `go mod tidy` as its first module fetch, without a retry, so a short proxy failure there still turned CI red. The job now downloads modules under kit-retry first. Generated with Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
roborev: Combined Review (
|
Workflow authors get
kit-downloadandkit-retry, pluskennlint workflow-retries, which flagsrun:steps that fetch without them. An apt mirror hiccup, a stalled toolchaincurl, or a checksum-service error duringgo installnow retries instead of turning main red.Add
./.github/actions/kit-retryafter checkout to put both commands on PATH:kit-download URL DESTdownloads to a temp file and moves it into place only on success. A download cut short on the first try ends with the complete file, and an exhausted one leaves an existing DEST unchanged.kit-retry 3 5 go mod downloadretries any other command, waiting 5 then 10 seconds.kit-retry, andmake lintruns the check.The check flags direct
curlandwgetcalls, and unwrapped APT, Go, npm, pnpm, yarn, bun, pip, Docker pull, apk, brew, cargo, pipx, and dnf installs, and reports each at the command's own line inrun: |blocks. It parses Bash withmvdan.cc/sh/v3, a new dependency, so quoted text andecho curlaren't flagged. It doesn't follow launchers liketimeoutorbash -c, and# workflowretry: allow <reason>opts a command out.