Add Dry Run Mode to Culprit Finder#112
Open
danielibarrola wants to merge 1 commit intogoogle-ml-infra:feature/culprit-finderfrom
Open
Add Dry Run Mode to Culprit Finder#112danielibarrola wants to merge 1 commit intogoogle-ml-infra:feature/culprit-finderfrom
danielibarrola wants to merge 1 commit intogoogle-ml-infra:feature/culprit-finderfrom
Conversation
08d2280 to
c3ce76d
Compare
b93fb74 to
c5544f6
Compare
c5544f6 to
033681e
Compare
033681e to
bae64d9
Compare
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.
This pull request introduces a Dry Run mode to the Culprit Finder tool. This feature allows users to simulate the bisection process and see exactly which GitHub API calls would be executed without actually triggering workflows, creating branches, or deleting them.
Key Changes
1. Command-Line Interface
--dry-runflag to the CLI.2.
DryRunGithubClientImplementationDryRunGithubClientclass ingithub_client.pythat wraps the standardGithubClient.trigger_workflow,create_branch, anddelete_branchare intercepted and replaced with logging statements.compare_commitsandget_workflowcontinue to use the real client to fetch metadata required for the simulation.unittest.mockto generate simulatedWorkflowRunandWorkflowJobobjects, allowing the bisection logic to proceed through its state transitions.3. Core Logic Integration
culprit_finder.pyto accept either the standard or the dry-run client via type hinting.cli.py, the application now conditionally instantiates theDryRunGithubClientbased on the user's input.4. Testing & Documentation
test_culprit_finder.pyto ensure that dry-run mode correctly avoids calling write-heavy methods on the real GitHub client.README.mdto document the new--dry-runflag.How to use
Run the tool with the
--dry-runflag to preview the bisection steps: