Skip to content

Conversation

@danielibarrola
Copy link

This PR introduces caching support to the culprit_finder CLI 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 CulpritFinder now checks if a completed workflow run already exists for a given commit SHA before triggering a new one.

  • If a cached run is found and was successful, the commit is marked as "good".
  • If a cached run is found and failed, the commit is marked as "bad".
  • If no cached run exists (or caching is disabled), the tool proceeds to create a temporary branch and trigger a new workflow run as before.

Caching is enabled by default but can be disabled using the new --no-cache CLI flag.

Changes

  • CLI (culprit_finder/src/culprit_finder/cli.py):
    • Added --no-cache argument to the parser.
    • Passed the use_cache state to the CulpritFinder instance.
    • Added logging to indicate whether caching is being used.
  • Bisection Logic (culprit_finder/src/culprit_finder/culprit_finder.py):
    • Updated run_bisection to check for existing completed runs using the GitHub client before initiating a test.
    • Refactored _wait_for_workflow_completion and other methods to use keyword arguments for get_latest_run for better clarity.
  • GitHub Client (culprit_finder/src/culprit_finder/github.py):
    • Enhanced get_latest_run to support filtering by commit, event, and status.
    • Updated the underlying gh run list command to include these new filters.
  • Tests:
    • Added test_run_bisection_uses_cache to culprit_finder/tests/test_culprit_finder.py to verify that cached results prevent new tests from running.
    • Added test_run_bisection_mixed_cache to verify bisection works correctly with a mix of cached and non-cached commits.
    • Updated existing tests to accommodate the new use_cache parameter.

@danielibarrola danielibarrola force-pushed the feature/culprit-finder-runs-caching branch from 9a4e2a4 to 41dd590 Compare January 6, 2026 19:57
@danielibarrola danielibarrola force-pushed the feature/culprit-finder-runs-caching branch from 5fb4e13 to 6dfac3b Compare January 6, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant