[claude] Fix FwHeadless silently dropping FieldWorks edits (chorusmerge handler discovery) - #2513
Conversation
FwHeadless silently drops FieldWorks edits when a file needs a real 3-way merge: the ChorusMerge process never finds its *-ChorusPlugin.dll handlers (MEF scans the cwd, and hg runs the merge tool from the repo, not /app), so conflicts fall back to whole-file "keep ours". This smoke-test runs the real chorusmerge from a non-/app cwd on a split PartsOfSpeech.list, editing two different possibility items, and asserts both survive. It fails on the current setup by design; the fix follows next. Fixes #2509, part of #2508. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ChorusMerge finds its *-ChorusPlugin.dll handlers with a cwd-relative MEF scan, but hg runs the merge tool from the repo, not /app, so the handlers were never found and merges fell back to whole-file "keep ours". cd into the script dir so they're found; hg passes absolute file paths, so changing cwd is safe. Turns the previous commit's smoke-test green. Fixes #2510. Part of #2508; durable upstream fix tracked in #2511 / sillsdev/chorus#392. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe ChangesChorusmerge smoke validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
- chorusmerge: exit non-zero if `cd` to the app dir fails, so a merge can't silently fall back to "keep ours" (a failed merge tool makes Chorus roll back and throw instead). - Dockerfile: bind-mount the smoke fixture instead of COPY, so it isn't shipped in the runtime image. - smoke run.sh: capture the merge tool's exit code in the failure diagnostic. Part of #2508. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/FwHeadless/chorusmerge-smoke/run.sh`:
- Around line 27-29: Update the success condition following the chorusmerge
invocation to require rc to indicate a zero exit status in addition to finding
Adverb_OURS and Verb_THEIRS in merged.list. Preserve the existing content
checks, and ensure non-zero or conflicted merge results cannot report success.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: eacfd2c4-68bb-459e-96d0-2b8bfe17c392
📒 Files selected for processing (4)
backend/FwHeadless/Dockerfilebackend/FwHeadless/chorusmergebackend/FwHeadless/chorusmerge-smoke/PartsOfSpeech.base.listbackend/FwHeadless/chorusmerge-smoke/run.sh
[Claude, autonomous]
FwHeadless silently drops FieldWorks-desktop edits when a file needs a real 3-way merge: the ChorusMerge process never finds its
*-ChorusPlugin.dllhandlers (the MEF scan is cwd-relative and hg runs the merge tool from the repo, not/app), so conflicts fall back to whole-file "keep ours". Background in #2508.Two commits, landing intentionally red → green:
chorusmergefrom a non-/appcwd on a splitPartsOfSpeech.list, editing two different possibility items, and asserts both survive. Red on the current setup — it reproduces the data loss in CI.cdinto the script dir so ChorusMerge's cwd-relative handler scan lands on/app. hg passes absolute file paths to the merge tool, so changing cwd is safe. Turns the smoke-test green.Interim shim (#2510); the durable upstream fix is tracked in #2511 / sillsdev/chorus#392.
Closes #2509, #2510.
🤖 Generated with Claude Code