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

404 on jest documentation #6567

Closed
bannier opened this issue Jun 28, 2018 · 29 comments
Closed

404 on jest documentation #6567

bannier opened this issue Jun 28, 2018 · 29 comments

Comments

@bannier
Copy link

bannier commented Jun 28, 2018

🐛 Bug Report

404 on documentation

To Reproduce

Steps to reproduce the behavior:

Expected behavior

doc available

@SimenB
Copy link
Member

SimenB commented Jun 28, 2018

http://facebook.github.io/jest/en/ works ish, but broken static assets...

@whtiehack
Copy link

what happens?

@SimenB
Copy link
Member

SimenB commented Jun 28, 2018

@endiliey @yangshun @JoelMarcey ideas?

@endiliey
Copy link
Contributor

https://github.com/facebook/jest/tree/gh-pages are broken.

I suspect this is somehow related to broken build but circleci is passing.
Maybe related: facebook/docusaurus#805

Sorry, I'm investigating on this !

@yangshun
Copy link
Contributor

yangshun commented Jun 28, 2018

@SimenB The index.html file got deleted in 88f2313. Is it possible to revert gh-pages branch to e406359 for now?

@endiliey
Copy link
Contributor

endiliey commented Jun 28, 2018

I tried yarn build locally and it is actually failing, but it passes on circleci due to non-zero exit code (related to facebook/docusaurus#805, fixed in facebook/docusaurus#809)

I think #6537 broke the website 😢 (will investigate)
A temporary fix is to revert the gh-pages while we work on a PR in jest itself

@whtiehack
Copy link

Please use jest to do a test on the document later . -_^

@SimenB
Copy link
Member

SimenB commented Jun 28, 2018

@endiliey open up a pr with the revert, and I'll merge it. Currently on mobile

@OlivierJM
Copy link
Contributor

Yeah true some other pages are working but with no style, I guess the static assets are broken as mentioned by @SimenB

@SimenB
Copy link
Member

SimenB commented Jun 28, 2018

Works now?

@endiliey
Copy link
Contributor

endiliey commented Jun 28, 2018

Just investigated again. I think this is caused by long running circleci.

https://circleci.com/gh/facebook/jest/27171?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

@OlivierJM
Copy link
Contributor

Yes @SimenB it is now working.

@SimenB
Copy link
Member

SimenB commented Jun 28, 2018

Probably the same as the other "404 during website deploy" issue then...

@endiliey
Copy link
Contributor

endiliey commented Jun 28, 2018

@SimenB seems so. This is tricky though. The website isn't supposed to go down during deployment. It was down for a whole hour because the deploy website circleci was running for a whole hour.

The search is broken now, I've sent a PR for it #6569
Edit: Fixed in algolia itself algolia/docsearch-scraper#384, search is now working

@JoelMarcey
Copy link
Contributor

Do we have any idea why deploy-website is taking on the order of an hour? Normally that should be a fairly quick process.

@endiliey
Copy link
Contributor

@JoelMarcey

It could be circleci. I see another website deploy with docusaurus publish only took ard 6 mins now.
https://circleci.com/gh/facebook/jest/27154
https://circleci.com/gh/facebook/jest/27246

This one (yesterday) took a hour. https://circleci.com/gh/facebook/jest/27171

@JoelMarcey
Copy link
Contributor

I wonder if we added a resource_class: large or something like we did with Docusaurus, if that would help?

@endiliey
Copy link
Contributor

@JoelMarcey
Not really sure, maybe it will help to shorten the build time given that it will increase the cpu & the RAM used on circleci.

But one thing that I notice is that the website went down during merge-spree. (When there are lot of merge). I suspect that subsequent build broke the previous build but publish still got triggered resulting -> broken build being published to gh-pages branch (index.html missing) & the last one is the correct build & will bring it back up.

@SimenB do you notice that it usually went down when there is lot of merge happening concurrently ? Or it just broke randomly ..

@SimenB
Copy link
Member

SimenB commented Jun 30, 2018

Yeah, it seems to go down when we merge a lot of PRs at once.

broken build being published to gh-pages branch (index.html missing)

It's more than just index.html missing - if I went to /en manually I got the markup, but CSS and JS was missing

@JoelMarcey
Copy link
Contributor

Wanna try increasing the Circle resource usage for Jest? We can see if that helps mitigate the problem.

Just add a PR with something similar to https://github.com/facebook/Docusaurus/blob/master/.circleci/config.yml#L31

@SimenB
Copy link
Member

SimenB commented Jul 2, 2018

Worth a try, isn't it? I don't really understand why it goes down, but as it seemingly only does when CI has a lot do, it seems like a fair change to make

@endiliey
Copy link
Contributor

endiliey commented Jul 2, 2018

@SimenB I'm thinking that maybe we can also build a deploy preview in netlify for every PR like how Docusaurus do it. So that next time anyone send a PR there is a netlify (jest website) preview

@SimenB
Copy link
Member

SimenB commented Jul 2, 2018

Yeah, that'd be awesome!

@thymikee
Copy link
Collaborator

thymikee commented Jul 2, 2018

Even better if it could be scoped to detected changes in docs/ dir <3

@endiliey
Copy link
Contributor

endiliey commented Jul 4, 2018

@thymikee

Even better if it could be scoped to detected changes in docs/ dir <3

I think this is not supported out of the box by circleci yet. We could write some script hack like https://gist.github.com/naesheim/18d0c0a58ee61f4674353a2f4cf71475 but I feel that it's hacky though

Yeah, that'd be awesome!

Unfortunately netlify preview can only be setup by person with write access to facebook/jest though. I've set it up for my own pet project but I can assist you on how to setup if you want. @yangshun setup the preview for Docusaurus.

Example:
2
1

@yangshun
Copy link
Contributor

yangshun commented Jul 4, 2018

I think this is not supported out of the box by circleci yet. We could write some script hack like https://gist.github.com/naesheim/18d0c0a58ee61f4674353a2f4cf71475 but I feel that it's hacky though

I don't think this is hacky. It's a fair way of detecting changes. If CircleCI were to implement this, their implementation would likely be similar. This is actually a good addition to make to Docusaurus - teach people how to do previews only if the relevant dirs changed. Also, I think there's no harm running the preview on all PRs. Prettier generates Netlify previews for all their PRs, just that the bot doesn't comment with the link to reduce noise, but the maintainers know where to find the preview if they need to. It's usually in the form of https://deploy-preview-<PR_NUMBER>--<PROJECT>.netlify.com/.

I highly recommend adding Netlify previews to help with reviewing website changes.

@endiliey
Copy link
Contributor

endiliey commented Jul 4, 2018

I don't think this is hacky. It's a fair way of detecting changes. If CircleCI were to implement this, their implementation would likely be similar. This is actually a good addition to make to Docusaurus - teach people how to do previews only if the relevant dirs changed

👍

Also, I think there's no harm running the preview on all PRs. Prettier generates Netlify previews for all their PRs, just that the bot doesn't comment with the link to reduce noise, but the maintainers know where to find the preview if they need to. It's usually in the form of https://deploy-preview-<PR_NUMBER>--.netlify.com/.

Agree. Usually netlify preview are done in the checks. We can open the preview after clicking details
Example:
capture

The commenting is an additional step that needs to be configured in netlify itself.

I highly recommend adding Netlify previews to help with reviewing website changes.

Based on #6613 (comment)
I think the current problem for jest on this part is that you need an access on facebook organization to grant netlify the permission. (collaborators don't have access to bots or settings)

Example:
no facebook

As for the command itself to be ran on netlify, we can use netlify.toml
Example:

// netlify.toml
[build]
  command = "yarn build"
  publish = "build"

[build.environment]
  YARN_FLAGS = "--frozen-lockfile"

....

@SimenB
Copy link
Member

SimenB commented Jul 6, 2018

Hopefully fixed

@SimenB SimenB closed this as completed Jul 6, 2018
@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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants