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: clean up feature flags #5728

Merged
merged 8 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/build/src/core/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,10 @@ const initAndRunBuild = async function ({
systemLog,
})

const pluginsEnv = featureFlags.build_inject_blobs_context
? { ...childEnv, ...getBlobsEnvironmentContext({ api, deployId: deployId, siteId: siteInfo?.id, token }) }
: childEnv
const pluginsEnv = {
...childEnv,
...getBlobsEnvironmentContext({ api, deployId: deployId, siteId: siteInfo?.id, token }),
}

if (pluginsOptionsA?.length) {
const buildPlugins = {}
Expand Down
4 changes: 0 additions & 4 deletions packages/build/src/core/feature_flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ const getFeatureFlag = function (name: string): FeatureFlags {

// Default values for feature flags
export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
build_inject_blobs_context: false,
buildbot_zisi_trace_nft: false,
buildbot_zisi_esbuild_parser: false,
buildbot_zisi_system_log: false,
edge_functions_cache_cli: false,
edge_functions_system_logger: false,
netlify_build_reduced_output: false,
netlify_build_updated_plugin_compatibility: false,
netlify_build_frameworks_api: false,
Expand Down
9 changes: 4 additions & 5 deletions packages/build/src/plugins_core/edge_functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ const coreStep = async function ({

logFunctions({ frameworksAPISrcPath, internalSrcDirectory, internalSrcPath, logs, srcDirectory, srcPath })

// If we're running in buildbot and the feature flag is enabled, we set the
// Deno cache dir to a directory that is persisted between builds.
const cacheDirectory =
!isRunningLocally && featureFlags.edge_functions_cache_cli ? resolve(buildDir, DENO_CLI_CACHE_DIRECTORY) : undefined
// If we're running in buildbot, we set the Deno cache dir to a directory
// that is persisted between builds.
const cacheDirectory = !isRunningLocally ? resolve(buildDir, DENO_CLI_CACHE_DIRECTORY) : undefined

// Cleaning up the dist directory, in case it has any artifacts from previous
// builds.
Expand Down Expand Up @@ -115,7 +114,7 @@ const coreStep = async function ({
featureFlags,
importMapPaths,
userLogger: (...args) => log(logs, reduceLogLines(args)),
systemLogger: featureFlags.edge_functions_system_logger ? systemLog : undefined,
systemLogger: systemLog,
internalSrcFolder: generatedFunctionsPath,
bootstrapURL: edgeFunctionsBootstrapURL,
vendorDirectory,
Expand Down
2 changes: 1 addition & 1 deletion packages/build/src/plugins_core/functions/zisi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const getZisiParameters = ({
repositoryRoot,
configFileDirectories,
internalSrcFolder: internalFunctionsSrc,
systemLog: featureFlags.buildbot_zisi_system_log ? systemLog : undefined,
systemLog,
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/build/tests/edge_functions/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,10 @@ Generated by [AVA](https://avajs.dev).
Packaging Edge Functions from netlify/edge-functions directory:␊
- function-1␊
Local version of types is up-to-date: HEXADECIMAL_ID␊
Using global installation of Deno CLI␊
Using global installation of Deno CLI␊
No in-source config found for edge function at 'packages/build/tests/edge_functions/fixtures/functions_user/netlify/edge-functions/function-1.ts'␊
Edge Functions manifest: {"bundles":[{"asset":"HEXADECIMAL_ID.eszip","format":"eszip2"}],"routes":[{"function":"function-1","pattern":"^/one/?$","excluded_patterns":[],"path":"/external/path"}],"post_cache_routes":[],"bundler_version":"1.0.0","layers":[],"import_map":"netlify:import-map","function_config":{}}␊
(Edge Functions bundling completed in 1ms)␊
Expand Down
Binary file modified packages/build/tests/edge_functions/snapshots/tests.js.snap
Binary file not shown.
1 change: 0 additions & 1 deletion packages/build/tests/plugins/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ test('Plugins have a pre-populated Blobs context', async (t) => {
.withFlags({
apiHost: host,
deployId,
featureFlags: { build_inject_blobs_context: true },
testOpts: { scheme },
siteId,
token,
Expand Down
Loading