-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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] translation: lock weblate only when there is an actual change of messages.pot #293
Conversation
manage
Outdated
@@ -261,6 +259,12 @@ weblate.push.translations() { | |||
return 0 |
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.
If I'm not wrong, this return ends the subshell started in line 242 by (
. The shell will continue where the subshell ends, see closing )
below .. and pyenv.cmd wlc unlock
will be executed .. or I'm wrong?
update: compare with #290 (comment) where I moved the block with the return out of the subprocess.
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.
How to keep set -e
for the block before pyenv.cmd wlc lock
?
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.
Try this patch ... update see #379
diff --git a/manage b/manage
index 6f6f1a4f..488a93cc 100755
--- a/manage
+++ b/manage
@@ -240,9 +240,6 @@ weblate.push.translations() {
local messages_pot diff_messages_pot last_commit_hash last_commit_detail \
last_commit_message exitcode
( set -e
- # lock change on weblate
- pyenv.cmd wlc lock
-
# get translations branch in git worktree (TRANSLATIONS_WORKTREE)
weblate.translations.worktree
@@ -258,8 +255,18 @@ weblate.push.translations() {
git diff -- "searx/translations/messages.pot")
if ! echo "$diff_messages_pot" | grep -qE "[\+\-](msgid|msgstr)"; then
build_msg BABEL 'no changes detected, exiting'
- return 0
+ return 1
fi
+ return 0
+ )
+ exitcode=$?
+ if [ "$exitcode" ]; then # FIX see #379 :: if [ "$exitcode" -gt 0 ]; then
+ return 0
+ fi
+
+ ( set -e
+ # lock change on weblate
+ pyenv.cmd wlc lock
# save messages.pot in the translations branch for later
pushd "${TRANSLATIONS_WORKTREE}"
Does https://github.com/searxng/searxng/blob/master/docs/dev/translation.svg needs an update? |
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.
See my comments.
The check is not shown, and it is not accurate. The creation of the worktree / git pull are not shown (it is already the case). |
Do you like to update the svg in the repository along with this PR? |
…f messages.pot Close searxng#290
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.
Cant test it, but LGTM / Thanks!
What does this PR do?
After each commit on the master branch, there is a call to
weblate.push.translations
:searxng/.github/workflows/integration.yml
Line 96 in a26e4ef
searxng/.github/workflows/integration.yml
Line 130 in a26e4ef
weblate.push.translations
locks weblate each time.This PR locks weblate only when there is an actual change of messages.pot.
Why is this change important?
See #290 : keep weblate history clean, avoid triggers on lock.
How to test this PR locally?
N/A
Author's checklist
Related issues
Close #290