build icon indicating copy to clipboard operation
build copied to clipboard

feat(build-info): pass feature flags as json and change plugins to an object

Open lukasholzer opened this issue 1 year ago โ€ข 1 comments

BREAKING CHANGE: Plugin build settings now use an object array, not string lists, allowing extra details like install source and if always needed at runtime.

๐ŸŽ‰ Thanks for submitting a pull request! ๐ŸŽ‰

Summary

Fixes https://linear.app/netlify/issue/FRA-139/update-build-info-to-include-netlifynext-runtime

Currently, we have a lot of hardcoded instances of the next runtime inside the react UI and the CLI, where we determine if it needs to be auto-installed:

  • https://github.com/netlify/netlify-react-ui/blob/main/apps/netlify-react-ui/src/actions/repos.ts#L219-L239
  • https://github.com/netlify/cli/blob/main/src/utils/init/utils.ts#L19-L43

CleanShot 2023-12-18 at 10 55 55

This makes it hard to roll out the new runtime over a central place. Therefore, I've introduced a breaking change here, making the plugins an array of objects that contains the additional information that the next runtime should always be automatically installed.

Based on the feature flag, we can now roll out the new or old runtime seamlessly with this change.

Therefore we had to change the featureflags to be a JSON of key value objects to retrieve the value of the string flag.


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)

lukasholzer avatar Dec 18 '23 09:12 lukasholzer

I'm going to cut a pre-release before merging this and trying to prepare the breaking changes already upfront on the repositories.

Latest RC version is on @netlify/[email protected]

lukasholzer avatar Dec 18 '23 10:12 lukasholzer