@adobe/helix-admin-support 3.3.0 → 3.3.2
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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/fetch-fstab.js +8 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.3.2](https://github.com/adobe/helix-admin-support/compare/v3.3.1...v3.3.2) (2025-05-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* revert fstab github-api fallback ([#401](https://github.com/adobe/helix-admin-support/issues/401)) ([3ec06f4](https://github.com/adobe/helix-admin-support/commit/3ec06f4454bfe2803ef52578129af0f844f0e4ea))
|
|
7
|
+
|
|
8
|
+
## [3.3.1](https://github.com/adobe/helix-admin-support/compare/v3.3.0...v3.3.1) (2025-05-28)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fix source type ([#400](https://github.com/adobe/helix-admin-support/issues/400)) ([e5d5fbd](https://github.com/adobe/helix-admin-support/commit/e5d5fbd9e1f02d45d21f3d02ea9289dc825e016f))
|
|
14
|
+
|
|
1
15
|
# [3.3.0](https://github.com/adobe/helix-admin-support/compare/v3.2.0...v3.3.0) (2025-05-28)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/fetch-fstab.js
CHANGED
|
@@ -20,10 +20,11 @@ import { fetch } from './utils.js';
|
|
|
20
20
|
* @param {Logger} log logger
|
|
21
21
|
* @param {Response} response content response from the storage
|
|
22
22
|
* @param {string} key storage key (logging information)
|
|
23
|
-
* @param {string} type type of storage (logging information
|
|
23
|
+
* @param {string} type type of storage (logging information)
|
|
24
|
+
* @param {string} source source information
|
|
24
25
|
* @returns {Promise<MountConfig>} the mount config or null
|
|
25
26
|
*/
|
|
26
|
-
async function handleResponse(log, response, key, type) {
|
|
27
|
+
async function handleResponse(log, response, key, type, source = type) {
|
|
27
28
|
const text = await response.text();
|
|
28
29
|
if (response.ok) {
|
|
29
30
|
const cfg = await new MountConfig().withSource(text).init();
|
|
@@ -32,11 +33,11 @@ async function handleResponse(log, response, key, type) {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
if (response.status === 404) {
|
|
35
|
-
log.info(`No fstab.yaml found in ${
|
|
36
|
+
log.info(`No fstab.yaml found in ${source} ${key}, ${text}`);
|
|
36
37
|
return null;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
log[logLevelForStatusCode(response.status)](`Invalid response (${response.status}) when fetching fstab from ${
|
|
40
|
+
log[logLevelForStatusCode(response.status)](`Invalid response (${response.status}) when fetching fstab from ${source} ${key}`);
|
|
40
41
|
const err = new Error(`Unable to fetch fstab: ${response.status} ${text}`);
|
|
41
42
|
err.status = propagateStatusCode(response.status);
|
|
42
43
|
throw err;
|
|
@@ -59,13 +60,13 @@ export async function fetchFstab(ctx, opts, optional) {
|
|
|
59
60
|
|
|
60
61
|
let key = `${owner}/${repo}/main/fstab.yaml`;
|
|
61
62
|
let response = await fetchS3(ctx, 'helix-code-bus', key);
|
|
62
|
-
|
|
63
|
+
const cfg = await handleResponse(log, response, key, 'code-bus');
|
|
63
64
|
if (cfg) {
|
|
64
65
|
return cfg;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
// try loading from github for non helix-3 repos
|
|
68
|
-
|
|
69
|
+
const headers = {};
|
|
69
70
|
key = `${owner}/${repo}/main/fstab.yaml`;
|
|
70
71
|
if (ctx.githubToken) {
|
|
71
72
|
headers.authorization = `token ${ctx.githubToken}`;
|
|
@@ -77,25 +78,7 @@ export async function fetchFstab(ctx, opts, optional) {
|
|
|
77
78
|
cache: 'no-store',
|
|
78
79
|
headers,
|
|
79
80
|
});
|
|
80
|
-
|
|
81
|
-
if (cfg) {
|
|
82
|
-
return cfg;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// try loading it from github using the content api
|
|
86
|
-
const { GH_BASE_URL = 'https://api.github.com' } = env;
|
|
87
|
-
headers = {
|
|
88
|
-
'X-GitHub-Api-Version': '2022-11-28',
|
|
89
|
-
accept: 'application/vnd.github.raw+json',
|
|
90
|
-
};
|
|
91
|
-
if (ctx.githubToken) {
|
|
92
|
-
headers.authorization = `Bearer ${ctx.githubToken}`;
|
|
93
|
-
}
|
|
94
|
-
response = await fetch(`${GH_BASE_URL}/repos/${owner}/${repo}/contents/fstab.yaml`, {
|
|
95
|
-
cache: 'no-store',
|
|
96
|
-
headers,
|
|
97
|
-
});
|
|
98
|
-
return handleResponse(log, response, key, ctx.githubToken ? 'github-api (authed)' : 'github-api');
|
|
81
|
+
return handleResponse(log, response, key, 'github', ctx.githubToken ? 'github (authed)' : 'github');
|
|
99
82
|
};
|
|
100
83
|
|
|
101
84
|
if (!('mountConfig' in attributes)) {
|