-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sync-translated-content): sync case changes + move adjacent files #7886
Conversation
Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running yarn tool sync-translated-content zh-cn
with content @ 04775ddbbdb965b02f20a71461268084d1efd7c1
and an outdated translated-content @ f339ce907032d79788eab03303d33cba328a9ea7
(2022-12-22), I got this:
% yarn tool sync-translated-content zh-cn
yarn run v1.22.19
$ ts-node tool/cli.ts sync-translated-content zh-cn
error: ENOENT: no such file or directory, open '/Users/claas/github/mdn/translated-content/files/zh-cn/orphaned/games/examples/index.md'
error Command failed with exit code 1.
Context:
Line 142 in 76ca7f2
fs.writeFileSync(filePath, combined); |
Running the script with yari @ main
works fine:
% yarn tool sync-translated-content zh-cn
yarn run v1.22.19
$ ts-node tool/cli.ts sync-translated-content zh-cn
Syncing zh-cn:
Total of 5114 documents
Moved 13 documents
Conflicting 3 documents.
Orphaned 3 documents.
Fixed 10 redirected documents.
✨ Done in 12.33s.
This pull request has merge conflicts that must be resolved before it can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but maybe we can replace filePathChanged
by a proper status
flag and fix the semantics of `
Co-authored-by: Claas Augner <caugner@mozilla.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one more opportunity. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yin1999 Just to double-check. This PR fixes two issues, right?
- We now sync case changes (previously we didn't).
- We now also move all adjacent files, if a content page moved (previously we didn't).
Is that accurate, or did I miss anything?
Yes |
Dev build for 2bcc01a was deployed to: https://pr7886.content.dev.mdn.mozit.cloud/ |
Summary
Fixes: #7778
Problem
sync-translated-content
didn't sync slug case changessync-translated-content
didn't move all adjacent files, if a content page moved.Solution
Screenshots
After
How did you test this change?
Run
yarn tool sync-translated-content zh-cn
andyarn move
(case changed only) to verify.