Skip to content

release: py-1.13.6 — nplusone sliced and nested loops - #171

Merged
FROWNINGdev merged 1 commit into
mainfrom
release/py-1.13.6
Oct 28, 2026
Merged

FROWNINGdev merged 1 commit into
mainfrom
release/py-1.13.6

Conversation

@FROWNINGdev

@FROWNINGdev FROWNINGdev commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Python-only release (no extension changes).

Test plan

Closes nothing new: #145 and #146 are already closed by #167 and #168.

Summary by CodeRabbit

  • Bug Fixes
    • N+1 detection now identifies loops over sliced QuerySets, including nested slices, and provides an eager-loading suggestion.
  • Documentation
    • Updated pre-commit examples and guidance to reference version 1.13.6, including notes on sliced QuerySets and deeper relation checks.
  • Chores
    • Updated package and integration version information to 1.13.6.

- nplusone reports loops over sliced querysets (#167) and now also
  unwraps a slice of a slice (qs[:50][:10]).
- Nested loops inherit the outer queryset's eager loading and suggest the
  full relation path such as product__category (#168).
- Agent skill 1.2.0: Playbook D says which release links inner loops to an
  outer prefetch, and keeps the manual checks for older releases.
- Tests import unittest.mock directly (CodeQL py/import-and-import-from).
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The scanner now unwraps nested QuerySet slices before resolving loop sources, and a regression test checks the resulting finding and eager-loading suggestion. Release metadata, pre-commit examples, changelog, and skill guidance were updated for version 1.13.6.

Changes: QuerySet Slice Detection

Layer / File(s) Summary
Nested slice scanning and regression coverage
cli/django_orm_lens/query_analyzer.py, cli/tests/test_nplusone_detector.py, cli/tests/test_mcp_server.py, CHANGELOG.md
The scanner repeatedly unwraps nested subscript nodes. A regression test checks that a twice-sliced QuerySet loop reports the author finding and suggests select_related("author"). The MCP server test now uses unittest.mock.patch.object.
Version metadata and release guidance
cli/pyproject.toml, cli/server.json, smithery.yaml, README.md, cli/README.md, docs/i18n/README.*.md, skills/django-orm-lens/SKILL.md
Version metadata and pre-commit examples now use 1.13.6. The skill guidance describes scan behavior by version and adds manual checks for dynamically built or multi-function QuerySets.

Priority: Not assessed

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

Change: Bug fix

Possibly related PRs

Suggested reviewers: syedmustafan

Merge Risk: Low · up to 394c5

Users may run a different analyzer version than the documented 1.13.6 release, producing inconsistent scan behavior.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@FROWNINGdev
FROWNINGdev merged commit ce15bd8 into main Oct 28, 2026
18 checks passed
@FROWNINGdev
FROWNINGdev deleted the release/py-1.13.6 branch October 28, 2026 04:56
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