Skip to content

test(signature): definition and renamed-parameter tests for change_signature (#1533, 8/9) - #2165

Merged
vitali87 merged 1 commit into
pr-split/split-1912-change-signature/pr-7from
pr-split/split-1912-change-signature/pr-8
Oct 30, 2026
Merged

vitali87 merged 1 commit into
pr-split/split-1912-change-signature/pr-7from
pr-split/split-1912-change-signature/pr-8

Conversation

@vitali87

@vitali87 vitali87 commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds codebase_rag/tests/test_change_signature_definition.py: the definition's new parameter list (literal types, parameter ordering, special parameters, non-Python refusals) and parameters renamed where the body reads them.
  • Tests only: no production code changes.

Demo

No user-visible change: adds the definition and renamed-parameter tests for change_signature.

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring (no functional changes)
  • Documentation
  • CI/CD or tooling
  • Dependencies

None of these applies: the change adds tests only.

Related Issues

Part of #1533 (split from #1912; stack: #2163 → #2161 → #2162 → #2166 → #2164 → #2169 → #2168 → #2165 → #2167).

Test Plan

  • Unit tests pass (make test-parallel or uv run pytest -n auto -m "not integration")

  • New tests added

  • Integration tests pass (make test-integration, requires Docker)

  • Manual testing (describe below)

  • uv run python -m pytest codebase_rag/tests/test_change_signature_definition.py -p no:randomly -q at 72e529b3e: 21 passed.

  • The full suite was not run locally. The CI Unit Tests run at 72e529b3e was cancelled before it finished.

Checklist

  • PR title follows Conventional Commits format
  • All pre-commit checks pass (make pre-commit)
  • No hardcoded strings in non-config/non-constants files
  • No # type: ignore, cast(), Any, or object type hints
  • New comments and docstrings explain why, not what (see Comment Policy)

SKIP=no-commit-to-branch pre-commit run --from-ref 7adfaa747 --to-ref 72e529b3e (ruff, ruff-format, ty, bandit, generate-readme and the file hygiene hooks): passed. The unit-suite step of make pre-commit was not run locally.

Unchecked items:

  • The tests write their fixture source and expected text inline rather than through constants.
  • test_change_signature_definition.py has one # type: ignore[no-untyped-def] and a dict[str, object] hint, both on the both_sites test stub.
  • Comments were not re-audited against the policy in this pass.

Files changed

  • codebase_rag/tests/test_change_signature_definition.py

Diff stats

+365 additions, -0 deletions (365 LOC)

Dependencies

This PR depends on: pr-7

Dependency graph

Merge in this order:

pr-1: feat(signature): contract expectation, shared call-site helpers and constants for change_signature (#1533, 1/9)
└── pr-2: feat(signature): parameter specs, mapping sources and the change_signature contract check (#1533, 2/9)
    └── pr-3: feat(signature): read the header, bind call arguments, render the rewrite (#1533, 3/9)
        └── pr-4: feat(signature): the change_signature operation (#1533, 4/9)
            └── pr-5: feat(signature): expose change_signature through the CLI and MCP, with docs (#1533, 5/9)
                └── pr-6: test(signature): acceptance, transaction and MCP tests for change_signature (#1533, 6/9)
                    └── pr-7: test(signature): mapping tests for change_signature (#1533, 7/9)
                        └── pr-8: test(signature): definition and renamed-parameter tests for change_signature (#1533, 8/9)  <-- this PR
                            └── pr-9: test(signature): hierarchy, receiver and default guards for change_signature (#1533, 9/9)

Summary by CodeRabbit

  • Tests
    • Expanded automated checks for editing function signatures, including parameter defaults, ordering, and special parameter forms.
    • Added coverage for renaming parameters in function bodies, handling conflicts and nested scopes, and updating nested calls.
    • Added checks for unsupported or unknown definitions, reingestion after edits, and end-to-end smoke-test results.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0305c5c and 944b73c.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: vitali87/code-graph-rag/.coderabbit.yaml

Review profile: QUIET

Plan: Advanced

Run ID: 198fbcc7-9aa0-48c5-983a-608df96d40d3

📥 Commits

Reviewing files that changed from the base of the PR and between 2d92155 and 7ad8ae2.

📒 Files selected for processing (1)
  • codebase_rag/tests/test_change_signature_definition.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.

Walkthrough

Adds tests for signature definition edits. The tests cover validation rules, parameter renaming in function bodies, and applied rewrites to recursive and nested calls.

Changes: Signature Change Tests

Layer / File(s) Summary
Definition validation
codebase_rag/tests/test_change_signature_definition.py
Adds tests for default and annotation compatibility, parameter ordering, supported definition forms, and unknown definitions.
Parameter renaming
codebase_rag/tests/test_change_signature_definition.py
Adds dry-run tests for body-reference updates, name swaps, and refusal cases involving nested scopes or existing names.
Applied call-site rewrites
codebase_rag/tests/test_change_signature_definition.py
Adds tests for recursive and nested call rewrites, including reingestion, site counts, and runtime results.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Merge Risk: Minimal · previous review 7ad8a

This PR only adds regression tests for change_signature and does not alter runtime behavior. No merge-blocking risk was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
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.
Title check Passed The title clearly identifies tests for change_signature definition edits and renamed parameters. It is specific and aligned with the pull request changes.
Description check Passed The description includes the required summary, demo, change type, related issues, test plan, checklist, changed files, and dependency details. It also clearly records the tests that passed and the che…
Full details: Description check

Explanation

The description includes the required summary, demo, change type, related issues, test plan, checklist, changed files, and dependency details. It also clearly records the tests that passed and the checks that were not run.

✨ 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.

@vitali87
vitali87 added this pull request to stack #2170 September 22, 2026 23:23
@vitali87
vitali87 force-pushed the pr-split/split-1912-change-signature/pr-8 branch from 6b5c368 to 81ee25e Compare October 4, 2026 15:32

vitali87 commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner Author

Unit Tests (macos-latest, py3.12) was cancelled by its 30-minute job cap partway through the test run (run 37213378959), which also fails All Checks Pass. GitHub had roughly 400 CI runs queued across this repo at the time, and this branch passed the same job before the restack, so I read it as a slow runner rather than a hang in this PR. I have re-run the failed jobs once.

@vitali87
vitali87 force-pushed the pr-split/split-1912-change-signature/pr-8 branch 2 times, most recently from 3b69bb1 to 3c823ba Compare October 18, 2026 20:35
@vitali87 vitali87 removed the merge_conflict label Oct 18, 2026 — with Claude
@vitali87
vitali87 force-pushed the pr-split/split-1912-change-signature/pr-8 branch from 3c823ba to dfe70e6 Compare October 19, 2026 11:00
@vitali87
vitali87 force-pushed the pr-split/split-1912-change-signature/pr-8 branch from dfe70e6 to 906a16e Compare October 20, 2026 19:25
@vitali87
vitali87 force-pushed the pr-split/split-1912-change-signature/pr-8 branch from 906a16e to 5fdb0ff Compare October 21, 2026 04:02
@vitali87
vitali87 force-pushed the pr-split/split-1912-change-signature/pr-8 branch from 6b33085 to 0305c5c Compare October 28, 2026 05:31
@vitali87
vitali87 force-pushed the pr-split/split-1912-change-signature/pr-8 branch from 0305c5c to 944b73c Compare October 28, 2026 21:16
@sonarqubecloud

Copy link
Copy Markdown

@vitali87
vitali87 merged commit 30f7d16 into main Oct 30, 2026
40 checks passed
@vitali87
vitali87 deleted the pr-split/split-1912-change-signature/pr-8 branch October 30, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant