Skip to content

LCORE-2334: use specific rule codes in type ignore comments#1791

Merged
tisnik merged 3 commits into
lightspeed-core:mainfrom
tisnik:lcore-2334-use-specific-rule-codes
May 25, 2026
Merged

LCORE-2334: use specific rule codes in type ignore comments#1791
tisnik merged 3 commits into
lightspeed-core:mainfrom
tisnik:lcore-2334-use-specific-rule-codes

Conversation

@tisnik
Copy link
Copy Markdown
Contributor

@tisnik tisnik commented May 25, 2026

Description

LCORE-2334: use specific rule codes in type ignore comments

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-2334

Summary by CodeRabbit

  • Tests
    • Updated type annotations in unit tests for authorization, configuration, and shield endpoints to improve type safety and maintainability.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d98ff0f2-2df7-476c-b324-9b6a076259b6

📥 Commits

Reviewing files that changed from the base of the PR and between 00c3e49 and d897e58.

📒 Files selected for processing (3)
  • tests/unit/app/endpoints/test_authorized.py
  • tests/unit/app/endpoints/test_config.py
  • tests/unit/utils/test_shields.py
📜 Recent review details
⏰ 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). (14)
  • GitHub Check: integration_tests (3.12)
  • GitHub Check: Pylinter
  • GitHub Check: spectral
  • GitHub Check: build-pr
  • GitHub Check: unit_tests (3.12)
  • GitHub Check: unit_tests (3.13)
  • GitHub Check: E2E: server mode / ci / group 2
  • GitHub Check: E2E: server mode / ci / group 1
  • GitHub Check: E2E: server mode / ci / group 3
  • GitHub Check: E2E: library mode / ci / group 1
  • GitHub Check: E2E: library mode / ci / group 2
  • GitHub Check: E2E: library mode / ci / group 3
  • GitHub Check: E2E Tests for Lightspeed Evaluation job
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
🧰 Additional context used
📓 Path-based instructions (1)
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

tests/**/*.py: Use pytest for all unit and integration tests; do not use unittest
Use pytest.mark.asyncio marker for async tests

Files:

  • tests/unit/app/endpoints/test_config.py
  • tests/unit/app/endpoints/test_authorized.py
  • tests/unit/utils/test_shields.py
🔇 Additional comments (6)
tests/unit/app/endpoints/test_authorized.py (1)

70-86: LGTM!

tests/unit/app/endpoints/test_config.py (1)

43-44: LGTM!

tests/unit/utils/test_shields.py (4)

299-299: LGTM!


355-356: LGTM!


580-581: LGTM!


597-600: LGTM!


Walkthrough

This PR refines type-ignore annotations across three test files to use the specific [index] parameter when accessing HTTPException.detail dictionary entries. All changes are formatting and type-annotation improvements with no alterations to test logic or coverage.

Changes

Type annotation refinements in test assertions

Layer / File(s) Summary
HTTPException detail indexing type annotations
tests/unit/app/endpoints/test_authorized.py, tests/unit/app/endpoints/test_config.py, tests/unit/utils/test_shields.py
Assertions accessing HTTPException.detail["response"] and HTTPException.detail["cause"] are updated to suppress the index type error specifically via # type: ignore[index] instead of generic type ignores. The change applies to unauthorized handler tests, configuration-not-loaded test, and multiple shield model/ID 404 tests across the test suite.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 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 accurately describes the main change: updating test files to use specific rule codes (e.g., [index]) in type ignore comments instead of generic type ignores.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% 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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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.

@tisnik tisnik merged commit 083d1ae into lightspeed-core:main May 25, 2026
31 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.

1 participant