Add caching support for workflow runs #108
Draft
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.
This PR introduces caching support to the
culprit_finderCLI and bisection logic. By reusing results from previous workflow runs for specific commits, the tool can significantly reduce the number of redundant GitHub Actions triggered, speeding up the bisection process.Description
The
CulpritFindernow checks if acompletedworkflow run already exists for a given commit SHA before triggering a new one.Caching is enabled by default but can be disabled using the new
--no-cacheCLI flag.Changes
culprit_finder/src/culprit_finder/cli.py):--no-cacheargument to the parser.use_cachestate to theCulpritFinderinstance.culprit_finder/src/culprit_finder/culprit_finder.py):run_bisectionto check for existing completed runs using the GitHub client before initiating a test._wait_for_workflow_completionand other methods to use keyword arguments forget_latest_runfor better clarity.culprit_finder/src/culprit_finder/github.py):get_latest_runto support filtering bycommit,event, andstatus.gh run listcommand to include these new filters.test_run_bisection_uses_cachetoculprit_finder/tests/test_culprit_finder.pyto verify that cached results prevent new tests from running.test_run_bisection_mixed_cacheto verify bisection works correctly with a mix of cached and non-cached commits.use_cacheparameter.