Skip to content

Add Claude AI code review workflow#14708

Open
AviadP wants to merge 1 commit intored-hat-storage:masterfrom
AviadP:add-claude-review-workflow
Open

Add Claude AI code review workflow#14708
AviadP wants to merge 1 commit intored-hat-storage:masterfrom
AviadP:add-claude-review-workflow

Conversation

@AviadP
Copy link
Contributor

@AviadP AviadP commented Mar 17, 2026

  • Add GitHub Actions workflow triggered by claude-review label or @claude comment
  • Add review guide with severity calibration (BLOCKER/HIGH/MEDIUM/LOW) for ocs-ci rules
  • Advisory only (comment mode) — never blocks PRs
  • Critical rules enforced: specific exceptions, centralized locators, no yield fixtures, tier marker conflicts, teardown required, version-agnostic selectors

to decide:

  • where to place the reviewer tool (should be under our organization, in my opinion)
  • make it mandatory or not
  • rules is just a suggestion, open for discussion

review tool link

Signed-off-by: Aviadp <apolak@redhat.com>
@AviadP AviadP requested a review from a team as a code owner March 17, 2026 13:03
@pull-request-size pull-request-size bot added the size/L PR that changes 100-499 lines label Mar 17, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 17, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AviadP

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


These violate critical project rules and must always be flagged:

- `except Exception` or bare `except:` — must use specific exceptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l don't see this as blocker, sometime we use this.

We definitely should not allow diabolic anti pattern like:

except Exception:
    pass

Better to always use specific exception whenever it's possible, but sometimes there are so many possibilities that catching generic Exception is only one solution to avoid many different unpredictable exceptions.

Copy link
Contributor Author

@AviadP AviadP Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tool should only add comments, not change requests, so it is not real blocker. using braod exceptions makes debug much harder and sometimes lets test that should fail to pass

max-files: '40'
context-intro: >
You are reviewing a PR in ocs-ci — a Python/pytest testing framework
for Red Hat OpenShift Container Storage (OCS/ODF). The codebase uses
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change to something like this

Suggested change
for Red Hat OpenShift Container Storage (OCS/ODF). The codebase uses
for Red Hat OpenShift Data Foundation (ODF) formerly known as OpenShift Container Storage OCS. The codebase uses

has strict conventions for locator placement, exception handling, and
test teardown. Read the project CLAUDE.md for full conventions.
critical-rules: |
1. Never use `except Exception` or bare `except:` — always use specific exceptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As pointed bellow , this probably should not be a blocker. But if it's used we should log the exception out:

logger.error("Exception hit:", exc_info=True)

something like this. So if something will debugged we see what is happening.

critical-rules: |
1. Never use `except Exception` or bare `except:` — always use specific exceptions
2. UI locators MUST be centralized in `ocs_ci/ocs/ui/views.py` (unless the locator contains a variable)
3. Fixtures MUST NOT use `yield` — use `request.addfinalizer()` instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why yield is not acceptable? I think it's a valid scenario which we use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- `except Exception` or bare `except:` — must use specific exceptions
- UI locators defined outside `ocs_ci/ocs/ui/views.py` (unless the locator contains a variable)
- Fixtures using `yield` — must use `request.addfinalizer()` instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pointed out above, this is valid case to use yield

@AviadP AviadP requested a review from shylesh March 18, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code/Infra size/L PR that changes 100-499 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants