test(agent): add end-to-end regression test for review item fingerprint stability - #898
Merged
lizhengfeng101 merged 1 commit intoAug 14, 2026
Conversation
…nt stability Derive fingerprints from real diff.ParseDiffText output and assert they do not depend on a file's position in the patch, covering both plain multi-file patches and the workspace-mode "\n\n" joining case. This pins the --resume reuse guarantee on the parser path rather than on the helper's string handling alone. Closes alibaba#897
Contributor
|
✅ OpenCodeReview: Review skipped: no items were selected. |
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.
Description
Adds the regression test described in #897:
TestReviewItemFingerprintStableAcrossPatchPositionderives fingerprints from realdiff.ParseDiffTextoutput and asserts they do not depend on a file's position within the patch.#732 fixed #718 by normalizing trailing line endings in
reviewItemFingerprint, but the existing helper-level test feeds hand-written strings and never exercisesParseDiffText— the component that actually produces the position-dependent trailing newlines. This test pins the user-visible--resumeguarantee (same unchanged file keeps the same fingerprint regardless of patch position) on the real parser path:"\n\n"joining, where the trailing run is 2-3 newlines — the case onlyTrimRight(notTrimSuffix) handlesTest-only change; no production code modified.
Type of Change
How Has This Been Tested?
mainwith both sub-cases (plain patch,untracked join)strings.TrimRight(d.Diff, "\r\n")normalization makes the test fail (verified locally, then reverted)cannot read filewarnings on stderrmake testpasses (full suite)make checkpassesChecklist
go fmt,go vet)Related Issues
closes #897