Closed OmarIthawi closed 8 months ago
I converted this PR to a draft, let me know when it's ready for another round of review.
@regisb I've addressed some of your notes.
I think we still need some way to pass options for example:
Another feature is that atlas pull
should be disabled by default, because at the moment it pulls an incomplete translation and it's worse than what's checkout on GitHub.
Perhaps, it's good to share a recap on what happened on Atlas. Part of OEP-58, we've created two new additions to the Open edX Platform https://github.com/openedx/openedx-translations and https://github.com/openedx/openedx-atlas .
atlas pull
replaces tx pull
in which that it doesn't pull from Transifex, but pulls from the https://github.com/openedx/openedx-translations GitHub repo which makes it possible to pull without needing authentication or .transifexrc
file.
$ tutor images build discovery
$ tutor dev run discovery -- atlas --help # Prints the help message
The file tree seems about right. It removed the old files and add fresh ones from the repository (as opposed to Transifex).
$ tutor dev run discovery -- ls -R course_discovery/conf/locale
course_discovery/conf/locale:
ar config.yaml de en fr_CA
tutor dev run discovery -- ls -R course_discovery/conf/locale
course_discovery/conf/locale/ar:
LC_MESSAGES
course_discovery/conf/locale/ar/LC_MESSAGES:
djangojs.po django.po
course_discovery/conf/locale/de:
LC_MESSAGES
course_discovery/conf/locale/de/LC_MESSAGES:
djangojs.po django.po
course_discovery/conf/locale/en:
LC_MESSAGES
course_discovery/conf/locale/en/LC_MESSAGES:
djangojs.po django.po
course_discovery/conf/locale/fr_CA:
LC_MESSAGES
course_discovery/conf/locale/fr_CA/LC_MESSAGES:
djangojs.po django.po
I think we should wait until we implement https://github.com/openedx/openedx-atlas/issues/34 and use pip
@regisb and @brian-smith-tcril would you mind taking a look at this PR? It should be ready again for review.
@regisb I've updated the PR except for the args
part which I tend to think it's valuable but I'd like to hear from you.
Anyway, it's not a blocker for this PR so we can remove it until we figure out another alternative.
axim $ tutor config save
Configuration saved to /home/omar/work/axim/config.yml
Environment generated in /home/omar/work/axim/env
axim $ tutor images build discovery
Building image docker.io/overhangio/openedx-discovery:16.0.0
....
=> => naming to docker.io/overhangio/openedx-discovery:16.0.0
axim $ tutor dev run discovery bash
app@c91d22d98665:~/discovery$ ls -R course_discovery/conf/locale/
course_discovery/conf/locale/:
ar config.yaml de en fr_CA
course_discovery/conf/locale/ar:
LC_MESSAGES
course_discovery/conf/locale/ar/LC_MESSAGES:
djangojs.po django.po
course_discovery/conf/locale/de:
LC_MESSAGES
course_discovery/conf/locale/de/LC_MESSAGES:
djangojs.po django.po
course_discovery/conf/locale/en:
LC_MESSAGES
course_discovery/conf/locale/en/LC_MESSAGES:
djangojs.po django.po
course_discovery/conf/locale/fr_CA:
LC_MESSAGES
course_discovery/conf/locale/fr_CA/LC_MESSAGES:
djangojs.po django.po
@regisb what do you think should happen if a po
file fails to compile due to Translator writing invalid strings Hi {user}
--> Merhaba {kullanci}
?
Currently the docker build fails, which I think isn't appropriate.
I'm thinking we should add validation to the https://github.com/openedx/openedx-translations so this won't happen inside Tutor, correct?
cc: @brian-smith-tcril
@OmarIthawi I made an issue on the openedx-translations
repo for validation https://github.com/openedx/openedx-translations/issues/549
Thanks Brian and Regis. I'll fix the openedx-translations repo first then I'll continue with this PR.
@regisb @brian-smith-tcril would mind taking another look?
This took a lot of experimentation and review effort, but I hope it's worth it. I've also made sure that atlas pull
gets valid pofiles by validating pofiles at the source repo:
@regisb the pull request is ready again for review.
@regisb a gentile reminder about this pull request :)
pulling in @Faraz32123 who is the new maintainer for this plugin.
@Faraz32123 would you mind checking this pull request?
@OmarIthawi did you see my last comment above?
@regisb Let's please continue with the feature flag the three of us thinks it's the way to go.
I don't fully understand Tutor branching strategy, so should I change the base branch from master
--> nightly
?
I don't fully understand Tutor branching strategy, so should I change the base branch from master --> nightly?
Do you want the feature in the Palm release? If yes, then keep the base branch as master, and it will also be included in nightly. If the feature should only target the upstream master branch of the course-discovery repo, aim for the nightly branch here. For more information: https://docs.tutor.overhang.io/tutorials/nightly.html
@regisb for the discovery, I think it should go to nightly
so it's included in Quince.
All other atlas
pull requests should go to nightly
except for the MFE because the communications
MFE needs atlas
in Palm.
@regisb for the discovery, I think it should go to nightly so it's included in Quince.
To be clear: if atlas goes to the plugin master branch, the change will also be included in Quince. We should push to nightly only if the change does not work in Palm.
Does that make sense?
@regisb for the discovery, I think it should go to nightly so it's included in Quince.
To be clear: if atlas goes to the plugin master branch, the change will also be included in Quince. We should push to nightly only if the change does not work in Palm.
Does that make sense?
Yes, makes sense :)
I don't want tutor-discovey
to support atlas
in Palm. Therefore it'll go to nightly so it's only Quince and beyond.
@regisb @Faraz32123 I've rebased over nightly
and tested the build and it pulled the translations correctly:
I think this pull request is ready to be merged.
BTW, we've added translation validation, so if the the feature flag was removed, it would still be production ready, at least up to our knowledge.
Hey!! That's a great way to end the day. Thanks @regisb!
Thanks for bearing with me Omar!
On the contrary! It's been a great review. I'm new to Tutor anyway, so I'm expecting a lot of comments anyway.
Add https://github.com/openedx/openedx-atlas to the Dockerfile and run the
atlas pull
command on every build.I'm starting here because this is a simple plugin and helps us to design it properly. The end goal is to add
atlas
on all other components including edX Platform, MFEs and possibly even ecommerce.This is a very minimal build that needs the following to be viable:
This PR requires the following branch of discovery: https://github.com/openedx/course-discovery/pull/4037
TODO
DISCOVERY_ATLAS_OPTOINS
variable to keep it minimalBuilding and testing logs
``` # Set the following variables: # DISCOVERY_ATLAS_ARGS: --filter=ar,de # DISCOVERY_ATLAS_PULL: true $ tutor config save $ tutor images build discovery Building image docker.io/overhangio/openedx-discovery:16.0.0 .... $ docker run -it docker.io/overhangio/openedx-discovery:16.0.0 atlas --version v0.4.4 ``` Check the file tree ``` $ docker run -it docker.io/overhangio/openedx-discovery:16.0.0 ls -R course_discovery/conf/locale/ course_discovery/conf/locale/: ar config.yaml de course_discovery/conf/locale/ar: LC_MESSAGES course_discovery/conf/locale/ar/LC_MESSAGES: djangojs.po django.po course_discovery/conf/locale/de: LC_MESSAGES course_discovery/conf/locale/de/LC_MESSAGES: djangojs.po django.po ``` Verify translations within the image: ``` $ docker run -it docker.io/overhangio/openedx-discovery:16.0.0 cat course_discovery/conf/locale/de/LC_MESSAGES/django.po | head -n 100 # #-#-#-#-# django.po (course-discovery) #-#-#-#-# # edX translation file # Copyright (C) 2018 edX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # # Translators: # Translators: # Omar Al-Ithawi , 2023 # msgid "" msgstr "" "Project-Id-Version: edx-platform\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-03 00:22+0000\n" "PO-Revision-Date: 2023-01-26 15:39+0000\n" "Last-Translator: Omar Al-Ithawi , 2023\n" "Language-Team: German (https://app.transifex.com/open-edx/teams/147691/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: apps/api/filters.py:47 #, python-brace-format msgid "No user with the username [{username}] exists." msgstr "Ein Nutzer mit Namen [{username}] existiert nicht." #: apps/api/filters.py:50 msgid "" "Only staff users are permitted to filter by username. Remove the username " "parameter." msgstr "" "Nur Mitarbeiter sind berechtigt nach Benutzernamen zu filtern. Entfernen Sie" " den Benutzername Parameter" #: apps/api/serializers.py:813 msgid "Number of courses contained in this catalog" msgstr "Anzahl der Kurse in diesem Katalog" #: apps/api/serializers.py:816 msgid "Usernames of users with explicit access to view this catalog" msgstr "" "Benutzernamen der Nutzer mit ausdrücklichem Zugriff um diesen Katalog zu " "sehen" #: apps/api/serializers.py:976 msgid "Start date cannot be after the End date" msgstr "Startdatum kann nicht nach dem Enddatum gesetzt werden" #: apps/api/serializers.py:981 msgid "Term cannot be changed" msgstr "Begriff kann nicht geändert werden" #: apps/api/serializers.py:993 msgid "Language in which the course is administered" msgstr "Sprache in der dieser Kurs verwaltet wird" ..... ```Background
This contribution is part of the FC-0012 project which is sparked by the Translation Infrastructure update OEP-58.