@fnndsc/salsa 4.4.4 → 4.5.1
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/dist/plugins/index.d.ts +7 -0
- package/dist/plugins/index.js +7 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/plugin_add.d.ts +173 -0
- package/dist/plugins/plugin_add.js +325 -0
- package/dist/plugins/plugin_add.js.map +1 -0
- package/dist/plugins/plugin_docker.d.ts +90 -0
- package/dist/plugins/plugin_docker.js +158 -0
- package/dist/plugins/plugin_docker.js.map +1 -0
- package/dist/plugins/plugin_index.d.ts +157 -0
- package/dist/plugins/plugin_index.js +338 -0
- package/dist/plugins/plugin_index.js.map +1 -0
- package/dist/plugins/plugin_sync.d.ts +276 -0
- package/dist/plugins/plugin_sync.js +453 -0
- package/dist/plugins/plugin_sync.js.map +1 -0
- package/dist/plugins/plugin_validate.d.ts +224 -0
- package/dist/plugins/plugin_validate.js +418 -0
- package/dist/plugins/plugin_validate.js.map +1 -0
- package/dist/plugins/pool.d.ts +46 -0
- package/dist/plugins/pool.js +63 -0
- package/dist/plugins/pool.js.map +1 -0
- package/dist/plugins/tar_read.d.ts +73 -0
- package/dist/plugins/tar_read.js +190 -0
- package/dist/plugins/tar_read.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Filling a CUBE from a plugin index: `plugin sync`.
|
|
4
|
+
*
|
|
5
|
+
* A sync is a plan, then the plan's adds. The plan compares every descriptor
|
|
6
|
+
* in the index with what the connected CUBE holds and puts each plugin in
|
|
7
|
+
* one group:
|
|
8
|
+
*
|
|
9
|
+
* | group | what it means | action |
|
|
10
|
+
* |---|---|---|
|
|
11
|
+
* | add | not in the CUBE | add |
|
|
12
|
+
* | newer | the index has a newer version | add beside the older one |
|
|
13
|
+
* | skip | same name and version, same descriptor | nothing |
|
|
14
|
+
* | cubeNewer | the CUBE has a newer version | report |
|
|
15
|
+
* | drift | same name and version, different descriptor | report, never touched |
|
|
16
|
+
* | imageTaken | the image is registered under another version | report: CUBE would refuse it |
|
|
17
|
+
* | cubeOnly | in the CUBE, not in the index | report |
|
|
18
|
+
* | invalid | fails rules 1–4 of `plugin validate` | report, never uploaded |
|
|
19
|
+
*
|
|
20
|
+
* A sync never deletes and never changes a plugin already there: deleting
|
|
21
|
+
* cascades to its runs and to its nodes in every pipeline, and CUBE's admin
|
|
22
|
+
* `PUT` changes only compute resources, so a descriptor cannot be corrected
|
|
23
|
+
* in place anyway. Drift ignores what only reflects CUBE's defaults (a limit
|
|
24
|
+
* the index leaves out because it equals the default, `1000m` against a
|
|
25
|
+
* stored `1000`, a field CUBE fills in when it is not given).
|
|
26
|
+
*
|
|
27
|
+
* Applying uploads the plan's adds four at a time, each failure contained to
|
|
28
|
+
* its plugin; what landed stays, so a rerun continues where a stopped one
|
|
29
|
+
* left off. Every CUBE read and the upload go through {@link SyncSeams}, so
|
|
30
|
+
* the plan and the apply are testable without a CUBE.
|
|
31
|
+
*
|
|
32
|
+
* Key components:
|
|
33
|
+
* - SyncGroup / SyncPlanEntry / SyncPlan: the plan.
|
|
34
|
+
* - SyncResult / SyncReceipt: what applying it did.
|
|
35
|
+
* - SyncSeams / syncSeams_cube: the CUBE reads and the upload.
|
|
36
|
+
* - syncPlan_build: compare an index with the CUBE.
|
|
37
|
+
* - syncPlanAdds_list: the entries a plan would upload.
|
|
38
|
+
* - syncPlan_apply: upload them, four at a time.
|
|
39
|
+
* - descriptorDrift_find: how two descriptors of one version differ, defaults aside.
|
|
40
|
+
* - version_compare: dotted-number ordering.
|
|
41
|
+
*
|
|
42
|
+
* Typical usage:
|
|
43
|
+
* ```ts
|
|
44
|
+
* const plan: SyncPlan = await syncPlan_build(index, ['host'], syncSeams_cube);
|
|
45
|
+
* const receipt: SyncReceipt = await syncPlan_apply(plan, syncSeams_cube, (r: SyncResult): void => console.log(r));
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* Dependencies: cumin's CUBE reads (plugin pages, parameters) and the
|
|
49
|
+
* administrative upload; the index and its local checks.
|
|
50
|
+
*
|
|
51
|
+
* @module
|
|
52
|
+
*/
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.syncSeams_cube = exports.SYNC_ADD_GROUPS = exports.SYNC_GROUPS = void 0;
|
|
55
|
+
exports.syncPlan_build = syncPlan_build;
|
|
56
|
+
exports.syncPlanAdds_list = syncPlanAdds_list;
|
|
57
|
+
exports.syncPlan_apply = syncPlan_apply;
|
|
58
|
+
exports.descriptorDrift_find = descriptorDrift_find;
|
|
59
|
+
exports.version_compare = version_compare;
|
|
60
|
+
const cumin_1 = require("@fnndsc/cumin");
|
|
61
|
+
const plugin_add_js_1 = require("./plugin_add.js");
|
|
62
|
+
const plugin_validate_js_1 = require("./plugin_validate.js");
|
|
63
|
+
const pool_js_1 = require("./pool.js");
|
|
64
|
+
/** CUBE's stand-in for "no limit" (Python's maxint, as `Plugin.defaults['max_limit']`). */
|
|
65
|
+
const MAX_LIMIT = 2_147_483_647;
|
|
66
|
+
/** What CUBE stores for a limit a descriptor leaves out (`plugins/models.py`). */
|
|
67
|
+
const LIMIT_DEFAULTS = {
|
|
68
|
+
min_number_of_workers: 1,
|
|
69
|
+
max_number_of_workers: MAX_LIMIT,
|
|
70
|
+
min_cpu_limit: 1000,
|
|
71
|
+
max_cpu_limit: MAX_LIMIT,
|
|
72
|
+
min_memory_limit: 200,
|
|
73
|
+
max_memory_limit: MAX_LIMIT,
|
|
74
|
+
min_gpu_limit: 0,
|
|
75
|
+
max_gpu_limit: 0,
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Plugin fields compared as text; a field the index leaves out is not
|
|
79
|
+
* compared. The plugin-meta fields (title, authors, license, …) belong to
|
|
80
|
+
* the name, not the version, and a newer upload rewrites them, so they are
|
|
81
|
+
* not a version's drift.
|
|
82
|
+
*/
|
|
83
|
+
const TEXT_FIELDS = ['dock_image', 'type', 'execshell', 'selfpath', 'selfexec', 'description'];
|
|
84
|
+
/** Parameter fields compared; one the index leaves out is CUBE's to fill. */
|
|
85
|
+
const PARAMETER_FIELDS = ['type', 'optional', 'flag', 'short_flag', 'action', 'help', 'ui_exposed', 'default'];
|
|
86
|
+
/** The read API's parameter types, in the upload's spelling (`plugins/enums.py`). */
|
|
87
|
+
const READ_TYPES = { string: 'str', integer: 'int', boolean: 'bool', float: 'float', path: 'path', unextpath: 'unextpath' };
|
|
88
|
+
/** The groups a plan's entries fall in, in the order a plan lists them. */
|
|
89
|
+
exports.SYNC_GROUPS = ['add', 'newer', 'skip', 'cubeNewer', 'drift', 'imageTaken', 'cubeOnly', 'invalid'];
|
|
90
|
+
/** The groups that upload. */
|
|
91
|
+
exports.SYNC_ADD_GROUPS = ['add', 'newer'];
|
|
92
|
+
/** The connected CUBE's reads and upload. */
|
|
93
|
+
exports.syncSeams_cube = {
|
|
94
|
+
async cubePlugins_read() {
|
|
95
|
+
const client = await client_require();
|
|
96
|
+
const rows = await (0, cumin_1.listPages_drain)((offset, limit) => (0, cumin_1.pluginsPage_get)(client, { offset, limit }));
|
|
97
|
+
return rows.flatMap((row) => typeof row.name === 'string' && typeof row.version === 'string'
|
|
98
|
+
? [{ name: row.name, version: row.version, dock_image: typeof row['dock_image'] === 'string' ? row['dock_image'] : '' }]
|
|
99
|
+
: []);
|
|
100
|
+
},
|
|
101
|
+
async cubeDescriptor_read(name, version) {
|
|
102
|
+
const client = await client_require();
|
|
103
|
+
const found = await (0, cumin_1.plugin_find)(client, name, version);
|
|
104
|
+
if (found === null)
|
|
105
|
+
return null;
|
|
106
|
+
return { ...found.data, parameters: await (0, cumin_1.pluginParameters_drain)(found.handle) };
|
|
107
|
+
},
|
|
108
|
+
async descriptor_upload(descriptor, computes) {
|
|
109
|
+
const added = await (0, plugin_add_js_1.plugin_addDescriptor)(descriptor, computes);
|
|
110
|
+
if (added.ok)
|
|
111
|
+
return { ok: true };
|
|
112
|
+
return { ok: false, reason: cumin_1.errorStack.stack_pop()?.message ?? 'CUBE refused the plugin' };
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Builds the plan: compares an index with the connected CUBE.
|
|
117
|
+
*
|
|
118
|
+
* @param index - The index.
|
|
119
|
+
* @param computes - The compute resources adds would be registered on.
|
|
120
|
+
* @param seams - The CUBE reads.
|
|
121
|
+
* @returns The plan.
|
|
122
|
+
* @throws {Error} When the CUBE cannot be read.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const plan: SyncPlan = await syncPlan_build(index, ['host'], syncSeams_cube);
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
async function syncPlan_build(index, computes, seams) {
|
|
130
|
+
const local = (0, plugin_validate_js_1.descriptors_checkLocal)(index);
|
|
131
|
+
const cube = await seams.cubePlugins_read();
|
|
132
|
+
const byName = new Map();
|
|
133
|
+
for (const row of cube)
|
|
134
|
+
byName.set(row.name, [...(byName.get(row.name) ?? []), row]);
|
|
135
|
+
const entries = [];
|
|
136
|
+
const sameVersion = [];
|
|
137
|
+
const indexed = new Set();
|
|
138
|
+
for (const checked of local.descriptors) {
|
|
139
|
+
const name = typeof checked.data?.['name'] === 'string' ? checked.data['name'] : checked.file.replace(/\.json$/, '');
|
|
140
|
+
if (checked.findings.length > 0 || checked.data === null) {
|
|
141
|
+
entries.push({ group: 'invalid', name, file: checked.file, detail: findings_summarize(checked.findings) });
|
|
142
|
+
if (checked.data !== null)
|
|
143
|
+
indexed.add(name);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
indexed.add(name);
|
|
147
|
+
const version = String(checked.data['version']);
|
|
148
|
+
const image = String(checked.data['dock_image']);
|
|
149
|
+
const rows = byName.get(name) ?? [];
|
|
150
|
+
const cubeVersions = rows.map((row) => row.version).sort(version_compare);
|
|
151
|
+
const base = { name, version, file: checked.file };
|
|
152
|
+
if (rows.length === 0) {
|
|
153
|
+
entries.push({ group: 'add', ...base, descriptor: checked.text });
|
|
154
|
+
}
|
|
155
|
+
else if (cubeVersions.includes(version)) {
|
|
156
|
+
sameVersion.push({ checked, name, version, cubeVersions });
|
|
157
|
+
}
|
|
158
|
+
else if (rows.some((row) => row.dock_image === image)) {
|
|
159
|
+
const holder = rows.find((row) => row.dock_image === image);
|
|
160
|
+
entries.push({ group: 'imageTaken', ...base, cubeVersions, detail: `${image} is registered as ${name} ${holder?.version ?? '?'}` });
|
|
161
|
+
}
|
|
162
|
+
else if (cubeVersions.every((held) => version_compare(version, held) > 0)) {
|
|
163
|
+
entries.push({ group: 'newer', ...base, cubeVersions, descriptor: checked.text });
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
entries.push({ group: 'cubeNewer', ...base, cubeVersions, detail: `the CUBE holds ${cubeVersions.at(-1) ?? '?'}` });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const compared = await (0, pool_js_1.items_mapPooled)(sameVersion, pool_js_1.POOL_WIDTH, async (item) => {
|
|
170
|
+
const held = await seams.cubeDescriptor_read(item.name, item.version);
|
|
171
|
+
const differences = held === null ? [] : descriptorDrift_find(item.checked.data ?? {}, held);
|
|
172
|
+
const base = { group: 'skip', name: item.name, version: item.version, file: item.checked.file, cubeVersions: item.cubeVersions };
|
|
173
|
+
return differences.length === 0 ? base : { ...base, group: 'drift', detail: `differs in ${differences.join(', ')}` };
|
|
174
|
+
});
|
|
175
|
+
entries.push(...compared);
|
|
176
|
+
for (const [name, rows] of byName) {
|
|
177
|
+
if (indexed.has(name))
|
|
178
|
+
continue;
|
|
179
|
+
const cubeVersions = rows.map((row) => row.version).sort(version_compare);
|
|
180
|
+
entries.push({ group: 'cubeOnly', name, cubeVersions });
|
|
181
|
+
}
|
|
182
|
+
entries.sort((a, b) => exports.SYNC_GROUPS.indexOf(a.group) - exports.SYNC_GROUPS.indexOf(b.group) || a.name.localeCompare(b.name));
|
|
183
|
+
return { label: index.label, source: index.source, commit: index.commit, indexed: index.descriptors.length, computes, entries };
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Lists the entries a plan would upload.
|
|
187
|
+
*
|
|
188
|
+
* @param plan - The plan.
|
|
189
|
+
* @returns Its add and newer entries, in plan order.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```ts
|
|
193
|
+
* syncPlanAdds_list(plan).length; // how many plugins a yes registers
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
function syncPlanAdds_list(plan) {
|
|
197
|
+
return plan.entries.filter((entry) => exports.SYNC_ADD_GROUPS.includes(entry.group));
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Applies a plan: uploads its adds, four at a time.
|
|
201
|
+
*
|
|
202
|
+
* @param plan - The plan.
|
|
203
|
+
* @param seams - The upload.
|
|
204
|
+
* @param note - Called once per upload as it lands, in the order they land.
|
|
205
|
+
* @param signal - A stop: the uploads in flight finish, no more start, and
|
|
206
|
+
* what landed stays (a rerun continues from it).
|
|
207
|
+
* @returns What it did, `stopped` when the signal ended it early.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const receipt: SyncReceipt = await syncPlan_apply(plan, syncSeams_cube, (r: SyncResult): void => console.log(r.name, r.ok));
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
async function syncPlan_apply(plan, seams, note, signal) {
|
|
215
|
+
const adds = syncPlanAdds_list(plan);
|
|
216
|
+
const results = await (0, pool_js_1.items_mapPooled)(adds, pool_js_1.POOL_WIDTH, async (entry) => {
|
|
217
|
+
const version = entry.version ?? '';
|
|
218
|
+
let result;
|
|
219
|
+
try {
|
|
220
|
+
const answer = await seams.descriptor_upload(entry.descriptor ?? '', plan.computes);
|
|
221
|
+
result = answer.ok ? { name: entry.name, version, ok: true } : { name: entry.name, version, ok: false, reason: answer.reason };
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
result = { name: entry.name, version, ok: false, reason: error instanceof Error ? error.message : String(error) };
|
|
225
|
+
}
|
|
226
|
+
note(result);
|
|
227
|
+
return result;
|
|
228
|
+
}, signal);
|
|
229
|
+
const added = results.filter((result) => result.ok).length;
|
|
230
|
+
return {
|
|
231
|
+
plan,
|
|
232
|
+
results,
|
|
233
|
+
added,
|
|
234
|
+
skipped: plan.entries.filter((entry) => entry.group === 'skip').length,
|
|
235
|
+
reported: plan.entries.filter((entry) => !exports.SYNC_ADD_GROUPS.includes(entry.group) && entry.group !== 'skip').length,
|
|
236
|
+
failed: results.length - added,
|
|
237
|
+
stopped: results.length < adds.length,
|
|
238
|
+
unsent: adds.length - results.length,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Finds how two descriptors of one version differ, CUBE's defaults aside.
|
|
243
|
+
*
|
|
244
|
+
* @param indexed - The index's descriptor.
|
|
245
|
+
* @param held - The CUBE's plugin fields with its `parameters`.
|
|
246
|
+
* @returns The differing fields (`dock_image`, `parameters.--dir.help`), empty when none.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```ts
|
|
250
|
+
* descriptorDrift_find({ min_cpu_limit: '1000m' }, { min_cpu_limit: 1000 }); // []
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
function descriptorDrift_find(indexed, held) {
|
|
254
|
+
const differences = [];
|
|
255
|
+
for (const field of TEXT_FIELDS) {
|
|
256
|
+
if (!(field in indexed))
|
|
257
|
+
continue;
|
|
258
|
+
if (text_normalize(indexed[field]) !== text_normalize(held[field]))
|
|
259
|
+
differences.push(field);
|
|
260
|
+
}
|
|
261
|
+
for (const [field, fallback] of Object.entries(LIMIT_DEFAULTS)) {
|
|
262
|
+
const mine = limit_normalize(indexed[field], limitFallback_get(indexed, field, fallback));
|
|
263
|
+
const theirs = limit_normalize(held[field], fallback);
|
|
264
|
+
if (mine !== theirs)
|
|
265
|
+
differences.push(field);
|
|
266
|
+
}
|
|
267
|
+
differences.push(...parametersDrift_find(indexed['parameters'], held['parameters']));
|
|
268
|
+
return differences;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Orders two dotted-number versions.
|
|
272
|
+
*
|
|
273
|
+
* @param a - One version.
|
|
274
|
+
* @param b - The other.
|
|
275
|
+
* @returns Negative when `a` is older, positive when newer, zero when equal.
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```ts
|
|
279
|
+
* ['1.10.0', '1.2.0'].sort(version_compare); // ['1.2.0', '1.10.0']
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
function version_compare(a, b) {
|
|
283
|
+
const left = a.split('.').map(Number);
|
|
284
|
+
const right = b.split('.').map(Number);
|
|
285
|
+
for (let at = 0; at < Math.max(left.length, right.length); at++) {
|
|
286
|
+
const difference = (left[at] ?? 0) - (right[at] ?? 0);
|
|
287
|
+
if (Number.isNaN(difference))
|
|
288
|
+
return a.localeCompare(b);
|
|
289
|
+
if (difference !== 0)
|
|
290
|
+
return difference;
|
|
291
|
+
}
|
|
292
|
+
return 0;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* The connected CUBE's client, or an error.
|
|
296
|
+
*
|
|
297
|
+
* @returns The client.
|
|
298
|
+
* @throws {Error} When not connected.
|
|
299
|
+
*/
|
|
300
|
+
async function client_require() {
|
|
301
|
+
const client = await cumin_1.chrisConnection.client_get();
|
|
302
|
+
if (client === null)
|
|
303
|
+
throw new Error('Not connected to ChRIS. Please log in.');
|
|
304
|
+
return client;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Summarizes a descriptor's findings in a line.
|
|
308
|
+
*
|
|
309
|
+
* @param findings - Its findings.
|
|
310
|
+
* @returns The first finding with its rule, and how many more.
|
|
311
|
+
*/
|
|
312
|
+
function findings_summarize(findings) {
|
|
313
|
+
const first = findings[0];
|
|
314
|
+
if (first === undefined)
|
|
315
|
+
return 'not a descriptor';
|
|
316
|
+
const more = findings.length > 1 ? ` (+${findings.length - 1} more)` : '';
|
|
317
|
+
return `rule ${first.rule}: ${first.message}${more}`;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* What CUBE stores for a limit a descriptor leaves out.
|
|
321
|
+
*
|
|
322
|
+
* @param descriptor - The index's descriptor.
|
|
323
|
+
* @param field - The limit.
|
|
324
|
+
* @param fallback - The model's default.
|
|
325
|
+
* @returns The default, with CUBE's one dependent case: a GPU minimum above
|
|
326
|
+
* zero and no maximum stores the maximum as unlimited.
|
|
327
|
+
*/
|
|
328
|
+
function limitFallback_get(descriptor, field, fallback) {
|
|
329
|
+
if (field === 'max_gpu_limit' && !('max_gpu_limit' in descriptor)) {
|
|
330
|
+
const least = limit_normalize(descriptor['min_gpu_limit'], 0);
|
|
331
|
+
if (least !== null && least > 0)
|
|
332
|
+
return MAX_LIMIT;
|
|
333
|
+
}
|
|
334
|
+
return fallback;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Reads a limit as a number, in CUBE's stored units.
|
|
338
|
+
*
|
|
339
|
+
* @param value - `1000m`, `512Mi`, `2Gi`, a number, an empty string, or absent.
|
|
340
|
+
* @param fallback - What an absent or empty value stands for.
|
|
341
|
+
* @returns Millicores or mebibytes or a count; null when unreadable.
|
|
342
|
+
*/
|
|
343
|
+
function limit_normalize(value, fallback) {
|
|
344
|
+
if (value === undefined || value === null || value === '')
|
|
345
|
+
return fallback;
|
|
346
|
+
if (typeof value === 'number')
|
|
347
|
+
return value;
|
|
348
|
+
const match = /^(\d+)(m|Mi|Gi)?$/.exec(String(value));
|
|
349
|
+
if (match === null || match[1] === undefined)
|
|
350
|
+
return null;
|
|
351
|
+
const amount = Number(match[1]);
|
|
352
|
+
return match[2] === 'Gi' ? amount * 1024 : amount;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Finds how two parameter lists differ, fields the index leaves out aside.
|
|
356
|
+
*
|
|
357
|
+
* @param indexed - The index's parameters.
|
|
358
|
+
* @param held - The CUBE's parameters.
|
|
359
|
+
* @returns The differing fields, as `parameters.<flag>.<field>`.
|
|
360
|
+
*/
|
|
361
|
+
function parametersDrift_find(indexed, held) {
|
|
362
|
+
const mine = parameters_index(indexed);
|
|
363
|
+
const theirs = parameters_index(held);
|
|
364
|
+
const differences = [];
|
|
365
|
+
for (const name of new Set([...mine.keys(), ...theirs.keys()])) {
|
|
366
|
+
const left = mine.get(name);
|
|
367
|
+
const right = theirs.get(name);
|
|
368
|
+
if (left === undefined || right === undefined) {
|
|
369
|
+
differences.push(`parameters.${name}`);
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
for (const field of PARAMETER_FIELDS) {
|
|
373
|
+
if (!(field in left))
|
|
374
|
+
continue;
|
|
375
|
+
if (!parameterValues_equal(field, left[field], right[field], String(left['type'] ?? '')))
|
|
376
|
+
differences.push(`parameters.${name}.${field}`);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return differences;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Indexes a parameter list by name.
|
|
383
|
+
*
|
|
384
|
+
* @param parameters - The list.
|
|
385
|
+
* @returns The parameters by name; empty when the list is not one.
|
|
386
|
+
*/
|
|
387
|
+
function parameters_index(parameters) {
|
|
388
|
+
const byName = new Map();
|
|
389
|
+
if (!Array.isArray(parameters))
|
|
390
|
+
return byName;
|
|
391
|
+
for (const parameter of parameters) {
|
|
392
|
+
if (parameter === null || typeof parameter !== 'object')
|
|
393
|
+
continue;
|
|
394
|
+
const record = parameter;
|
|
395
|
+
if (typeof record['name'] === 'string')
|
|
396
|
+
byName.set(record['name'], record);
|
|
397
|
+
}
|
|
398
|
+
return byName;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Compares one parameter field, the read API's spellings aside.
|
|
402
|
+
*
|
|
403
|
+
* @param field - The field.
|
|
404
|
+
* @param mine - The index's value.
|
|
405
|
+
* @param theirs - The CUBE's value.
|
|
406
|
+
* @param type - The parameter's type, in the upload's spelling (`bool`, `int`, …).
|
|
407
|
+
* @returns True when they mean the same.
|
|
408
|
+
*/
|
|
409
|
+
function parameterValues_equal(field, mine, theirs, type) {
|
|
410
|
+
if (field === 'type')
|
|
411
|
+
return String(mine) === (READ_TYPES[String(theirs)] ?? String(theirs));
|
|
412
|
+
if (field === 'default') {
|
|
413
|
+
if ((mine === null || mine === undefined) && (theirs === null || theirs === undefined || theirs === ''))
|
|
414
|
+
return true;
|
|
415
|
+
return defaultValue_normalize(mine, type) === defaultValue_normalize(theirs, type);
|
|
416
|
+
}
|
|
417
|
+
if (field === 'help' || field === 'short_flag')
|
|
418
|
+
return text_normalize(mine) === text_normalize(theirs);
|
|
419
|
+
return mine === theirs;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* A text field as CUBE stores it: its serializers trim the whitespace around
|
|
423
|
+
* every text field on upload (DRF's `trim_whitespace`), so a descriptor's
|
|
424
|
+
* indented help reads back without its leading newline.
|
|
425
|
+
*
|
|
426
|
+
* @param value - The field's value, absent as empty.
|
|
427
|
+
* @returns The text, trimmed.
|
|
428
|
+
*/
|
|
429
|
+
function text_normalize(value) {
|
|
430
|
+
return String(value ?? '').trim();
|
|
431
|
+
}
|
|
432
|
+
/** The spellings CUBE's boolean default field reads as true (DRF `BooleanField.TRUE_VALUES`). */
|
|
433
|
+
const BOOLEAN_TRUE = new Set(['true', 't', 'yes', 'y', 'on', '1']);
|
|
434
|
+
/**
|
|
435
|
+
* A parameter default as CUBE stores it: the default serializer for the
|
|
436
|
+
* parameter's type coerces the upload's value (`'False'` reads back as
|
|
437
|
+
* `false`, `'5'` as `5`) and trims text.
|
|
438
|
+
*
|
|
439
|
+
* @param value - The default.
|
|
440
|
+
* @param type - The parameter's type, in the upload's spelling.
|
|
441
|
+
* @returns A comparable spelling of the default.
|
|
442
|
+
*/
|
|
443
|
+
function defaultValue_normalize(value, type) {
|
|
444
|
+
const text = text_normalize(value);
|
|
445
|
+
if (type === 'bool' || type === 'boolean')
|
|
446
|
+
return String(BOOLEAN_TRUE.has(text.toLowerCase()));
|
|
447
|
+
if (type === 'int' || type === 'integer' || type === 'float') {
|
|
448
|
+
const number = Number(text);
|
|
449
|
+
return Number.isFinite(number) ? String(number) : text;
|
|
450
|
+
}
|
|
451
|
+
return text;
|
|
452
|
+
}
|
|
453
|
+
//# sourceMappingURL=plugin_sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin_sync.js","sourceRoot":"","sources":["../../src/plugins/plugin_sync.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;;;AAsPH,wCAsDC;AAaD,8CAEC;AAiBD,wCAyBC;AAcD,oDAaC;AAcD,0CASC;AArZD,yCAYuB;AAEvB,mDAAuD;AAEvD,6DAA6H;AAC7H,uCAAwD;AAExD,2FAA2F;AAC3F,MAAM,SAAS,GAAW,aAAa,CAAC;AAExC,kFAAkF;AAClF,MAAM,cAAc,GAAqC;IACvD,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,SAAS;IAChC,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,SAAS;IACxB,gBAAgB,EAAE,GAAG;IACrB,gBAAgB,EAAE,SAAS;IAC3B,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,GAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;AAElH,6EAA6E;AAC7E,MAAM,gBAAgB,GAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;AAElI,qFAAqF;AACrF,MAAM,UAAU,GAAqC,EAAE,MAAM,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