Skip to content

Commit 80226dd

Browse files
authoredJun 23, 2024··
feat: clean up feature flags (#5728)
* feat: remove `build_inject_blobs_context` * feat: remove `buildbot_zisi_system_log` * feat: remove `edge_functions_system_logger` * feat: remove `edge_functions_cache_cli` * chore: update snapshot * chore: update snapshot
1 parent 9a4d3b0 commit 80226dd

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed
 

Diff for: ‎packages/build/src/core/build.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,10 @@ const initAndRunBuild = async function ({
464464
systemLog,
465465
})
466466

467-
const pluginsEnv = featureFlags.build_inject_blobs_context
468-
? { ...childEnv, ...getBlobsEnvironmentContext({ api, deployId: deployId, siteId: siteInfo?.id, token }) }
469-
: childEnv
467+
const pluginsEnv = {
468+
...childEnv,
469+
...getBlobsEnvironmentContext({ api, deployId: deployId, siteId: siteInfo?.id, token }),
470+
}
470471

471472
if (pluginsOptionsA?.length) {
472473
const buildPlugins = {}

Diff for: ‎packages/build/src/core/feature_flags.ts

-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ const getFeatureFlag = function (name: string): FeatureFlags {
1515

1616
// Default values for feature flags
1717
export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
18-
build_inject_blobs_context: false,
1918
buildbot_zisi_trace_nft: false,
2019
buildbot_zisi_esbuild_parser: false,
21-
buildbot_zisi_system_log: false,
22-
edge_functions_cache_cli: false,
23-
edge_functions_system_logger: false,
2420
netlify_build_reduced_output: false,
2521
netlify_build_updated_plugin_compatibility: false,
2622
netlify_build_frameworks_api: false,

Diff for: ‎packages/build/src/plugins_core/edge_functions/index.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ const coreStep = async function ({
7777

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

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

8584
// Cleaning up the dist directory, in case it has any artifacts from previous
8685
// builds.
@@ -115,7 +114,7 @@ const coreStep = async function ({
115114
featureFlags,
116115
importMapPaths,
117116
userLogger: (...args) => log(logs, reduceLogLines(args)),
118-
systemLogger: featureFlags.edge_functions_system_logger ? systemLog : undefined,
117+
systemLogger: systemLog,
119118
internalSrcFolder: generatedFunctionsPath,
120119
bootstrapURL: edgeFunctionsBootstrapURL,
121120
vendorDirectory,

Diff for: ‎packages/build/src/plugins_core/functions/zisi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const getZisiParameters = ({
7171
repositoryRoot,
7272
configFileDirectories,
7373
internalSrcFolder: internalFunctionsSrc,
74-
systemLog: featureFlags.buildbot_zisi_system_log ? systemLog : undefined,
74+
systemLog,
7575
}
7676
}
7777

Diff for: ‎packages/build/tests/edge_functions/snapshots/tests.js.md

+4
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,10 @@ Generated by [AVA](https://avajs.dev).
652652
653653
Packaging Edge Functions from netlify/edge-functions directory:␊
654654
- function-1␊
655+
Local version of types is up-to-date: HEXADECIMAL_ID␊
656+
Using global installation of Deno CLI␊
657+
Using global installation of Deno CLI␊
658+
No in-source config found for edge function at 'packages/build/tests/edge_functions/fixtures/functions_user/netlify/edge-functions/function-1.ts'␊
655659
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":{}}␊
656660
657661
(Edge Functions bundling completed in 1ms)␊
82 Bytes
Binary file not shown.

Diff for: ‎packages/build/tests/plugins/tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ test('Plugins have a pre-populated Blobs context', async (t) => {
391391
.withFlags({
392392
apiHost: host,
393393
deployId,
394-
featureFlags: { build_inject_blobs_context: true },
395394
testOpts: { scheme },
396395
siteId,
397396
token,

0 commit comments

Comments
 (0)
Please sign in to comment.