-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: add atlas pull for the communications app FC-0012 #149
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
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.
I'm adding notes to myself from my call with Adolfo.
@@ -17,7 +17,7 @@ RUN apt update \ | |||
|
|||
RUN mkdir -p /openedx/app /openedx/env | |||
WORKDIR /openedx/app | |||
ENV PATH ./node_modules/.bin:${PATH} | |||
ENV PATH /openedx/app/node_modules/.bin:${PATH} |
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.
make pull_translations
performs a cd
therefore the relative directory PATH won't work.
hopefully it doesn't break anything else 😅
@regisb @arbrandes I've tested this pull request which requires the following plugin: from tutormfe.hooks import MFE_APPS
@MFE_APPS.add()
def _use_comm_mfe_zeitlabs_fork(mfes):
mfes["communications"] = {
"repository": "https://github.com/Zeit-Labs/frontend-app-communications",
"refs": "https://api.github.com/repos/Zeit-Labs/frontend-app-communications/git/refs/heads",
"version": "atlas-palm",
"port": 1984,
}
return mfes So it pulls the right repository until the Please review it and let me know what do you think. |
@arbrandes would you mind giving this pull request one more look? Thanks!! cc: @regisb |
# Whenever a new MFE supports Atlas, it should be added to this list. | ||
# When all MFEs support Atlas, this if-statement should be removed. | ||
{% if app_name in ["communications"] %} | ||
RUN make OPENEDX_ATLAS_PULL=true pull_translations |
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.
Are you familiar with the i18-merge.js script from line 53? It's a script that allows anyone to override translation strings. If I understand correctly, running pull_translations
here would override this behaviour, thus preventing users from adding their custom translations. Can you confirm? Can we run Atlas in a way that is compatible with this existing feature?
Also, this change is going to break the build for all users who do not run your fork of the communications app, right? We should definitely avoid this, one way or another.
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.
Are you familiar with the i18-merge.js script from line 53? It's a script that allows anyone to override translation strings. If I understand correctly, running pull_translations here would override this behaviour, thus preventing users from adding their custom translations. Can you confirm? Can we run Atlas in a way that is compatible with this existing feature?
I'm familiar with the script and I should have been clearer in the pull request description that we're going to intentionally not support i18n-merge.js
and atlas pull
at the same time in this iteration. This will affect the communications MFE which has no translations at the moment so there's no step backward.
Once this PR is merged and used, we'll work on supporting the i18n-merge.js
if needed. Our understanding that Atlas provides a superior workflow which makes i18n-merge.js
not needed -- at least as we understand it.
This has been confirmed with @arbrandes -- tagging him just in case I missed anything.
Is what I'm mentioning a blocker to merging this PR?
Also, this change is going to break the build for all users who do not run your fork of the communications app, right? We should definitely avoid this, one way or another.
No, of course not. The fork is being used merely for reviewing this pull request, we are fixing this on upstream and it's pending merge:
- Palm: feat: use
atlas
inmake pull_translations
on palm FC-0012 openedx/frontend-app-communications#156 - Quince: Pull request will be created.
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.
@regisb @arbrandes The openedx/frontend-app-communications#156 pull request has been merged into palm.master
. We need the following updates to make Tutor MFE support Atlas without needing a fork:
- Tag
open-release/palm.4
on the communications MFE. - Update Tutor open edx version
open-release/palm.2
-->open-release/palm.4
This is needed to fix the i18n for the communications app on Palm.
Once this is merged, it will also cause Quince to be supported. The good news that Atlas support already exists in the quince branch: https://github.com/openedx/frontend-app-communications/blob/3e7ea6a3e5d5c35bf508fc7fab067fc5be836e75/Makefile#L52-L62
Until the tags are ready, we'll need the following plugin to make atlas work:
from tutormfe.hooks import MFE_APPS
@MFE_APPS.add()
def _use_comm_mfe_zeitlabs_fork(mfes):
mfes["communications"]["version"] = "open-release/palm.master"
mfes["communications"]["refs"] = "https://api.github.com/repos/openedx/frontend-app-communications/git/refs/heads"
return mfes
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.
This will affect the communications MFE which has no translations at the moment so there's no step backward.
Well, it will be a breaking change for users who implemented their own translation strings for the communications MFE. It's a niche use case though, so maybe we can just ignore it.
I agree that Atlas should be a much better solution than that weird i18s-merge.js script. Still, we need to provide users a way to customise translation strings. How are we going to do that in the tutor-mfe plugin?
Tag open-release/palm.4 on the communications MFE.
Publishing a new release tag is a big deal. Do you really need Atlas in Palm? If yes we can ask the BTR to publish a new tag. But maybe it would be sufficient to support Atlas in Quince? You tell me.
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.
Well, it will be a breaking change for users who implemented their own translation strings for the communications MFE. It's a niche use case though, so maybe we can just ignore it.
I agree that Atlas should be a much better solution than that weird i18s-merge.js script. Still, we need to provide users a way to customise translation strings. How are we going to do that in the tutor-mfe plugin?
For the communications MFE i18n-merge.js is mostly unused due to completely missing translations. Based on the feedback we've had, no one translated it except for Pierre Mailhot which doesn't use the i18n-merge. For other MFEs, yes it makes sense to add this support.
We've discussed this issue in call with Adolfo and we decided that this iteration won't support i18n merge.
Please let me know if that's still a blocker.
Publishing a new release tag is a big deal. Do you really need Atlas in Palm? If yes we can ask the BTR to publish a new tag. But maybe it would be sufficient to support Atlas in Quince? You tell me.
It's a big deal indeed. Let's refocus our efforts into Quince. I'll check with @sambapete on the idea of skipping Palm for Tutor MFE support, which would leave the Palm users no way to support Atlas except by cherry-picking this pull request. Which isn't pretty bad as long as we land it into Quince.
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.
That's the keyword "as long as we land it into Quince". Unfortunately, translators translate strings before the cut of Quince.master that took place a month ago. They were never able to translate strings for the communications MFE because it wasn't part any section in the edx-platform project. I only translated it manually for Palm by extracting the strings from the source code because I couldn't leave it untranslated for my users.
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.
Thanks @sambapete, Quince it is! We're close to do so -- hopefully :)
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.
+1 for Quince.
We can still do Palm.4, but it should come after getting Quince up and running.
Status: This is pending the Quince upgrade #156 so I'm presuming that this PR is blocked until the following PR is merged: |
Any change that would added to nightly now would also go to Quince. Do you want to merge this now in nightly? |
+1 for getting this into nightly. |
Nightly it is! I'll rebase and get back to you! |
This comment was marked as duplicate.
This comment was marked as duplicate.
@regisb @arbrandes @brian-smith-tcril I've tested this plugin and it worked well without plugins or settings. The only remaining pull request has been merged into Please let me know if there's anything blocking this PR from getting 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.
Works for me!
@OmarIthawi, we're missing |
Adds
atlas pull
to the Communications MFE. Support for other MFEs will come.Previously open issues
Here's a couple issues that needs to be tackled:
atlas_pull
conditionally?CORE_MFE_APPS
feature.if app_name == communications
openedx-atlas
andplatform-frontend
which are required foratlas pull
?make pull translations
? or hand-craft anatlas pull
command?cd src/i18n/messages
thenode_modules/.bin
is no longer available.ENV PATH /openedx/app/node_modules/.bin:${PATH}
inbase
instead of the relative PATH.atlas pull
is only available for master because feat: useatlas
inmake pull_translations
openedx/frontend-app-communications#124 is a post-Palm pull request.palm.master
: feat: useatlas
inmake pull_translations
on palm FC-0012 openedx/frontend-app-communications#156TODO before merge
Screenshot: Je parle français!
atlas pull
to the Palm: feat: useatlas
inmake pull_translations
on palm FC-0012 openedx/frontend-app-communications#156atlas pull
andintl-import.js
are both working as expected:Debug atlas pull and the generated src/i18n/index.js
Nightly vs Master
All
atlas
integration is going to targetnightly
branches so it's included in Quince but not Palm.The exception is for the Communications MFE because it has not translations and needs
atlas
in Palm, therefore it's being used onmaster
.References
This contribution is part of the FC-0012 project which is sparked by the Translation Infrastructure update OEP-58.