-
Notifications
You must be signed in to change notification settings - Fork 687
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
Improve i18n_tool.py list-translators, update-from-weblate #5571
Conversation
6a1b548
to
13ce2de
Compare
dd48337
to
cc06bf7
Compare
cc06bf7
to
5fd0c69
Compare
8548a74
to
eda32da
Compare
This pull request introduces 1 alert when merging eda32da into ce22827 - view on LGTM.com new alerts:
|
73a5a22
to
3c85c6f
Compare
Allow the specification of a commit whose timestamp will be used as the starting point for gathering translator credits, instead of starting from the last commit that says "l10n: sync". That breaks badly if there are any source string changes during the release cycle that require another sync, so instead, just examine all the commits since the time of the specified revision, defaulting to the last release tag. Also, instead of always gathering translator contributions up to the tip of i18n/i18n for list-translators and update-from-weblate, allow the specification of a commit. This is intended to allow verification of these functions' results; release management tasks should use the default target of the i18n/i18n branch tip.
3c85c6f
to
79640ee
Compare
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.
The code change looks good. but, I had some trouble in following the test steps:
❯ git checkout -b test-i18n-merge 8b50a9e3c
Switched to a new branch 'test-i18n-merge'
❯ git checkout improve-list-translators -- securedrop/i18n_tool.py && git commit -m 'get new i18n_tool.py'
fatal: invalid reference: improve-list-translators
@rmol Should I manually copy paste and test? (I guess yes)
@kushaldas Thanks for looking, and sorry about that command -- if you don't already have the branch checked out locally, the command should be: |
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.
The code change looks good. Tested with the following instructions:
Testing
Verify that i18n_tool.py update-from-weblate
produces the same translations it did for 1.6.0
-
Create a
test-i18n-merge
branch starting atdevelop
as of the creation of thei18n-merge
branch for 1.6.0:git checkout -b test-i18n-merge 8b50a9e3c
-
Check out
i18n_tool.py
from theimprove-list-translators
branch:git checkout improve-list-translators -- securedrop/i18n_tool.py && git commit -m 'get new i18n_tool.py'
-
Activate your virtualenv and update the translations from the
i18n/i18n
branch at the same commit used for 1.6.0:python3 securedrop/i18n_tool.py update-from-weblate --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bac
-
Verify that the translations match 1.6.0:
git diff --stat origin/release/1.6.0 -- securedrop/translations
No differences should be reported.
Verify the output of i18n_tool.py list-translators
-
Run
python3 securedrop/i18n_tool.py list-translators --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bac --since 1.5.0
and compare the output to the contributors listed in the commit messages from runninggit log
on thetest-i18n-merge
branch back to the commit cherry-pickingi18n_tool.py
. -
Run
python3 securedrop/i18n_tool.py list-translators
. The translators credited should match the authors of commits since thei18n
commit that went into 1.6.0, which you can obtain withgit log d34ba2a576bf7ef3faf25fb3e903a492ddff0bac..i18n/i18n
.
Status
Ready for review
Description of Changes
Fixes #5570.
Allow the specification of a commit whose timestamp will be used as the starting point for gathering translator credits, instead of
starting from the last commit that says "l10n: sync". That breaks badly if there are any source string changes during the release cycle that require another sync, so instead, just examine all the commits since the time of the specified revision, defaulting to the last release tag.
Also, instead of always gathering translator contributions up to the tip of
i18n/i18n
forlist-translators
andupdate-from-weblate
, allow the specification of a commit. This is intended to allow verification of these functions' results; release management tasks should use the default target of thei18n/i18n
branch tip.Testing
Verify that
i18n_tool.py update-from-weblate
produces the same translations it did for 1.6.0Create a
test-i18n-merge
branch starting atdevelop
as of the creation of thei18n-merge
branch for 1.6.0:git checkout -b test-i18n-merge 8b50a9e3c
Check out
i18n_tool.py
from theimprove-list-translators
branch:git checkout improve-list-translators -- securedrop/i18n_tool.py && git commit -m 'get new i18n_tool.py'
Activate your virtualenv and update the translations from the
i18n/i18n
branch at the same commit used for 1.6.0:python3 securedrop/i18n_tool.py update-from-weblate --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bac
Verify that the translations match 1.6.0:
git diff --stat origin/release/1.6.0 -- securedrop/translations
No differences should be reported.
Verify the output of
i18n_tool.py list-translators
Run
python3 securedrop/i18n_tool.py list-translators --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bac --since 1.5.0
and compare the output to the contributors listed in the commit messages from runninggit log
on thetest-i18n-merge
branch back to the commit cherry-pickingi18n_tool.py
.Run
python3 securedrop/i18n_tool.py list-translators
. The translators credited should match the authors of commits since thei18n
commit that went into 1.6.0, which you can obtain withgit log d34ba2a576bf7ef3faf25fb3e903a492ddff0bac..i18n/i18n
.Deployment
A bug here could result in translations not making it to production, so the localization managers for 1.7.0 should give the results of
update-from-weblate
andlist-translators
extra scrutiny.Checklist
If you made changes to the server application code:
make lint
) and tests (make test
) pass in the development containerIf you made non-trivial code changes: