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

feat: pass default config for resolveUpdatedConfig instead of cached config #5761

Conversation

lukasholzer
Copy link
Contributor

@lukasholzer lukasholzer commented Jul 10, 2024

🎉 Thanks for submitting a pull request! 🎉

Summary

Needed for: https://linear.app/netlify/issue/CT-738/cli-should-use-framework-detection-and-install-runtime-for-build-and

Changing this PR https://github.com/netlify/build/pull/5735/files to use the defaultConfig instead of the cachedConfig

As config mutations are not applied in @netlify/config if a cached config is passed:

CleanShot 2024-07-10 at 12 11 48


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

Copy link
Contributor

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

@lukasholzer lukasholzer marked this pull request as ready for review July 11, 2024 09:00
@lukasholzer lukasholzer requested review from a team as code owners July 11, 2024 09:00
if (parsedCachedConfig !== undefined) {
// if we receive a defaultConfig (something the CLI can set for the runBuild with defaults)
// we need to invalidate the cached config
if (parsedCachedConfig !== undefined && opts.defaultConfig === undefined) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eduardoboucas this is the main change here that makes it possible

packages/config/src/main.ts Outdated Show resolved Hide resolved
Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
@lukasholzer lukasholzer enabled auto-merge (squash) July 11, 2024 11:54
@lukasholzer lukasholzer merged commit 011ce3a into main Jul 11, 2024
37 checks passed
@lukasholzer lukasholzer deleted the feat/pass-default-config-for-config-mutations-instead-of-cached-config branch July 11, 2024 13:47
This was referenced Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants