Skip to content
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 support for cookiecutter-django-ida - FC-0012 #409

Merged

Conversation

shadinaif
Copy link
Contributor

Update cookiecutter-django-ida to support atlas for all new IDA. Doing that behind a feature flag until it's fully implemented

This PR prepares the repository to comply with openedx-translations by doing the following:

Only for cookiecutter-django-ida:

  • Use i18_tool extract to extract transactions
  • Add atla pull behind OPENEDX_ATLAS_PULL flag

How it was tested?

  • Create a django ida using the cookiecutter cookiecutter -o testdir cookiecutter-django-ida
  • Make sure you name it credentials, because we need to test make pull_translations which requires a supported repo name
  • go to the new IDA project directory
  • Create a virtualenv and upgrade requirements using make upgrade
  • Install the requirements make requirements
  • try make extract_translations: everything looks fine
  • try python manage.py makemigrations && make validate: no errors
  • try make pull_translations: works fine, we see tx commands
  • try OPENEDX_ATLAS_PULL=yes make pull_translations: works fine, we see atlas commands, and other translations being removed
  • try make validate again: no errors

References

This pull request is part of the FC-0012 project which is sparked by the Translation Infrastructure update OEP-58.

Check the links above for full information about the overall project.

Internalization is being rearchitected in Open edX Python, XBlock, Micro-frontend, and other projects. There are a number of immediately visible changes:

  • Remove source and language translations from the repositories, hence no .json, .po or .mo files will be committed into the repos.
  • Add standardized make extract_translations in all repositories
  • Push user-facing messages strings into openedx/openedx-translations.
  • Integrate root repositories with openedx/openedx-atlas to pull translations on build/deploy time

Breaking Changes

One of the primary goals of the project is to avoid breaking changes. If you notice any suspicious code, please raise your concern. But before that, please know the strategy we're following to avoid breaking changes

For XBlocks:

  • The standard translation path must be conf/locale. Therefore, we are creating a link from conf/locale to translations so Atlas can find the path without disrupting the current way of having translations locally within the XBlocks
  • openedx-translations will have a related PR that adds the XBlock to the pipeline. This will not affect the current way of managing/updating translations
  • At the end of the project, a clear change log will be added and all translations will be handled by Atlas. Thus, the local translation will be removed from the repo within the version bump
  • A notification for the community will be published to ensure that everyone knows why translation directories are removed from all repos

Update cookiecutter-django-ida to support atlas for all new IDA. Doing that
behind a feature flag until it's fully implemented

Refs: FC-0012 OEP-58
@openedx-webhooks
Copy link

Thanks for the pull request, @shadinaif! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 26, 2023
@shadinaif
Copy link
Contributor Author

please review @OmarIthawi @brian-smith-tcril

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why all non-english languages have been removed here. On the xblock cookiecutter most are commented out but some non-english languages are still in the config. https://github.com/openedx/edx-cookiecutters/blob/master/cookiecutter-xblock/%7B%7Bcookiecutter.repo_name%7D%7D/%7B%7Bcookiecutter.package_name%7D%7D/conf/locale/config.yaml

Copy link
Member

@OmarIthawi OmarIthawi Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point Brian. That requires some clarification to get it right.

@shadinaif did we try to remove the config.yaml file? Will the po-file compile, extract still work fine?

We know that atlas pull doesn't need config.yaml. But what about i18n_tool generate and i18n_tool extract --no-segment would any of those rely on the locales: list that is being modified?

The xblock cookie-cutter doesn't seem to be needing config.yaml though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should remove those in xblock cookiecutter too. These are templates for new packages. They should contain only English (and maybe dummy for tests). If the developer needs more languages to be used outside atlas, then she must add them manually. But the default is that we're using Atlas which needs only English

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

@itsjeyd itsjeyd added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Nov 29, 2023
@itsjeyd
Copy link

itsjeyd commented Nov 29, 2023

Hey @shadinaif, would you mind putting FC-0012 in the PR title when you get a minute?

@shadinaif shadinaif changed the title feat: add atlas support for cookiecutter-django-ida feat: add atlas support for cookiecutter-django-ida - FC-0012 Dec 1, 2023
@itsjeyd itsjeyd added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. waiting for eng review PR is ready for review. Review and merge it, or suggest changes. and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Dec 7, 2023
@itsjeyd
Copy link

itsjeyd commented Dec 14, 2023

@shadinaif Thanks for updating the PR title. Is there anything left for you to do here right now? Or are you just waiting for final approval from @brian-smith-tcril and @OmarIthawi?

@shadinaif
Copy link
Contributor Author

Thank you @itsjeyd , it's ready for final approvals

@OmarIthawi
Copy link
Member

Thanks for the ping @itsjeyd, I'll review this again and let you know.

@itsjeyd
Copy link

itsjeyd commented Dec 21, 2023

Sounds good, thanks for the update @shadinaif and @OmarIthawi!

@itsjeyd itsjeyd removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Dec 21, 2023
Copy link
Member

@OmarIthawi OmarIthawi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OPENEDX_ATLAS_PULL=yes make pull_translations works pretty well.

I think this is ready to merge. Thanks @shadinaif!

@brian-smith-tcril
Copy link

@dianakhuang you are marked as "Please inform" for this repo on the spreadsheet. I plan on merging this by EOD tomorrow, please let me know if there is a reason I should hold off.

Copy link
Contributor

@dianakhuang dianakhuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick review as well, and I think this looks good to me.

@brian-smith-tcril brian-smith-tcril merged commit d3d1326 into openedx:master Jan 10, 2024
5 checks passed
@openedx-webhooks
Copy link

@shadinaif 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@shadinaif shadinaif deleted the shadinaif/atlas-aupport-django-ida branch January 14, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U waiting for eng review PR is ready for review. Review and merge it, or suggest changes.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants