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(build-info): pass feature flags as json and change plugins to an object #5449

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lukasholzer
Copy link
Contributor

@lukasholzer lukasholzer commented Dec 18, 2023

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:

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)

… object

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.
export type BuildPlugin = {
name: string
/** Plugins that should be always installed */
alwaysInstall?: boolean
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a bit more context to this property? When will it be used? I don't see it being pulled in yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reference is in the PR description

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

@lukasholzer
Copy link
Contributor Author

lukasholzer commented Dec 18, 2023

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/build-info@8.0.0-rc.1

@github-actions github-actions bot added the stale label Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants