@netlify/build 29.5.1 → 29.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/plugins/list.js +3 -3
- package/lib/telemetry/main.js +6 -9
- package/package.json +7 -7
package/lib/plugins/list.js
CHANGED
|
@@ -3,6 +3,8 @@ import got from 'got';
|
|
|
3
3
|
import isPlainObj from 'is-plain-obj';
|
|
4
4
|
import { logPluginsList, logPluginsFetchError } from '../log/messages/plugins.js';
|
|
5
5
|
import { CONDITIONS } from './compatibility.js';
|
|
6
|
+
// 1 minute HTTP request timeout
|
|
7
|
+
const PLUGINS_LIST_TIMEOUT = 6e4;
|
|
6
8
|
// Retrieve the list of plugins officially vetted by us and displayed in our
|
|
7
9
|
// plugins directory UI.
|
|
8
10
|
// We fetch this list during each build (no caching) because we want new
|
|
@@ -24,7 +26,7 @@ export const getPluginsList = async function ({ debug, logs, testOpts: { plugins
|
|
|
24
26
|
};
|
|
25
27
|
const fetchPluginsList = async function ({ logs, pluginsListUrl }) {
|
|
26
28
|
try {
|
|
27
|
-
const { body } = await got(pluginsListUrl, { responseType: 'json', timeout: PLUGINS_LIST_TIMEOUT });
|
|
29
|
+
const { body } = await got(pluginsListUrl, { responseType: 'json', timeout: { request: PLUGINS_LIST_TIMEOUT } });
|
|
28
30
|
if (!isValidPluginsList(body)) {
|
|
29
31
|
throw new Error(`Request succeeded but with an invalid response:\n${JSON.stringify(body, null, 2)}`);
|
|
30
32
|
}
|
|
@@ -41,8 +43,6 @@ const fetchPluginsList = async function ({ logs, pluginsListUrl }) {
|
|
|
41
43
|
return oldPluginsList;
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
|
-
// 1 minute HTTP request timeout
|
|
45
|
-
const PLUGINS_LIST_TIMEOUT = 6e4;
|
|
46
46
|
const isValidPluginsList = function (pluginsList) {
|
|
47
47
|
return Array.isArray(pluginsList) && pluginsList.every(isPlainObj);
|
|
48
48
|
};
|
package/lib/telemetry/main.js
CHANGED
|
@@ -8,7 +8,7 @@ const DEFAULT_TELEMETRY_TIMEOUT = 1200;
|
|
|
8
8
|
const DEFAULT_TELEMETRY_CONFIG = {
|
|
9
9
|
origin: 'https://api.segment.io/v1',
|
|
10
10
|
writeKey: 'dWhlM1lYSlpNd1k5Uk9rcjFra2JSOEoybnRjZjl0YTI6',
|
|
11
|
-
timeout: DEFAULT_TELEMETRY_TIMEOUT,
|
|
11
|
+
timeout: { request: DEFAULT_TELEMETRY_TIMEOUT },
|
|
12
12
|
};
|
|
13
13
|
// Send telemetry request when build completes
|
|
14
14
|
export const trackBuildComplete = async function ({ deployId, buildId, status, stepsCount, pluginsOptions, durationNs, siteInfo, telemetry, userNodeVersion, framework, testOpts: { telemetryOrigin = DEFAULT_TELEMETRY_CONFIG.origin, telemetryTimeout = DEFAULT_TELEMETRY_CONFIG.timeout }, }) {
|
|
@@ -27,10 +27,7 @@ export const trackBuildComplete = async function ({ deployId, buildId, status, s
|
|
|
27
27
|
userNodeVersion,
|
|
28
28
|
framework,
|
|
29
29
|
});
|
|
30
|
-
await track({
|
|
31
|
-
payload,
|
|
32
|
-
config: { ...DEFAULT_TELEMETRY_CONFIG, origin: telemetryOrigin, timeout: telemetryTimeout },
|
|
33
|
-
});
|
|
30
|
+
await track(payload, { ...DEFAULT_TELEMETRY_CONFIG, origin: telemetryOrigin, timeout: telemetryTimeout });
|
|
34
31
|
}
|
|
35
32
|
catch (error) {
|
|
36
33
|
addErrorInfo(error, { type: 'telemetry' });
|
|
@@ -38,18 +35,18 @@ export const trackBuildComplete = async function ({ deployId, buildId, status, s
|
|
|
38
35
|
}
|
|
39
36
|
};
|
|
40
37
|
// Send track HTTP request to telemetry.
|
|
41
|
-
const track = async function (
|
|
38
|
+
const track = async function (payload, { origin, writeKey, timeout }) {
|
|
42
39
|
const url = `${origin}/track`;
|
|
43
40
|
await got.post(url, {
|
|
44
41
|
json: payload,
|
|
45
42
|
timeout,
|
|
46
|
-
retry: 0,
|
|
43
|
+
retry: { limit: 0 },
|
|
47
44
|
headers: { Authorization: `Basic ${writeKey}` },
|
|
48
45
|
});
|
|
49
46
|
};
|
|
50
47
|
// Retrieve telemetry information
|
|
51
48
|
// siteInfo can be empty if the build fails during the get config step
|
|
52
|
-
const getPayload = function ({ deployId, buildId, status, stepsCount, pluginsOptions, durationNs, userNodeVersion, siteInfo = {}, framework, }) {
|
|
49
|
+
const getPayload = function ({ deployId, buildId, status, stepsCount, pluginsOptions, durationNs, userNodeVersion, siteInfo = { id: undefined }, framework, }) {
|
|
53
50
|
return {
|
|
54
51
|
userId: 'buildbot_user',
|
|
55
52
|
event: 'build:ci_build_process_completed',
|
|
@@ -85,7 +82,7 @@ const OS_TYPES = {
|
|
|
85
82
|
freebsd: 'FreeBSD',
|
|
86
83
|
openbsd: 'OpenBSD',
|
|
87
84
|
};
|
|
88
|
-
const getPlugin = function ({ packageName, origin, loadedFrom, nodeVersion, pinnedVersion, pluginPackageJson: { version } = {}, }) {
|
|
85
|
+
const getPlugin = function ({ packageName, origin, loadedFrom, nodeVersion, pinnedVersion, pluginPackageJson: { version } = { version: undefined }, }) {
|
|
89
86
|
const installType = getInstallType(origin, loadedFrom);
|
|
90
87
|
return { name: packageName, installType, nodeVersion, pinnedVersion, version };
|
|
91
88
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "29.5.
|
|
3
|
+
"version": "29.5.3",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/core/main.js",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@bugsnag/js": "^7.0.0",
|
|
67
67
|
"@netlify/cache-utils": "^5.1.0",
|
|
68
|
-
"@netlify/config": "^20.3.
|
|
69
|
-
"@netlify/edge-bundler": "8.
|
|
70
|
-
"@netlify/functions-utils": "^5.1.
|
|
68
|
+
"@netlify/config": "^20.3.2",
|
|
69
|
+
"@netlify/edge-bundler": "8.4.0",
|
|
70
|
+
"@netlify/functions-utils": "^5.1.6",
|
|
71
71
|
"@netlify/git-utils": "^5.1.0",
|
|
72
72
|
"@netlify/plugins-list": "^6.61.0",
|
|
73
73
|
"@netlify/run-utils": "^5.1.0",
|
|
74
|
-
"@netlify/zip-it-and-ship-it": "^8.
|
|
74
|
+
"@netlify/zip-it-and-ship-it": "^8.5.0",
|
|
75
75
|
"@sindresorhus/slugify": "^2.0.0",
|
|
76
76
|
"ansi-escapes": "^5.0.0",
|
|
77
77
|
"chalk": "^5.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"execa": "^6.0.0",
|
|
80
80
|
"figures": "^4.0.0",
|
|
81
81
|
"filter-obj": "^3.0.0",
|
|
82
|
-
"got": "^
|
|
82
|
+
"got": "^12.0.0",
|
|
83
83
|
"hot-shots": "9.3.0",
|
|
84
84
|
"indent-string": "^5.0.0",
|
|
85
85
|
"is-plain-obj": "^4.0.0",
|
|
@@ -148,5 +148,5 @@
|
|
|
148
148
|
"module": "commonjs"
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
|
-
"gitHead": "
|
|
151
|
+
"gitHead": "1863a80dd84cc4aff7cb74ca05b4c3506baf813a"
|
|
152
152
|
}
|