Skip to content

feat(PDRIVE-687): add mypy-based pre-commit hook for type checking - #131

Merged
sarad-rh merged 1 commit into
RedHatInsights:mainfrom
hoberger:PDRIVE-687
Aug 11, 2026
Merged

feat(PDRIVE-687): add mypy-based pre-commit hook for type checking#131
sarad-rh merged 1 commit into
RedHatInsights:mainfrom
hoberger:PDRIVE-687

Conversation

@hoberger

@hoberger hoberger commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Add a pre-commit hook that runs mypy to catch type errors at commit time. Reports all mypy errors, with [assignment] errors filtered to SafeCmdString violations only.

  • Add mypy.ini configuration for type checking
  • Add check_mypy.py wrapper with SafeCmdString-specific filtering
  • Add safecmdstring-mypy-check hook to .pre-commit-config.yaml
  • Add mypy to dev dependencies

Assisted-by: Claude Code (Claude Opus 4.6) noreply@anthropic.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of missing or invalid cluster resources and command output.
    • Ensured status checks consistently return clear boolean results.
    • Improved error details for network, DNS, Kubernetes, and storage validations.
    • Sanitized command output included in error messages.
  • Improvements

    • Resource lookups now provide clearer results for single and multiple resources.
    • Output formatting and resource parsing are more predictable.
  • Quality

    • Added automated type checking to identify potential issues earlier.
    • Updated validation guidance and examples for current resource lookup behavior.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request adds mypy tooling, separates single-resource and multi-resource Kubernetes API selection, updates callers and tests, and improves type annotations and structured error handling.

Changes

Mypy tooling and type contracts

Layer / File(s) Summary
Type checking and type contracts
.pre-commit-config.yaml, mypy.ini, pyproject.toml, tests/linters/check_mypy.py, src/in_cluster_checks/...
The repository adds mypy configuration, a development dependency, and a pre-commit hook. Source annotations now describe collector classes, rule classes, nullable values, report lists, and parsed resource lines.

Resource selection and runtime updates

Layer / File(s) Summary
Resource selection API
src/in_cluster_checks/utils/oc_api_utils.py
select_resources now returns lists. select_single_resource returns one object or None. Remote-shell inputs are validated before execution.
Caller migration and diagnostics
src/in_cluster_checks/core/operations.py, src/in_cluster_checks/rules/..., src/in_cluster_checks/core/exceptions.py, CONTRIBUTING.md, .claude/skills/new-rule/SKILL.md
Single-resource lookups use select_single_resource. Validation errors include structured context. Host IP calls pass evaluated values. Command output is sanitized.
Migration validation
tests/unit/utils/test_oc_api_utils.py, tests/rules/...
Tests mock select_single_resource for successful, missing-resource, and validation scenarios.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ValidationCollector
  participant OcApiUtils
  participant KubernetesAPI
  ValidationCollector->>OcApiUtils: select_single_resource(resource_type)
  OcApiUtils->>KubernetesAPI: object(ignore_not_found=True)
  KubernetesAPI-->>OcApiUtils: resource or None
  OcApiUtils-->>ValidationCollector: resource or None
Loading

Possibly related PRs

Suggested reviewers: sprizend-rh, liatpele-redhat, hoberger-rh, tkarbach

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a mypy-based pre-commit hook for type checking.
Docstring Coverage ✅ Passed Docstring coverage is 87.72% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/in_cluster_checks/rules/network/ovnk8s_validations.py (1)

35-46: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Propagate API failures instead of marking the prerequisite as unmet.

select_single_resource() can raise when the oc query fails. The broad except Exception catches that failure and returns PrerequisiteResult.not_met(...). This reports an API outage as an inapplicable rule and drops the original failure context. Catch only explicitly expected conditions, or let command failures propagate.

As per path instructions, unexpected command failures must propagate so the framework can report them as SKIP with context.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/in_cluster_checks/rules/network/ovnk8s_validations.py` around lines 35 -
46, Update the validation method containing the network_obj lookup and
network_type check so unexpected failures from select_single_resource()
propagate instead of being converted to PrerequisiteResult.not_met(). Remove the
broad Exception handling or narrow it to explicitly expected conditions, while
preserving the existing not-met results for a missing resource and
non-OVNKubernetes network type.

Source: Path instructions

🧹 Nitpick comments (4)
tests/linters/check_mypy.py (1)

13-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Annotate main with its return type.

Use def main() -> None:. The function has no value return.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/linters/check_mypy.py` around lines 13 - 14, Update the main function
signature to explicitly declare a None return type, preserving its existing
behavior and implementation.

Source: Coding guidelines

src/in_cluster_checks/runner.py (1)

64-65: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Give node_executors a concrete mapping type.

dict | None accepts arbitrary key and value types. It does not let Mypy validate the mapping passed to domain.verify() at Line 207. If build_host_executors() returns dict[str, NodeExecutor], use that type for the attribute.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/in_cluster_checks/runner.py` around lines 64 - 65, Update the
node_executors attribute declaration in the runner class to use the concrete
type dict[str, NodeExecutor] | None, matching build_host_executors() and
enabling type checking when passed to domain.verify().

Source: Coding guidelines

pyproject.toml (1)

37-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align the Mypy lower bound with Python 3.12.

mypy.ini sets python_version = 3.12, but mypy>=1.0.0 permits older releases. Verify the first Mypy release that supports this target. Raise the lower bound or pin the development environment to a compatible version.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` at line 37, Update the Mypy dependency entry in
pyproject.toml to require the first release compatible with the Python 3.12
target configured by mypy.ini, rather than allowing older incompatible versions;
preserve the existing development dependency format.
src/in_cluster_checks/core/printer.py (1)

314-320: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align the docstrings with the list contract.

At Line 314 and Line 388, the annotations use List[Dict[str, Any]]. The docstrings still describe a dictionary and show an in_cluster_rules wrapper. InClusterCheckRunner.run passes the list directly to the output methods at Lines 214-221. Update the argument and return documentation to show a list of report dictionaries.

Suggested documentation update
-            results: Dictionary with rule results in Insights format
+            results: List of report dictionaries in Insights format

-            Formatted results dictionary:
+            Formatted list of report dictionaries:

Also applies to: 388-416

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/in_cluster_checks/core/printer.py` around lines 314 - 320, Update the
docstrings for print_to_json and the corresponding output method near line 388
to match their List[Dict[str, Any]] contracts: describe results as a list of
report dictionaries and remove references to a dictionary or in_cluster_rules
wrapper. Ensure any return documentation also reflects the list-based report
output, without changing implementation behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/in_cluster_checks/core/operations.py`:
- Around line 474-475: Update the code around select_single_resource to handle a
None network_obj before accessing model.spec.defaultNetwork.type. Return an
appropriate absent-resource result or explicitly enforce that the resource
exists, while preserving the current type lookup when present.

In `@src/in_cluster_checks/rules/k8s/k8s_validations.py`:
- Around line 253-258: Update the UnExpectedSystemOutput construction in the pod
timestamp parsing error path to populate ip with the actual executor address
from self.get_host_ip() instead of an empty string, while preserving the
existing command, output, message, and exception chaining.

In `@src/in_cluster_checks/rules/network/dns_validations.py`:
- Line 18: Restore the ClassVar import and annotate the mutable class attributes
objective_hosts, supported_profiles, and links with their existing collection
types using ClassVar, resolving Ruff RUF012 while preserving their current
values and behavior.
- Around line 46-51: Update the failure handling around run_oc_command and
UnExpectedSystemOutput to preserve both returned streams: combine
dns_config_output with stderr and pass the combined raw output in the exception
context, while retaining the existing command, host, and message details.

In `@tests/linters/check_mypy.py`:
- Around line 19-33: Update the Mypy subprocess handling around subprocess.run
and the errors filtering loop so it fails closed: distinguish diagnostics
intentionally excluded by the existing SafeCmdString rule from absent or
unrecognized stdout/stderr output, configuration or CLI failures, and other
non-zero return codes. When the result is not a clean run with all diagnostics
intentionally filtered, print stderr and propagate a non-zero exit status;
preserve the current success behavior only when no errors occurred or every
detected Mypy diagnostic was explicitly excluded.

In `@tests/rules/network/test_ovs_validations.py`:
- Around line 180-181: Remove the class-level mutation of
DataCollectorScenarioParams in the scenarios setup: do not assign
tested_object_mock_dict on shared scenarios[0] and scenarios[1] objects.
Construct each scenario, including its oc_api.select_single_resource Mock,
within test setup or otherwise create fresh per-test scenario instances so no
mutable mock state is shared across parametrized tests.

---

Outside diff comments:
In `@src/in_cluster_checks/rules/network/ovnk8s_validations.py`:
- Around line 35-46: Update the validation method containing the network_obj
lookup and network_type check so unexpected failures from
select_single_resource() propagate instead of being converted to
PrerequisiteResult.not_met(). Remove the broad Exception handling or narrow it
to explicitly expected conditions, while preserving the existing not-met results
for a missing resource and non-OVNKubernetes network type.

---

Nitpick comments:
In `@pyproject.toml`:
- Line 37: Update the Mypy dependency entry in pyproject.toml to require the
first release compatible with the Python 3.12 target configured by mypy.ini,
rather than allowing older incompatible versions; preserve the existing
development dependency format.

In `@src/in_cluster_checks/core/printer.py`:
- Around line 314-320: Update the docstrings for print_to_json and the
corresponding output method near line 388 to match their List[Dict[str, Any]]
contracts: describe results as a list of report dictionaries and remove
references to a dictionary or in_cluster_rules wrapper. Ensure any return
documentation also reflects the list-based report output, without changing
implementation behavior.

In `@src/in_cluster_checks/runner.py`:
- Around line 64-65: Update the node_executors attribute declaration in the
runner class to use the concrete type dict[str, NodeExecutor] | None, matching
build_host_executors() and enabling type checking when passed to
domain.verify().

In `@tests/linters/check_mypy.py`:
- Around line 13-14: Update the main function signature to explicitly declare a
None return type, preserving its existing behavior and implementation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e8d628e-1065-4968-b266-47716aa262d8

📥 Commits

Reviewing files that changed from the base of the PR and between ddf31c9 and a19f3e5.

📒 Files selected for processing (24)
  • .pre-commit-config.yaml
  • mypy.ini
  • pyproject.toml
  • src/in_cluster_checks/core/data_collector_runner.py
  • src/in_cluster_checks/core/operations.py
  • src/in_cluster_checks/core/printer.py
  • src/in_cluster_checks/core/rule.py
  • src/in_cluster_checks/rules/hw_fw_details/hw_fw_base.py
  • src/in_cluster_checks/rules/k8s/k8s_validations.py
  • src/in_cluster_checks/rules/network/dns_validations.py
  • src/in_cluster_checks/rules/network/nmstate_validations.py
  • src/in_cluster_checks/rules/network/ovnk8s_validations.py
  • src/in_cluster_checks/rules/network/ovs_base.py
  • src/in_cluster_checks/rules/resources_utilization/resources_utilization.py
  • src/in_cluster_checks/rules/storage/storage_validations.py
  • src/in_cluster_checks/runner.py
  • src/in_cluster_checks/utils/oc_api_utils.py
  • src/in_cluster_checks/utils/parsing_utils.py
  • tests/linters/check_mypy.py
  • tests/rules/k8s/test_k8s_validations.py
  • tests/rules/network/test_ovnk8s_validations.py
  • tests/rules/network/test_ovs_validations.py
  • tests/rules/storage/test_storage_validations.py
  • tests/unit/utils/test_oc_api_utils.py

Comment thread src/in_cluster_checks/core/operations.py
Comment thread src/in_cluster_checks/rules/k8s/k8s_validations.py
Comment thread src/in_cluster_checks/rules/network/dns_validations.py
Comment thread src/in_cluster_checks/rules/network/dns_validations.py
Comment thread tests/linters/check_mypy.py
Comment thread tests/rules/network/test_ovs_validations.py Outdated
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@hoberger
hoberger force-pushed the PDRIVE-687 branch 2 times, most recently from 85bd270 to 29852e0 Compare August 10, 2026 09:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/in_cluster_checks/rules/k8s/k8s_validations.py (2)

206-219: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Do not report PASSED after an incomplete pod scan.

When a namespace query fails, continue removes that namespace from validation. When a namespace exceeds the limit, slicing removes the remaining pods. run_rule() can then return RuleResult.passed() even though infrastructure pods were not checked.

Raise UnExpectedSystemOutput for required query failures. For truncated results, propagate an incomplete-scan state and return warning or skip, or paginate through all pods. Replace self.logger with framework-managed result handling.

As per coding guidelines, rules must not use self.logger.
As per path instructions, required query failures must become UnExpectedSystemOutput.
Based on learnings, required query failures must propagate instead of being silently skipped.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/in_cluster_checks/rules/k8s/k8s_validations.py` around lines 206 - 219,
Update the pod validation flow in run_rule() to propagate required namespace
query failures as UnExpectedSystemOutput instead of continuing, and replace
self.logger usage with framework-managed result handling. Do not silently
discard pods when pod_objects exceeds MAX_PODS_PER_NAMESPACE: either paginate
all results or carry an incomplete-scan state that prevents RuleResult.passed()
and returns warning or skip.

Sources: Coding guidelines, Path instructions, Learnings


534-539: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Propagate malformed namespace timestamps.

If deletionTimestamp is malformed, this fallback classifies the namespace as not recently terminating and returns a warning. Raise UnExpectedSystemOutput with the namespace, raw timestamp, and command context instead of returning False, consistent with _is_old_pod().

As per path instructions, unexpected system output must propagate with diagnostic context instead of using a fallback value.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/in_cluster_checks/rules/k8s/k8s_validations.py` around lines 534 - 539,
Update the namespace termination timestamp handling in the shown validation
method: when parsing deletionTimestamp raises ValueError or AttributeError,
raise UnExpectedSystemOutput instead of returning False. Include the namespace,
raw deletion timestamp, and command context in the exception, matching the
diagnostic propagation behavior of _is_old_pod().

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/in_cluster_checks/utils/oc_api_utils.py`:
- Around line 394-418: Restore field_selector to select_resources and forward it
to _log_and_build_selector_kwargs using explicit keyword arguments, ensuring
all_namespaces is passed to the correct parameter. Update the sibling call in
src/in_cluster_checks/utils/oc_api_utils.py lines 433-457 similarly; both
affected sites require changes.

---

Outside diff comments:
In `@src/in_cluster_checks/rules/k8s/k8s_validations.py`:
- Around line 206-219: Update the pod validation flow in run_rule() to propagate
required namespace query failures as UnExpectedSystemOutput instead of
continuing, and replace self.logger usage with framework-managed result
handling. Do not silently discard pods when pod_objects exceeds
MAX_PODS_PER_NAMESPACE: either paginate all results or carry an incomplete-scan
state that prevents RuleResult.passed() and returns warning or skip.
- Around line 534-539: Update the namespace termination timestamp handling in
the shown validation method: when parsing deletionTimestamp raises ValueError or
AttributeError, raise UnExpectedSystemOutput instead of returning False. Include
the namespace, raw deletion timestamp, and command context in the exception,
matching the diagnostic propagation behavior of _is_old_pod().
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c38aefa2-7eb1-4225-ae42-f9ef9b44fe96

📥 Commits

Reviewing files that changed from the base of the PR and between 85bd270 and 29852e0.

📒 Files selected for processing (8)
  • .claude/skills/new-rule/SKILL.md
  • pyproject.toml
  • src/in_cluster_checks/rules/k8s/k8s_validations.py
  • src/in_cluster_checks/rules/network/ovnk8s_validations.py
  • src/in_cluster_checks/utils/oc_api_utils.py
  • tests/rules/k8s/test_k8s_validations.py
  • tests/rules/network/test_ovnk8s_validations.py
  • tests/unit/utils/test_oc_api_utils.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • .claude/skills/new-rule/SKILL.md
  • src/in_cluster_checks/rules/network/ovnk8s_validations.py
  • tests/unit/utils/test_oc_api_utils.py
  • pyproject.toml
  • tests/rules/network/test_ovnk8s_validations.py
  • tests/rules/k8s/test_k8s_validations.py

Comment thread src/in_cluster_checks/utils/oc_api_utils.py Outdated
@hoberger

hoberger commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Regarding the two "outside diff range" comments from the review summary:

1. _is_recently_terminating malformed deletionTimestamp (lines 534-539)

The deletionTimestamp is set by the Kubernetes API server in RFC 3339 format — a malformed value here would mean the API server itself is broken, which is extremely unlikely in practice.

More importantly, return False is the safer behavior here. It means "not recently terminating," so the namespace still gets added to the warning list. The user is informed about the stuck Terminating namespace.

Raising UnExpectedSystemOutput would cause the entire rule to SKIP — all namespace validation would stop because of one bad timestamp. That's a worse outcome than the current conservative default.

This differs from _is_old_pod where a parse failure could silently hide a problematic pod. Here, the namespace is already known to be Terminating — the timestamp only controls whether to suppress the warning, and defaulting to "show the warning" is the safe choice.

2. _get_pods_lists incomplete pod scan (lines 206-219)

The except OpenShiftPythonException: continue is intentional — some INFRA_NAMESPACES are networking-stack dependent (e.g., openshift-sdn only exists on SDN clusters, not OVN-Kubernetes) and may not exist on every cluster. Created PDRIVE-903 to investigate which namespaces should be mandatory vs optional and handle them differently. The self.logger usage will also be addressed as part of that ticket.

@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.90805% with 14 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@fd2531b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/in_cluster_checks/utils/oc_api_utils.py 77.41% 7 Missing ⚠️
...luster_checks/rules/network/nmstate_validations.py 0.00% 3 Missing ⚠️
src/in_cluster_checks/rules/k8s/k8s_validations.py 50.00% 1 Missing ⚠️
...in_cluster_checks/rules/network/dns_validations.py 80.00% 1 Missing ⚠️
...cluster_checks/rules/network/ovnk8s_validations.py 50.00% 1 Missing ⚠️
...luster_checks/rules/storage/storage_validations.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #131   +/-   ##
=======================================
  Coverage        ?   86.48%           
=======================================
  Files           ?       57           
  Lines           ?     6606           
  Branches        ?        0           
=======================================
  Hits            ?     5713           
  Misses          ?      893           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/in_cluster_checks/utils/oc_api_utils.py`:
- Around line 350-357: The selector-related annotations in
_log_and_build_selector_kwargs should be fully parameterized: use
list[oc.APIObject] (or the project’s documented API-object type) for selected
resources and specify Dict[str, str] | None for label_selector and
field_selector. Preserve the existing selector behavior while replacing bare
collection/dictionary types.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c9c95c74-e1f3-4040-b5d0-bae49a81e064

📥 Commits

Reviewing files that changed from the base of the PR and between 29852e0 and 937e566.

📒 Files selected for processing (2)
  • pyproject.toml
  • src/in_cluster_checks/utils/oc_api_utils.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml

Comment thread src/in_cluster_checks/utils/oc_api_utils.py
@hoberger
hoberger force-pushed the PDRIVE-687 branch 3 times, most recently from 8532019 to 2867acb Compare August 11, 2026 07:58
Add a pre-commit hook that runs mypy to catch type errors at commit
time. Reports all mypy errors, with [assignment] errors filtered to
SafeCmdString violations only.

- Add mypy.ini configuration for type checking
- Add check_mypy.py wrapper with SafeCmdString-specific filtering
- Add safecmdstring-mypy-check hook to .pre-commit-config.yaml
- Add mypy to dev dependencies

Assisted-by: Claude Code (Claude Opus 4.6) <noreply@anthropic.com>
@sarad-rh
sarad-rh merged commit 43c02b3 into RedHatInsights:main Aug 11, 2026
5 checks passed
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.

3 participants