Repository navigation
Add cigen replay: estimate skipping from git history - #59
Open
ndbroadbent wants to merge 1 commit into
Open
ndbroadbent wants to merge 1 commit into
ndbroadbent wants to merge 1 commit into
Conversation
cigen replay walks a range of first-parent commits (<from>..<to> or --last N), checks each out in a temporary worktree, hashes every job with hashing::hash_job (so it matches CI), and counts a run as skipped when the same job and hash ran on an earlier commit and its marker hasn't gone 7 days unused by commit date (a hit refreshes it; --no-expiry turns that off). It is an estimate and says so: every run is assumed to pass, and workflow triggers, pull requests and matrix combinations aren't modelled. --config applies one config to every commit, for projects whose history has none (the case-study mode); otherwise commits with no config, or one this cigen can't load, are listed and left out. --workflow picks workflows, --durations estimates minutes saved, and --format json gives the full report with its model. tests/replay.rs builds histories with set commit dates and checks exact counts, including a lockfile change that must run. Docs: a new Estimate skipping page, the CLI page, overview and roadmap. STATUS updated.
This branch has not been deployed
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.
Adds
cigen replay, which estimates how many job runs cigen would have skipped over a project's git history, without running any CI.cigen replay --last 100 --workflow ci cigen replay v1.2.0..main --format json cigen replay --last 200 --config ../my-cigen.yml # a project whose history has no cigen configHow it works
<from>..<to>or--last N), checking each one out in a temporary worktree that it removes afterwards.hashing::hash_job(from Add cigen explain <job>: what a job's hash covers #14), the same functioncigen hash --jobandcigen explainuse. Modules, derived inputs and the hashes of the jobs a jobneedsare all included, as they are in CI.--no-expiryturns expiry off.cigen::git::command, so a checkout owned by another user works.--workflowpicks the workflows to replay;--durationsestimates the minutes saved;--format jsonprints the full report and the model behind it.What the estimate assumes
The output says this, and so does the new Estimate skipping page:
Tests
tests/replay.rsbuilds histories with set commit dates and checks exact counts. A lockfile change must run, a revert skips, a definition change runs, a marker expires and a hit refreshes it. It also covers ranges,--config,--workflow, durations and leftover worktrees.tests/replay_needs.rs: a job reruns when a job itneedschanged. I checked that it fails with the needed jobs' hashes left out of the digest.Rebase notes
This was written before #14 and modules landed. Rebased onto main:
hash_jobtakes the newmodules_digestandmatrix_entryarguments asNone, so it uses this cigen's modules digest and no matrix entry.cigen explain), the overview, the roadmap and the new replay page. STATUS is updated.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.