-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[code-infra] Refactor Netlify cache-docs
plugin setup
#14105
Changes from all commits
753d32b
cf0ddb6
f7a1d26
2b97a5e
38bcc9e
64a6319
d8091e0
59d8160
89f97fd
1b534f5
c9efc1a
de065b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
PNPM_FLAGS = "--shamefully-hoist" | ||
|
||
[[plugins]] | ||
package = "./node_modules/@mui/monorepo/packages/netlify-plugin-cache-docs" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 Out of scope, but we should try the same trick as we do with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried a minimal setup with the main requirements—manifest file and re-exporting the |
||
package = "./packages/netlify-plugin-cache-docs" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
const fetch = require('node-fetch'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, this wasn't even in package.json? 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope. 🙈 |
||
|
||
/** | ||
* @param {object} event | ||
* @param {string} event.body - https://jsoneditoronline.org/#left=cloud.fb1a4fa30a4f475fa6887071c682e2c1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('@mui/monorepo/packages/netlify-plugin-cache-docs'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name: netlify-plugin-cache-docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested if this solves the
Module not found: Can't resolve '@mui/joy/InitColorSchemeScript'
issue?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that there is nothing to test in that regard.
The issue is the same that we had before bumping
@mui/material
to unblock the bump of@mui/monorepo
and is repeated when a stale cache is picked up. 🙈Do you have reasons to believe that the culprit of the failure are different? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I forgot about that one.
I'm not sure it's only about caching, because we do run
pnpm install
after the cache is restored.So it shouldn't matter if the cache is stale, it should be invalidated and dependencies should be properly resolved.
Right?
I was looking for the problem on our side, and this is why I opened #14104. But perhaps this was just a coincidence, I'm confused now 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only
mui-x
was having problems, I would have also investigated possible problems on our end.But the problem is that both
material-ui
andmui-x
started having the same problems at the same time. 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand how stale cache can survive pnpm install though 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should try downgrading pnpm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Netlify caches everything.
Maybe the installation problem gets fixed after running
pnpm install
, but the build files (.next
directory) have also been saved and could make the build fail depending on howNetlify
manages this case... 🙈WDYT, does that sound feasible?
We could consider no longer caching the
.next
folder, but that would slow down many deploys significantly. 🙈 🤷There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested the build both with
docs/.next
caching and without and it seems like the difference in build time is somewhat negligible. 🙈1st build is without cache, the second is with it...
WDYT @mui/code-infra, does it make sense to additionally cache
docs/.next
? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the same last week in my local setup and the difference in next build time seemed to be about 1 to 2 ratio. (
time pnpm docs:build
with and without.next
folder present)The build step (
next build
) in both your builds takes about 4-5 minutes. I looked at a random other X netlify build and the build step is about 2-3 minutes. Are you sure the one you say is using cache is actually using cache?(build.command completed in 4m 24.6s)
and(build.command completed in 4m 56.8s)
for your two builds(build.command completed in 2m 44.8s)
for the build of https://app.netlify.com/sites/material-ui-x/deploys/66b23f0206998000085c0eff(Also, we can probably just cache
.next/cache
instead of the whole.next
folder)Two more options I'd consider trying:
edit: best to look at actual build times in the logs. There will be less variation. I think the Netlify overall build time includes queueing as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried that, you can find it in the "Disproved theories" section in #14104