Skip to content

refactor(config): delete dead _resolve_backend (LAB-2521) - #273

Open
27Bslash6 wants to merge 1 commit into
mainfrom
lab-2521-delete-dead-resolve-backend
Open

refactor(config): delete dead _resolve_backend (LAB-2521)#273
27Bslash6 wants to merge 1 commit into
mainfrom
lab-2521-delete-dead-resolve-backend

Conversation

@27Bslash6

@27Bslash6 27Bslash6 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • _resolve_backend() in src/cachekit/config/decorator.py was called only by its own dedicated test module — never by production code. Live backend resolution runs through DI container -> DefaultBackendProvider (backends/provider.py), and on the decorator path specifically via set_default_backend()/get_default_backend() (both kept, unchanged, still called from decorators/intent.py).
  • This dead function's complete docstring and full passing test suite previously misled a security review (LAB-749) into a false claim about production behavior.
  • Deletes the function, its _UNSET sentinel, and the now-orphaned tests/unit/config/test_backend_resolution.py. No behavior change.

Verification

  • grep -rn "_resolve_backend" . (repo-wide, incl. docs) returns zero hits.
  • Full test suite green (pytest, excluding tests/fuzzing which needs atheris and tests/integration/saas/* which need a live worker on localhost:8787 — both pre-existing environment gaps, unaffected by this diff; confirmed the tests/integration/saas/test_sdk_e2e.py failure reproduces identically on main and the one flaky test_statistical_rigor.py timing test passed clean in isolation).
  • ruff check, ruff format --check, and basedpyright all clean.
  • tests/unit/config/ (83 tests, incl. doctest examples for set_default_backend/get_default_backend) passes.
  • Expert-panel review (bug-hunter-supreme, security-specialist, code-craftsman, catchphrase-agent) run — no blocking findings against this diff. Panel surfaced pre-existing (unrelated) backend-resolution doc imprecision in docs/api-reference.md and several DecoratorConfig docstrings, predating this ticket by weeks — filed as a separate follow-up, LAB-2694, per this ticket's own scope carve-out against re-litigating LAB-749's docs content.

Test plan

  • pytest tests/unit/config/ green
  • Full suite green modulo pre-existing environment gaps (fuzzing/atheris, live SaaS worker)
  • ruff check, ruff format --check, basedpyright clean
  • Repo-wide grep for _resolve_backend returns zero hits

Summary by CodeRabbit

  • Changes

    • Backend configuration handling has been simplified, with automatic backend resolution and related validation removed from this component.
    • The associated backend-resolution test coverage has been removed.
  • Chores

    • Updated the secrets baseline metadata to reflect current finding locations and generation details.

Called only by its own dedicated test module, never by production code. Live resolution runs through DI container to DefaultBackendProvider, and on the decorator path via set_default_backend/get_default_backend (both kept, still called from decorators/intent.py). Deletes the function, its UNSET sentinel, and the now-orphaned tests/unit/config/test_backend_resolution.py. No behavior change.
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 2f1dd751-8d88-4fa8-bd2e-f8294a60a48f

📥 Commits

Reviewing files that changed from the base of the PR and between f7e236b and 020b8a7.

📒 Files selected for processing (3)
  • .secrets.baseline
  • src/cachekit/config/decorator.py
  • tests/unit/config/test_backend_resolution.py
💤 Files with no reviewable changes (2)
  • tests/unit/config/test_backend_resolution.py
  • src/cachekit/config/decorator.py

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


Walkthrough

The change removes local backend resolution from the decorator, deletes its backend resolution tests, and updates the secrets baseline line number and generation timestamp.

Changes

Backend resolution changes

Layer / File(s) Summary
Remove local backend resolution
src/cachekit/config/decorator.py, tests/unit/config/test_backend_resolution.py
The decorator no longer defines _UNSET or _resolve_backend. The backend resolution test module is deleted.
Update baseline metadata
.secrets.baseline
The recorded decorator finding line changes from 567 to 508. The generation timestamp is updated.

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

Merge Risk: ⚪ Minimal · up to 020b8

This PR removes unused backend-resolution code and its dedicated tests without changing the live backend resolution path. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removal of the unused _resolve_backend function. It is concise and specific.
Description check ✅ Passed The description explains the change, motivation, scope, verification, tests, and known environment limits. It does not use all template headings or checkboxes, but it provides the required information…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Description check

Explanation

The description explains the change, motivation, scope, verification, tests, and known environment limits. It does not use all template headings or checkboxes, but it provides the required information in substance.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lab-2521-delete-dead-resolve-backend

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

@kodus-27b

kodus-27b Bot commented Sep 2, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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