fix(rollback): use == instead of is for boolean check in execute_roll…#1207
Merged
paigerube14 merged 4 commits intokrkn-chaos:mainfrom Mar 30, 2026
Merged
fix(rollback): use == instead of is for boolean check in execute_roll…#1207paigerube14 merged 4 commits intokrkn-chaos:mainfrom
paigerube14 merged 4 commits intokrkn-chaos:mainfrom
Conversation
Review Summary by QodoFix boolean comparison in rollback handler
WalkthroughsDescription• Replace identity comparison (is False) with equality comparison (== False) • Fix unreliable boolean check in execute_rollback_version_files() function • Add Apache License 2.0 header to file • Fix indentation inconsistency in conditional block Diagramflowchart LR
A["Identity comparison<br/>is False"] -->|"Replace with"| B["Equality comparison<br/>== False"]
B -->|"Result"| C["Reliable boolean check<br/>in execute_rollback_version_files"]
File Changes1. krkn/rollback/handler.py
|
Code Review by Qodo
1. False equality regression
|
…back_version_files Signed-off-by: Nitesh <nitesh@example.com>
1ae13d9 to
a03b2a8
Compare
…add license header Signed-off-by: Nitesh <nitesh@example.com>
paigerube14
added a commit
to paigerube14/kraken
that referenced
this pull request
Mar 31, 2026
krkn-chaos#1207) * fix(rollback): use == instead of is for boolean check in execute_rollback_version_files Signed-off-by: Nitesh <nitesh@example.com> * fix(rollback): fix indentation in execute_rollback_version_files and add license header Signed-off-by: Nitesh <nitesh@example.com> --------- Signed-off-by: Nitesh <nitesh@example.com> Co-authored-by: Nitesh <nitesh@example.com> Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
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.
What does this PR do?
Fixes an incorrect boolean check in
execute_rollback_version_files().Type of change
Description
This PR fixes a bug caused by improper boolean comparison in
execute_rollback_version_files().Previously, the condition used identity comparison (
is False) on a boolean:RollbackConfig().auto is False.This is unreliable because identity comparison should not be used for boolean values.
It could result in unintended behavior where auto-rollback executes even when disabled.
The fix replaces it with a proper boolean check:
if not RollbackConfig().autoRelated Tickets & Documents
Documentation
Related Documentation PR (if applicable)
N/A
Checklist before requesting a review
REQUIRED:
Description of combination of tests performed and output of run
Tested the rollback functionality manually by toggling the
autoflag in configuration:auto = False, rollback is correctly skipped.auto = True, rollback executes as expected.