Repository navigation
refactor: the pod failure analysis checks each container in two flat steps - #460
Merged
Merged
Conversation
…steps The last SonarCloud complexity finding (22 against the allowed 15). The waiting reasons become a module constant instead of a dict built per container, and a container's state is read once; complexipy measures 13. Behavior and messages are unchanged; the 44 pod monitor unit tests pass.
HardMax71
enabled auto-merge (squash)
October 23, 2026 20:13
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
|
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.



Summary
The last SonarCloud issue from #459 that wasn't a false positive:
PodEventMapper._analyze_failurescores a cognitive complexity of 22 against the allowed 15 (issue). #459 replaced its twogetattrcalls but didn't flatten it.Changes
The waiting reasons become a module constant instead of a dict built for each container, and each container's state is read once, so the checks sit one level deep. Messages and error types stay the same, including both default messages.
Type of Change
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)uv run python -m scripts.export_openapiin backend/, thennpm run generate:apiin frontend/), never edited by handValidation: complexipy measures 13 (it measured 18 before), ruff and strict mypy pass, and the 44 pod monitor unit tests pass,
test_analyze_failure_variantsincluded.Checklist
pre-commit run --all-filesand all checks passSummary by cubic
Refactors pod failure analysis so its cognitive complexity drops from 22 to 13, under SonarCloud's limit of 15. The waiting-reason mapping is now a module constant instead of a dict built per container, and each container's state is read once so the checks sit one level deep. Behavior, messages, and error types are unchanged; all 44 pod monitor unit tests pass.
Written for commit d05ede2. Summary will update on new commits.