Skip to content

Improve GET /config test coverage - #495

Open
ThisIsMissEm wants to merge 1 commit into
mainfrom
emelia/improve-config-endpoint-test-coverage
Open

Improve GET /config test coverage#495
ThisIsMissEm wants to merge 1 commit into
mainfrom
emelia/improve-config-endpoint-test-coverage

Conversation

@ThisIsMissEm

@ThisIsMissEm ThisIsMissEm commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

This improves the test coverage for GET /config, and removes the usage of pop which was raising code quality issues.

Checklist

  • Tests pass locally
  • uv run ruff check . passes (no unused imports or other lint errors)
  • uv tool run fawltydeps --check-unused --pyenv .venv passes (no unused dependencies)
  • Updated CHANGELOG.md with my changes, if notable (refer to Keep a Changelog conventions)

Summary by CodeRabbit

  • Tests
    • Updated configuration endpoint tests to verify the complete response contract, including user information, available actions, rule mappings, and related fields.
    • Removed destructive field-by-field response checks in favor of validating the full returned configuration.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 9ca203c9-5446-40a8-9a70-ee3e4956ae84

📥 Commits

Reviewing files that changed from the base of the PR and between cd32376 and 82065bc.

📒 Files selected for processing (1)
  • osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_config.py

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The UI configuration test now validates the complete response contract directly. It checks the exact key set and field values without removing entries from the response body.

Changes

UI configuration contract

Layer / File(s) Summary
Complete response assertions
osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_config.py
The test asserts the exact response keys and validates configuration fields directly from body. It removes destructive pop calls and the final empty-body assertion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 82065

This change strengthens GET /config response-contract coverage without changing production behavior. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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: improved test coverage for the GET /config endpoint.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch emelia/improve-config-endpoint-test-coverage

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.

@ThisIsMissEm ThisIsMissEm mentioned this pull request Sep 4, 2026
4 tasks
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