logs.gokuls.in

1 pull request merged across 1 repo

bahdotsh/wrkflw

Why

A sweep of eight public repositories on a7e479f found 40 jobs where wrkflw compare disagreed with GitHub. They trace to ten causes. One is not wrkflw's: rust-lang/log's doc job fails on Rust 1.100, which came out after the GitHub run. This PR fixes eight of the other nine and leaves one for a follow-up.

What changes

CauseRepos hitFix
A composite action's $GITHUB_PATH / $GITHUB_ENV writes never reached the job (taiki-e/install-action, then cargo hack: "no such command")rust-lang/log, 5 jobsThe composite collects what its steps applied and appends it to the calling step's files, on failure too
Checkout dropped every symlinkcommander.js, 9 jobsLinks are copied as links with the same target, never followed; a changed or removed link follows the repository
dtolnay/rust-toolchain@clippy / @miri were passed to rustup as toolchain namesitoa, 2 jobsThose branches mean nightly plus clippy / miri, rust-src unless the step says otherwise. @master, @v1 and every actions-rs/toolchain ref pin the action, not a toolchain
The job image lacked runner tools (gh, sudo, jq, unzip, python3, …), and a job with no setup action ran on bare ubuntu:latestitoa, 3 jobs; many more in generalA shared layer adds the tools, plus gh from GitHub's apt repository (best effort). Every unmapped job in Docker or Podman now gets this image, and ~/.cargo/bin is on PATH when Rust is installed
A literal windows-latest mapped to a servercore image a Linux engine can't start; macos-* mapped to rust:latestcobra, logBoth run as Linux in the Ubuntu image, as matrix legs already did. -P still maps them to an image of your own
Windows jobs run as Linux counted as disagreementscobra, logcompare leaves them out of the agreement count ("not compared: ran as Linux locally…"). macOS jobs are still compared
compare couldn't pair a called workflow's jobs (pre_ci vs pre_ci / pre_ci)itoa<caller> / <job> rows pair with the caller's one result: failed if any failed, skipped if all were
A job whose steps run docker failed without saying whycobracompare notes that it needs WRKFLW_DOCKER_IN_JOBS=1
setup-go refused ranges such as ^1.22cobra^, ~ and >= resolve to the newest release they allow; a range bounded from above is still refused

scripts/conformance/compare_sweep.sh and compare_runs.txt replace the ad-hoc sweep script. The old script counted ✔ lines, which test output also prints (commander.js showed "8898 agree"). The new one reads compare's JSON report and keeps its clones under ~/.cache/wrkflw-sweep, not /tmp.

Not in this PR

  • Steps still run as root. GitHub runs them as runner, so cobra's TestFailGenFishCompletionFile, which expects a permission error, still fails here. Running as another user needs the workspace (a host bind mount on Linux, a volume on macOS) and every toolchain directory (rustup, uv's Pythons, npm's global prefix) to be writable by that user, or every pip install and cargo install breaks. That's a change of its own, with its own tests. The README now states the gap.
  • compare doesn't yet warn when a GitHub run is old enough for a floating toolchain to have moved, as with log's doc job. The README says to compare against a recent run.

Compatibility

  • Every job image is rebuilt once: the shared layer changed. The tools-only image is about 1.2 GB and shared by every job.
  • Jobs without setup actions now run in a built image instead of bare ubuntu:latest. container: jobs and images mapped with -P are unchanged.
  • A Windows image is no longer used for windows-* unless mapped with -P.
  • wrkflw_executor::script_commands is now public, so compare can tell which jobs run docker.

Testing

  • New unit tests: composite env hand-on, symlink checkout (relative, chained, dangling, directory, absolute, changed, removed), rust-toolchain refs, Go ranges, the tools image and its tag, label mapping, called-workflow pairing, the Docker note.
  • New container test a_composite_actions_path_and_env_reach_the_job, run against Docker.
  • Ran a throwaway workflow on Docker: every tool is in the built image (gh 2.105), sudo -n true works, a symlinked fixture arrives as a link, and a windows-latest job runs as Linux.
  • cargo fmt, cargo clippy --workspace --all-targets, and cargo test --workspace with Docker running: still running when this PR was opened; results to follow in a comment.
  • Not run yet: the eight-repo sweep, including the click benchmark (11/11 before). It runs other projects' CI, so it's for the reviewer to run: scripts/conformance/compare_sweep.sh scripts/conformance/compare_runs.txt target/release/wrkflw.