freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

Discussion around handling English fallback of i18n challenges

Open naomi-lgbt opened this issue 2 years ago • 7 comments

This came up in our issue triage meeting, but to prevent the conversation getting lost I'm creating an issue thread.

Current Issue

When we modify the order of the English curriculum in a way that results in new files being added, running an i18n build will error out if the changes haven't been synced to that language. This means we can not rely on our CI on the main branch to indicate the safety of running a deployment.

This only affects superblocks that are marked as isAudited, as far as I know.

Potential Fixes

I had a couple of thoughts on how to address this.

Sync the Files

We could write an action that runs when new files are added on main and have that action trigger the Crowdin upload/download flows.

Test the Files

If we'd rather just have an indication that the build will not succeed, and want to save some action runner hours, we could add a CI on main that confirms all files in the English challenges are also in the audited i18n challenges.

naomi-lgbt avatar Jul 20 '22 15:07 naomi-lgbt

We could write an action that runs when new files are added on main and have that action trigger the Crowdin upload/download flows.

If we'd rather just have an indication that the build will not succeed, and want to save some action runner hours, we could add a CI on main that confirms all files in the English challenges are also in the audited i18n challenges.

I think both of these are reasonable.

Plus, I think with the ongoing decoupling and containerization, we do not have to build all the languages in lockstep with one another like we are with our Pipelines right now.

raisedadead avatar Jul 20 '22 15:07 raisedadead

We could write an action that runs when new files are added on main and have that action trigger the Crowdin upload/download flows.

I don't think that alone is enough. The problem last time was that the new challenge did not have a 100% proofread version, so the sync did nothing.

ojeytonwilliams avatar Jul 20 '22 15:07 ojeytonwilliams

We can change that in the configuration to allow non-translated files to download, but it'll slow things down.

naomi-lgbt avatar Jul 20 '22 15:07 naomi-lgbt

If it's not prohibitively slow, that's probably the way to go. If it is slow, how about doing it on demand when we want to clear a path for deployment?

ojeytonwilliams avatar Jul 20 '22 16:07 ojeytonwilliams

https://github.com/freeCodeCamp/freeCodeCamp/runs/7566402154?check_suite_focus=true

The validation seems to be working as intended. Do we want to explore further solutions or are we satisfied enough to close this issue?

naomi-lgbt avatar Jul 28 '22 19:07 naomi-lgbt

I guess so. To be clear, if I understand this correctly:

  1. Once the said workflow fails, we need the languages to catch up before deploying. While the languages can take a while to get caught up, the Crowdin workflows will at least get us the replacement files needed for the builds.
  2. If we need to deploy urgently, we should run the Crowdin upload/download workflows first.
  3. Alternatively, we just wait for the daily cron-based triggers, which will do step 2 above.

raisedadead avatar Jul 29 '22 08:07 raisedadead

If we need to deploy urgently, we should run the Crowdin upload/download workflows first.

Kind of. As Naomi said, we need to change the config for that to work. A separate config that doesn't skip untranslated files should be enough, but we should test next time we insert a new step.

ojeytonwilliams avatar Jul 29 '22 16:07 ojeytonwilliams

OK - in that case, @naomi-lgbt can you please update the workflow to also run specifically on PRs created by Camperbot for the Curriculum files for gatekeeping the main branch? Also while you are at it we could do an @mention to i18n team in the Crowdin PR when the check fails.

raisedadead avatar Aug 01 '22 04:08 raisedadead