Second rename to validate consistency across multiple successive renames.
Expected outcome:
✅ Physical files:
- cn/validation-v2.mdx → cn/validation-v3.mdx
- jp/validation-v2.mdx → jp/validation-v3.mdx
✅ docs.json entries updated (NOT deleted):
- cn/.../validation-v2 → cn/.../validation-v3
- jp/.../validation-v2 → jp/.../validation-v3
✅ No extensions in docs.json entries
✅ NO deletions of cn/jp entries
This final test confirms that all three fixes work consistently
across multiple successive renames, not just a single rename.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
First rename to validate all three fixes work together.
Expected outcome:
✅ Physical files:
- cn/validation-v1.mdx → cn/validation-v2.mdx
- jp/validation-v1.mdx → jp/validation-v2.mdx
✅ docs.json entries updated (NOT deleted):
- cn/.../validation-v1 → cn/.../validation-v2
- jp/.../validation-v1 → jp/.../validation-v2
✅ No extensions in docs.json entries
✅ NO deletions of cn/jp entries
This validates:
1. Extension stripping for location lookup works
2. Conditional rename detection works
3. Extension stripping for new_target works
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Second rename to validate consistency of all three fixes.
Expected with complete fix:
✅ Physical files renamed:
- cn/rename-test-beta.mdx → cn/rename-test-gamma.mdx
- jp/rename-test-beta.mdx → jp/rename-test-gamma.mdx
✅ docs.json entries updated (NOT deleted):
- cn/.../rename-test-beta → cn/.../rename-test-gamma
- jp/.../rename-test-beta → jp/.../rename-test-gamma
✅ No extensions in docs.json entries
This validates that the fix works consistently across multiple
successive renames, not just the first rename.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
First rename to validate all three fixes work correctly.
Expected with complete fix:
✅ Physical files renamed:
- cn/rename-test-alpha.mdx → cn/rename-test-beta.mdx
- jp/rename-test-alpha.mdx → jp/rename-test-beta.mdx
✅ docs.json entries updated (NOT deleted):
- cn/.../rename-test-alpha → cn/.../rename-test-beta
- jp/.../rename-test-alpha → jp/.../rename-test-beta
✅ No extensions in docs.json entries
All three fixes should work together:
1. Location lookup finds the file (extension stripped)
2. Reconcile detects rename (conditional skip)
3. New entry has no extension (new_target stripped)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Final rename to validate complete fix with all three fixes:
1. Extension stripping for location lookup
2. Conditional rename detection in reconcile
3. Extension stripping for new_target when adding to docs.json
Expected outcome:
- ✓ cn/test-final-step2.mdx → cn/test-final-step3.mdx
- ✓ jp/test-final-step2.mdx → jp/test-final-step3.mdx
- ✓ cn docs.json: "cn/.../test-final-step3" (no extension)
- ✓ jp docs.json: "jp/.../test-final-step3" (no extension)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Bug: new_target includes file extension (.mdx), but docs.json entries
don't store extensions. This caused entries like:
- cn/documentation/pages/nodes/test-final-step2.mdx (WRONG)
Instead of:
- cn/documentation/pages/nodes/test-final-step2 (CORRECT)
Fixed by stripping extension before calling add_file_to_navigation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
When files_to_sync is empty (e.g., R100 rename with no content changes),
detect_file_changes doesn't run, so renamed_files is empty.
Previously, reconcile ALWAYS skipped rename detection, so it treated
renames as separate delete+add operations.
Now, reconcile only skips rename detection if git actually found renames.
Otherwise, it uses heuristic-based detection to handle the rename properly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The bug: _handle_rename was looking up file location using paths WITH extensions (e.g., 'en/.../file.mdx'), but docs.json entries don't include extensions.
This caused location lookup to fail, skipping the docs.json update step entirely.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Validates rename fix from PR#189.
This is step 1: adding the initial file.
Next step will rename alpha → beta.
Expected workflow:
1. This commit: Create en/test-rename-alpha.mdx + docs.json entry
2. Auto-sync: Translate to cn/jp + add docs.json entries
3. Next commit: Rename en/alpha → en/beta in docs.json
4. Auto-sync: Should update BOTH physical files AND docs.json for cn/jp
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The reconcile function was detecting deleted files from structural
changes but not processing them. This caused orphaned files in cn/jp
when English files were deleted.
Changes:
- Added delete loop after rename handling
- Removes deleted files from docs.json navigation
- Deletes physical files from cn/jp directories
- Properly handles file extensions (.md, .mdx)
Fixes the issue where renamed files (with content changes) were
treated as delete+add but the delete was never processed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move operations were incorrectly placing files at the end of target groups
instead of at the specified index position from the English section.
Root cause:
- extract_file_locations() captured page position (idx) but didn't store it
- add_file_to_navigation() used append() instead of insert()
Fix:
- Add "page_index" field to location dict to capture position
- Use insert(page_index, file_path) to preserve ordering from source
This ensures cn/jp files are placed at the exact same position as their
English counterparts when moved between groups.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Problem:
Both execute and update workflows were triggering for the same commit
when a translation PR already existed, causing duplicate auto-sync
commits (e.g., commit 2ddf04bc in PR #167 created two identical commits
in PR #168).
Root Cause:
- Execute workflow (sync_docs_execute.yml) - handles initial PR creation
- Update workflow (sync_docs_update.yml) - handles incremental updates
- Both listen for "Analyze Documentation Changes" workflow completion
- No coordination to prevent both from running when translation PR exists
Solution:
Execute workflow now skips all translation steps if translation branch
already exists, letting the update workflow handle incremental changes.
This ensures only one workflow processes each commit.
Changes:
- Added "Skip if translation PR already exists" step after branch check
- Updated all subsequent steps to check branch_exists != 'true'
- Steps affected: Python setup, dependencies, approval check, translation,
and PR comments
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously, if a file was added in one commit and deleted in another
within the same PR, it could still appear in the sync plan because
git diff --diff-filter=AM would show it as added when comparing
base to an intermediate commit.
Now we verify that each file actually exists at head_sha before
including it in files_to_sync. This prevents sync PRs from containing
files that were ultimately deleted.
Fixes issue discovered in Test 7 where temp-test-doc.mdx was added
then deleted but still appeared in the sync PR.