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

First draft of running the I18n Sync Down & Out periodically throughout the week. #36750

Merged
merged 6 commits into from Sep 17, 2020

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Sep 14, 2020

This ended up being a lot simpler than I expected!

Specifically, we ended up just needing to make a couple tweaks to how the server manages its branches. Previously, the server would create the i18n sync branches during the i18n sync and then switch back to staging so it could continue to build. This means we are effectively "rewinding" the state of the server after the i18n sync, which would cause problems if we attempt to do more syncs before merging the sync PRs.

What we do now is simply stay on the i18n sync branch until we've detected that the branch has been merged into staging and only then do we switch back to staging. If all goes well, this should mean that the server is only ever moving "forwards" in git history. This is somewhat more fragile than the setup we had before, so it could very well break if things don't go well, but because the i18n server is fairly isolated I'd suggest we deal with that potential chaos as it arises, rather than trying to anticipate.

Links

Testing story

I tested this out manually and added a unit test for the new github functionality, but this will still need some close monitoring once it gets merged.

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@Hamms Hamms requested a review from a team as a code owner September 14, 2020 20:22
# make sure the server gets seeded with latest level content for the sync in.
# Note that the CI_ONLY_BUILD environment variable is necessary; the server is
# not set up to actually serve a version of the website, and it will fail to
# build correctly if not thus restricted.
0 */4 * * * cd /home/ubuntu/code-dot-org && CI_ONLY_BUILD=true bundle exec ./bin/cronjob ./aws/ci_build >>/tmp/cronlog 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this run if we're not on the staging branch? Notably, I'm worried about a situation where we run the sync on Tuesday, never switch back to the staging branch, then the Monday sync is several days out of date.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, whoops I forgot to commit that change! One moment

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh the continuous sync doesn't switch branches. That still means it won't be able to pull from staging if there are conflicting files but I guess that's just something to look out for.

Copy link
Contributor Author

@Hamms Hamms Sep 16, 2020

Choose a reason for hiding this comment

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

That's correct! The idea is that we progress through the branches like this:

  1. Start on staging branch. From here, we will run the CI build to update our sources files from staging latest, and also run the continuous sync to update our translation files from Crowdin.
  2. Sunday evening, we run the I18n sync, which switches us to the i18n sync branch. From here we can continue to run the continuous sync, but won't run the CI build.
  3. Once the sync PRs have been merged, we switch back to the staging branch, which now includes the latest sync changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation! And of course the i18n down/out steps don't change any English files so the chance of conflict is low.

@Hamms Hamms merged commit 715bae2 into staging Sep 17, 2020
@Hamms Hamms deleted the more-frequent-i18n-sync branch September 17, 2020 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants