jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.13k stars 6.45k forks source link

404 on jest documentation #6567

Closed bannier closed 6 years ago

bannier commented 6 years ago

🐛 Bug Report

404 on documentation

To Reproduce

Steps to reproduce the behavior:

Expected behavior

doc available

SimenB commented 6 years ago

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

whtiehack commented 6 years ago

what happens?

SimenB commented 6 years ago

@endiliey @yangshun @JoelMarcey ideas?

endiliey commented 6 years ago

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: https://github.com/facebook/Docusaurus/issues/805

Sorry, I'm investigating on this !

yangshun commented 6 years ago

@SimenB The index.html file got deleted in https://github.com/facebook/jest/commit/88f23134fec278a127131306dbc343a3c4d69e5c. Is it possible to revert gh-pages branch to https://github.com/facebook/jest/commit/e40635951590bafe56f87f6418ad49de141974bd for now?

endiliey commented 6 years ago

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 https://github.com/facebook/Docusaurus/pull/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 commented 6 years ago

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

SimenB commented 6 years ago

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

OlivierJM commented 6 years ago

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

SimenB commented 6 years ago

Works now?

endiliey commented 6 years ago

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 commented 6 years ago

Yes @SimenB it is now working.

SimenB commented 6 years ago

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

endiliey commented 6 years ago

@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 https://github.com/algolia/docsearch-scraper/pull/384, search is now working

JoelMarcey commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

endiliey commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

Yeah, that'd be awesome!

thymikee commented 6 years ago

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

endiliey commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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---.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 https://github.com/facebook/jest/pull/6613#issuecomment-402447789 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 commented 6 years ago

Hopefully fixed

github-actions[bot] commented 3 years ago

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.