Repository navigation
Allow explicit insertion of absent canonical test methods - #9388
Closed
youknowdot wants to merge 2 commits into
Closed
youknowdot wants to merge 2 commits into
youknowdot wants to merge 2 commits into
Conversation
Add a hash-pinned copy-test --insert-before mode for a missing method beside an unchanged canonical anchor. Preserve default replacement and all destination bytes outside the selected insertion; reject ambiguous scopes, bindings, boundary comments, or changed anchors conservatively. Validate the updater with 20 bounded synthetic-text tooling tests and normal affected hooks. No Lib files or actual canonical tests are changed; no RustPython runtime, fixtures, or Rust builds are executed. Assisted-by: OpenAI Codex:model version unavailable
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
Inspect class bindings without treating unrelated nested method, lambda, class, or comprehension-local names as class bindings. Preserve definition header expressions and class control-flow checks, including source and destination scope declarations and target/anchor protections. Preserve all 20 original updater tests and add four synthetic-text scope regressions. All 24 tooling tests passed under the bounded isolated gate; no actual Lib migration, canonical tests, or RustPython runtime executed. Assisted-by: OpenAI Codex:model version unavailable
youknowone
requested changes
Oct 26, 2026
youknowone
left a comment
Member
There was a problem hiding this comment.
dup of #9363. I also didn't get what's the purpose of this patch yet. we usually update the entire test, not single function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an opt-in
scripts/update_lib copy-test --insert-before ClassName.anchormode to insert a canonical class method that is absent from the destination. The existing replacement mode and its behavior remain unchanged.This closes a selective-updater gap without refreshing an entire test module or hand-editing
Lib:copy-testpreviously required the method to exist on both sides, whilemigrate --functionshandles module-level functions rather than class methods. This PR does not migrate any actual Lib file or canonical test.The insertion mode deliberately requires:
Binding checks follow class execution scope: unrelated nested method, lambda, class, and comprehension-local names do not block insertion. Definition headers and class control-flow bindings remain checked.
The existing pre-write destination byte recheck rejects stale inputs; it is not an atomic concurrent-write transaction. The tool copies no imports or helpers and does not establish semantic dependency closure or RustPython support. Those remain part of each subsequent migration's review. Conservative checks intentionally reject some otherwise harmless cases rather than guessing.
Validation
update_lib.tests.test_copy_testpassed: 10 preserved replacement tests, 10 original insertion tests, and four lexical-scope regressions.No Rust build, RustPython runtime workload, actual canonical test, or fixture was executed. The synthetic source is parsed rather than executed.
Base:
30b8239d1b4b49c001adadad2bf19c1d4ba77381.Validated tree:
2dab7e663962e81e979685add619cb0498bb94c5.AI-assisted implementation and review; assistance is disclosed in the commit trailer.