Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

fix: add feature flag for the inheritance of the Node.js version from build #1394

Merged
merged 4 commits into from
Apr 24, 2023

Conversation

danez
Copy link
Contributor

@danez danez commented Apr 20, 2023

Summary

I just want to make sure, we can turn this feature off completely. a featureFlag in build would actually not be able to 100% disable it.

Ref: https://github.com/netlify/pod-compute/issues/64


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)

@danez danez requested a review from a team April 20, 2023 14:39
@danez danez self-assigned this Apr 20, 2023

export type FeatureFlag = keyof typeof defaultFlags
export type FeatureFlags = Record<FeatureFlag, boolean>
export type FeatureFlags = Partial<Record<keyof typeof defaultFlags, boolean>>
Copy link
Contributor Author

@danez danez Apr 20, 2023

Choose a reason for hiding this comment

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

The type changes make it so that we have autocompletion and validation for all feature flags. The are Partial because it would be totally valid to input an empty object for example.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2023

⏱ Benchmark results

Comparing with 3ba9b49

largeDepsEsbuild: 2.1s

⬇️ 1.61% decrease vs. 3ba9b49

^                                   2.9s                                          
│                                   ┌──┐                                          
│                           2.6s    |  |                                          
│                           ┌──┐    |  |            2.5s                          
│                           |  |    |  |            ┌──┐                          
│ ──2.2s────2.2s────────────┼──┼────┼──┼────2.2s────┼──┼────2.1s────2.1s──────────
│   ┌──┐    ┌──┐     2s     |  |    |  |    ┌──┐    |  |    ┌──┐    ┌──┐    2.1s  
│   |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsNft: 8.7s

⬆️ 3.66% increase vs. 3ba9b49

^                                  11.8s                                          
│                                   ┌──┐                                          
│                                   |  |                                          
│                           10s     |  |            9.9s                          
│                           ┌──┐    |  |            ┌──┐                          
│   8.7s                    |  |    |  |            |  |                    8.7s  
│ ──┌──┐────8.5s────────────┼──┼────┼──┼────8.5s────┼──┼────8.1s────8.3s────┌──┐──
│   |  |    ┌──┐    7.6s    |  |    |  |    ┌──┐    |  |    ┌──┐    ┌──┐    |▒▒|  
│   |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsZisi: 16s

⬆️ 0.58% increase vs. 3ba9b49

^                                  21.4s                                          
│                                   ┌──┐                                          
│                                   |  |           19.1s                          
│                          17.8s    |  |            ┌──┐                          
│                           ┌──┐    |  |            |  |                          
│ ─16.2s───15.9s────────────┼──┼────┼──┼───16.2s────┼──┼───15.6s────16s─────16s───
│   ┌──┐    ┌──┐   15.5s    |  |    |  |    ┌──┐    |  |    ┌──┐    ┌──┐    ┌──┐  
│   |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

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

When you say "build", you're talking about the deployment configuration API, right? If so, I think it would be important to reflect that in the naming of things, otherwise it gets a bit confusing.

khendrikse
khendrikse previously approved these changes Apr 21, 2023
@danez
Copy link
Contributor Author

danez commented Apr 21, 2023

When you say "build", you're talking about the deployment configuration API, right? If so, I think it would be important to reflect that in the naming of things, otherwise it gets a bit confusing.

No i mean @nelify/build. It sets nodeVersion through the node js api.

@kodiakhq kodiakhq bot merged commit cf04b49 into main Apr 24, 2023
@kodiakhq kodiakhq bot deleted the ffversion branch April 24, 2023 13:17
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
… build (netlify/zip-it-and-ship-it#1394)

* fix: add feature flag for the inheritance of the Node.js version from build

* Update feature_flags.ts

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants