Skip to content

Conversation

@mulkieran
Copy link
Member

@mulkieran mulkieran commented Sep 29, 2025

Do not autogenerate. monkeytype imports Range from a hidden module in
justbytes and also makes return value of parse_range_or_current into a
Union type.

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran moved this to In Review in 2025September Sep 29, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 29, 2025

Walkthrough

Adds static type annotations and updates function/method signatures in src/stratis_cli/_parser/_logical.py, including explicit imports for typing and argparse. Alters the contracts for parse_range_or_current and FilesystemListOptions methods to use typed arguments and returns.

Changes

Cohort / File(s) Summary of changes
Type hints and signature updates
src/stratis_cli/_parser/_logical.py
- Added imports: ArgumentParser, Namespace, Optional, Tuple, Range.
- Updated parse_range_or_current(values: str) -> Tuple[Optional[Range], str].
- Updated FilesystemListOptions.__init__(self, _namespace: Namespace).
- Updated FilesystemListOptions.verify(self, namespace: Namespace, parser: ArgumentParser).
- Adjusted error/usage contract per new signatures.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my whiskers at typed delight,
Contracts snug, signatures tight.
Ranges parsed, namespaces neat—
Arguments line up, oh what a treat!
With gentle hops through code so bright,
This rabbit seals the types just right. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title succinctly and accurately describes the primary change by specifying that type annotations are being added to the _parser/_logical.py file, making it clear to reviewers what the main focus of the changeset is without excess detail or noise.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3f8a4e and b82090d.

📒 Files selected for processing (1)
  • src/stratis_cli/_parser/_logical.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/stratis_cli/_parser/_logical.py (2)
src/stratis_cli/_parser/_shared.py (3)
  • RejectAction (93-101)
  • parse_range (70-90)
  • verify (227-275)
src/stratis_cli/_parser/_pool.py (2)
  • verify (70-87)
  • verify (99-104)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test-runs (3.12)
  • GitHub Check: test-runs (3.13)
  • GitHub Check: check-typos
🔇 Additional comments (1)
src/stratis_cli/_parser/_logical.py (1)

30-38: Type signature matches CLI usage

The new Tuple[Optional[Range], str] annotation reflects the actual contract used by set_size_limit and keeps argparse happy for both range and "current" inputs.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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 and usage tips.

@mulkieran mulkieran merged commit 423ae20 into stratis-storage:master Sep 29, 2025
10 checks passed
@mulkieran mulkieran deleted the add-type-annotations branch September 29, 2025 17:46
@github-project-automation github-project-automation bot moved this from In Review to Done in 2025September Sep 29, 2025
@mulkieran mulkieran added this to the v3.9.0 milestone Sep 29, 2025
@mulkieran mulkieran moved this from Done to Done(5) in 2025September Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done(5)

Development

Successfully merging this pull request may close these issues.

1 participant