Skip to content

fix: recompute group LOC estimates after an interactive hunk move - #108

Closed
vitali87 wants to merge 1 commit into
mainfrom
fix/move-assignment-recompute-loc
Closed

fix: recompute group LOC estimates after an interactive hunk move#108
vitali87 wants to merge 1 commit into
mainfrom
fix/move-assignment-recompute-loc

Conversation

@vitali87

Copy link
Copy Markdown
Owner

Summary

The interactive editor's move <file>:<hunk> <from> <to> updated the assignments but left each group's estimated_loc / estimated_added / estimated_removed untouched. The post-edit validate_plan then used the stale numbers: false "above maximum" LOC-bound warnings (or a wrong --strict-loc-bounds failure) for the source group, and wrong +N/-M stats in the PR bodies and in the editor's own plan table.

_interactive_edit now calls the existing recompute_estimated_loc(groups, parsed_diff) after every successful move.

Test plan

  • TestInteractiveEditRecomputesLoc drives the editor with a real two-hunk diff: after move a.py:1 pr-1 pr-2 the groups report +1/-0 and +2/-0 (fails on main with loc=3), and a failed move leaves the estimates alone
  • 446 tests pass, ruff clean
  • Local review: 5/5

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 31 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 40606def-a57f-413c-9c9f-e55cc5ece821

📥 Commits

Reviewing files that changed from the base of the PR and between 9482d92 and 63f909b.

📒 Files selected for processing (2)
  • pr_split/cli.py
  • tests/test_cli_coverage.py

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

Copy link
Copy Markdown
Owner Author

Closing as a duplicate: this was re-found by a bug hunt run against main, but #60 (recompute after move) and #58 (WHOLE_FILE expansion via covered_indices) already fix it. The non-duplicate follow-ups (#114, #129) have been restacked onto #60.

@vitali87 vitali87 closed this Aug 30, 2026
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