-
Notifications
You must be signed in to change notification settings - Fork 528
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
Refactor sync #3312
Refactor sync #3312
Conversation
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.
Very high-level look, but this already looks very promising!
Currently, Pretranslation is tightly integrated with sync in order to minimize time between exposing new strings for localization and pretranslating them. What's your plan with this?
Ah, I'd missed that! Yeah, that needs to happen the same as before. |
1f24718
to
397e5f5
Compare
This is now at the dangerous stage of looking like it works. But some verification work still remains:
|
Pushed the latest version to stage and the download from Pontoon Test now works. 👍 Firefox times out for now. If we want to permanently Download all projects for all files, we should also show Download Translations entry in the Profile menu in the All Resources view. Not necessarily as part of this PR. And, we should drop "Download prefix or path to TOML file" from the Admin, DB and the docs. |
It works for me locally, but it takes ~20s, so not surprised it times out on Heroku. |
After some investigation, the stats "went off" already during the preceding sync, not due to the upload. This should now be fixed, by making the Most of the work to effect that went into cleaning up the optimizations introduced in #1140, and making the tests it introduced work with more real-world usage patterns. The It would be a good idea to call |
@mathjazz I think I've now addressed all comments, PTAL? |
This still happens.
This is fixed! 👍 I've downloaded translations from the |
Sync is failing for me locally, while it's been working fine until yesterday (just updated the project, translated one string, and tried a sync)
|
@flodolo Based on the log and these lines in particular:
As the commit This is technically an unrelated bug to the sync refactor, but I've fixed it here. |
As a workaround, downloads are now handled by redirecting the request to the target repository. For GitHub & GitLab the target is the raw version of the current resource. Because we currently only store the source path and not the target path in the database, this still requires an initial git clone or pull. |
… source & target repos
Different problem
The source repo was correctly updated, but no new strings were exposed for localization (there are quite a few in this update). EDIT: even running |
After some investigation, this issue was identified as having been caused by first running a sync from this branch, then This problem will not arise once the PR is 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.
Tested on stage one more time and didn't spot any issues.
Syncing a month worth of Firefox changes took much less time than with the current code, and I haven't seen a single instance of "Memory quota exceeded" message in the logs.
Well done!
Left some comments inline, but nothing major. We should file a few bugs.
Also, we need to update the README:
https://github.com/mozilla/pontoon/blob/main/pontoon/sync/README.md
@@ -390,6 +390,7 @@ def stats(self): | |||
{ | |||
"title": "all-resources", | |||
"resource__path": [], | |||
# FIXME rename as total_strings |
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.
File a good first issue for this?
Fixes #2057
Fixes #2078
Closes #2083 -- source changes are now sync'd to targets eagerly
Fixes #2087 -- git file moves are caught, but not copies
Closes #2129 -- refactoring the sync changes the performance characteristics completely
Fixes #2169
Fixes #2175
Fixes #2189
Fixes #2211
Fixes #2242
Closes #2285 -- not relevant after the refactor
Fixes #2641
Fixes #3302
Fixes #3449
Fixes #2154
This is effectively a rewrite of the
sync_project()
function that's currently here, and which ends up calling most of the code underpontoon/sync/
.The end results of the code here should be the same as currently, but the implementation is completely new, and does things in a different order.
Per-locale repositories are dropped here, as per #3303.
Explicitly left out of this PR but liable to change later: