Skip to content

Commit bda022c

Browse files
authored
chore: remove plugins_break_builds_with_unsupported_plugin_versions feature flag (#4776)
* chore: remove plugins_break_builds_with_unsupported_plugin_versions feature flag * chore: more cleanup * chore: forgot to add the removal of a fixture * docs: update CONTRIBUTING.md to include info on how to run tests locally
1 parent 991e4cd commit bda022c

File tree

12 files changed

+25
-130
lines changed

12 files changed

+25
-130
lines changed

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,29 @@ To speed up CI, we load balance the tests across multiple machines. The informat
5757
is stored in `tests-metadata.json`, and later used by our test [runner](ava.config.js#L10). To regenerate the data (e.g.
5858
when adding a new test file) run `npm test:measure` and commit the changes to GitHub.
5959

60+
### Testing locally
61+
62+
The `@netlify/testing` package will need to be built regardless of which package you are working on. In order to do this
63+
run the following from the root directory:
64+
65+
```
66+
npm run build -- --scope=@netlify/testing
67+
```
68+
69+
If you wish to build all of the projects for whatever reason, the command is `npm run build`.
70+
71+
From there, you can run tests for a particular package by running:
72+
73+
```
74+
npm run test -- --scope=<name of package as it appears in 'name' field in package.json>
75+
```
76+
77+
For example, if you wished to run tests for the `build` package:
78+
79+
```
80+
npm run test -- --scope=@netlify/build
81+
```
82+
6083
## Releasing
6184

6285
For more details, please refer to the

packages/build/src/core/feature_flags.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,4 @@ export const DEFAULT_FEATURE_FLAGS = {
1818
buildbot_zisi_esbuild_parser: false,
1919
edge_functions_cache_cli: false,
2020
edge_functions_system_logger: false,
21-
// TODO: remove this flag once rolled out to everyone
22-
// FF link: https://app.launchdarkly.com/default/production/features/plugins_break_builds_with_unsupported_plugin_versions/targeting
23-
plugins_break_builds_with_unsupported_plugin_versions: false,
2421
}

packages/build/src/log/messages/compatibility.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import semver from 'semver'
22

3-
import { addErrorInfo } from '../../error/info.js'
43
import { isRuntime } from '../../utils/runtime.js'
54
import { isPreviousMajor } from '../../utils/semver.js'
65
import { getPluginOrigin } from '../description.js'
@@ -84,17 +83,13 @@ const getVersionField = function ([versionFieldName, version]) {
8483

8584
// Print a warning message when old versions plugins are used.
8685
// This can only happen when they are installed to `package.json`.
87-
// Also throws an error if the Next runtime is >= 4.0.0 || < 4.26.0
88-
export const logOutdatedPlugins = function (logs: BufferedLogs, pluginsOptions, featureFlags) {
86+
export const logOutdatedPlugins = function (logs: BufferedLogs, pluginsOptions) {
8987
const outdatedPlugins = pluginsOptions.filter(hasOutdatedVersion).map(getOutdatedPlugin)
9088

9189
if (outdatedPlugins.length === 0) {
9290
return
9391
}
9492

95-
// TODO: remove feature flag once fully rolled out
96-
if (featureFlags.plugins_break_builds_with_unsupported_plugin_versions)
97-
throwIfUnsupportedPluginVersion(pluginsOptions.filter(hasOutdatedVersion))
9893
logWarningSubHeader(logs, 'Outdated plugins')
9994
logWarningArray(logs, outdatedPlugins)
10095
}
@@ -151,34 +146,6 @@ export const logIncompatiblePlugins = function (logs, pluginsOptions) {
151146
logWarningArray(logs, incompatiblePlugins)
152147
}
153148

154-
// Throws an error if the Next runtime is >= 4.0.0 || < 4.26.0, otherwise returns.
155-
const throwIfUnsupportedPluginVersion = function (outdatedPlugins: any[]) {
156-
let packageName
157-
let version
158-
let latestVersion
159-
const nextOutdatedV4Plugin = outdatedPlugins.find((plugin) => {
160-
packageName = plugin.pluginPackageJson.name
161-
version = plugin.pluginPackageJson.version
162-
latestVersion = plugin.latestVersion
163-
// https://github.com/npm/node-semver#hyphen-ranges-xyz---abc
164-
// semver hyphen range is inclusive 4.0.0 - 4.25.0 is same as >= 4.0.0 || < 4.26.0;
165-
return (
166-
packageName === '@netlify/plugin-nextjs' &&
167-
semver.satisfies(version, '4.0.0 - 4.25.0', { includePrerelease: true })
168-
)
169-
})
170-
171-
if (!nextOutdatedV4Plugin) {
172-
return
173-
}
174-
175-
const error = new Error(
176-
`This site cannot be built because it is using an outdated version of the Next.js Runtime: ${packageName}@${version}. Versions greater than 4.26.0 are recommended. To upgrade this plugin, please update its version in "package.json" to the latest version: ${latestVersion}. If you cannot use a more recent version, please contact support at https://www.netlify.com/support for guidance.`,
177-
)
178-
addErrorInfo(error, { type: 'pluginUnsupportedVersion' })
179-
throw error
180-
}
181-
182149
const hasIncompatibleVersion = function ({ pluginPackageJson: { version }, compatibleVersion, compatWarning }) {
183150
return (
184151
compatWarning !== '' &&

packages/build/src/plugins/spawn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const CHILD_MAIN_FILE = fileURLToPath(new URL('child/main.js', import.meta.url))
2525
const tStartPlugins = async function ({ pluginsOptions, buildDir, childEnv, logs, debug, featureFlags }) {
2626
logRuntime(logs, pluginsOptions)
2727
logLoadingPlugins(logs, pluginsOptions, debug)
28-
logOutdatedPlugins(logs, pluginsOptions, featureFlags)
28+
logOutdatedPlugins(logs, pluginsOptions)
2929
logIncompatiblePlugins(logs, pluginsOptions)
3030

3131
const childProcesses = await Promise.all(

packages/build/tests/functions/fixtures/functions_package_json_invalid/package.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/build/tests/plugins_list/fixtures/plugins_unsupported_version_package_json/netlify.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/build/tests/plugins_list/fixtures/plugins_unsupported_version_package_json/node_modules/@netlify/plugin-nextjs/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/build/tests/plugins_list/fixtures/plugins_unsupported_version_package_json/node_modules/@netlify/plugin-nextjs/manifest.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/build/tests/plugins_list/fixtures/plugins_unsupported_version_package_json/node_modules/@netlify/plugin-nextjs/package.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/build/tests/plugins_list/fixtures/plugins_unsupported_version_package_json/package.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)