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

Website deploy is broken #8707

Closed
SimenB opened this issue Jul 17, 2019 · 10 comments
Closed

Website deploy is broken #8707

SimenB opened this issue Jul 17, 2019 · 10 comments

Comments

@SimenB
Copy link
Member

SimenB commented Jul 17, 2019

See https://circleci.com/gh/facebook/jest/67119

Seems to explode when getting Spanish translations?

Error: A JSONObject text must begin with '{' at 1 [character 2 line 1]

@yangshun @endiliey @JoelMarcey (sorry... dunno who else to ask) is this something you know how to debug?

@endiliey
Copy link
Contributor

I suspect the generated i18n json file is invalid. Will need more investigation

@endiliey
Copy link
Contributor

endiliey commented Jul 21, 2019

Oops. I almost forgot about this.

I am unable to debug this without jest's crowdin api key.
Can I get CROWDIN_JEST_API_KEY to debug this cc @JoelMarcey ?

@JoelMarcey
Copy link
Contributor

I don't have full access to that key. I don't have access to the Jest Crowdin settings either.

@ericnakagawa do you happen to have access to Jest's Crowdin settings?

@SimenB Do you know anyone else who might?

@SimenB
Copy link
Member Author

SimenB commented Jul 24, 2019

I don't - I'd have suggested @ericnakagawa

@ericnakagawa
Copy link
Contributor

I have the key, endiliey I'll dm you it.

@endiliey
Copy link
Contributor

So i was able to simulate the circleci environment with jest's crowdin api key but was not able to reproduce the error. The spanish translation is fine

image

It seems to be a transient issue as website deploy has been working for jest now https://circleci.com/gh/facebook/jest/67767?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

From the error defined in the circleci, it also suggests that it is an error in crowdin-cli during download step defined here https://github.com/facebook/jest/blob/f857d309646154f6ae587ec744195453030d1f7e/.circleci/website.sh#L18-L24

The error itself is in fact a well known Java error (and docusaurus doesn't use java, only the crowdin-cli) https://stackoverflow.com/questions/22062056/a-jsonobject-text-must-begin-with-at-1-character-2-line-1-with-error

Error: A JSONObject text must begin with '{' at 1 [character 2 line 1]

Given that jest has so many translation files, it is more than possible that the files got corrupted during download, or some transient issue

My recommendation

Checking at https://crowdin.com/project/jest
There are too many languages being translated at 0%. Due to the nature of crowdin downloading all enabled languages, i suggest disabling the languages that has been not getting any activity on translation to optimize the CI

@SimenB
Copy link
Member Author

SimenB commented Jul 26, 2019

Seems fair to disable the 0% ones. If somebody wants to translate them, how would it be enabled again?

@endiliey
Copy link
Contributor

It's unfortunate that crowdin-cli download is abit inflexible. I wish it can ignore downloading low % translated languages or download certain languages only
https://github.com/crowdin/crowdin-cli/issues/38I

For example, there are 39 languages defined in https://crowdin.com/project/jest and we have no choice but to download every single languages.

Crowdin-cli download only has two choices

download 1 language only

crowdin-cli download -l <language_code>

or download all enabled languages in crowdin

crowdin-cli download

A quick win-win solution but abit ugly for us all is to change
https://github.com/facebook/jest/blob/f857d309646154f6ae587ec744195453030d1f7e/.circleci/website.sh#L24

to

yarn crowdin-download -l es-ES
yarn crowdin-download -l uk
# other wanted languages

No need to disable anything in crowdin. i can send a pr

@endiliey
Copy link
Contributor

#8752

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants