gitnexus 1.6.6-rc.53 → 1.6.6-rc.54
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/core/group/sync.js +53 -59
- package/package.json +1 -1
package/dist/core/group/sync.js
CHANGED
|
@@ -64,22 +64,22 @@ export async function syncGroup(config, opts) {
|
|
|
64
64
|
let manifestCrossLinks = [];
|
|
65
65
|
let dbExecutors;
|
|
66
66
|
let registryEntries;
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
const openPoolIds = [];
|
|
68
|
+
try {
|
|
69
|
+
const eo = opts?.extractorOverride;
|
|
70
|
+
if (eo && eo.length === 0) {
|
|
71
|
+
autoContracts = await eo();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
registryEntries = await readRegistry();
|
|
75
|
+
const entries = registryEntries;
|
|
76
|
+
const resolve = opts?.resolveRepoHandle ?? defaultResolveHandle(entries);
|
|
77
|
+
const httpEx = new HttpRouteExtractor();
|
|
78
|
+
const grpcEx = new GrpcExtractor();
|
|
79
|
+
const thriftEx = new ThriftExtractor();
|
|
80
|
+
const topicEx = new TopicExtractor();
|
|
81
|
+
const includeEx = new IncludeExtractor();
|
|
82
|
+
dbExecutors = new Map();
|
|
83
83
|
for (const [groupPath, regName] of Object.entries(config.repos)) {
|
|
84
84
|
const handle = await resolve(regName, groupPath);
|
|
85
85
|
if (!handle) {
|
|
@@ -166,55 +166,49 @@ export async function syncGroup(config, opts) {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
// Workspace discovery and manifest extraction run inside this outer try
|
|
170
|
+
// block so dbExecutors closures resolve against live pools (issue #1802).
|
|
171
|
+
// The finally below closes pools after this completes (or throws).
|
|
172
|
+
let allLinks = [...config.links];
|
|
173
|
+
if (config.detect.workspace_deps) {
|
|
174
|
+
const repoPaths = new Map();
|
|
175
|
+
if (!registryEntries)
|
|
176
|
+
registryEntries = await readRegistry();
|
|
177
|
+
for (const [groupPath, regName] of Object.entries(config.repos)) {
|
|
178
|
+
const e = registryEntries.find((en) => en.name === regName);
|
|
179
|
+
if (e)
|
|
180
|
+
repoPaths.set(groupPath, e.path);
|
|
172
181
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const repoPaths = new Map();
|
|
181
|
-
if (!registryEntries)
|
|
182
|
-
registryEntries = await readRegistry();
|
|
183
|
-
for (const [groupPath, regName] of Object.entries(config.repos)) {
|
|
184
|
-
const e = registryEntries.find((en) => en.name === regName);
|
|
185
|
-
if (e)
|
|
186
|
-
repoPaths.set(groupPath, e.path);
|
|
187
|
-
}
|
|
188
|
-
const wsResult = await discoverWorkspaceLinks(config.repos, repoPaths, dbExecutors);
|
|
189
|
-
if (wsResult.links.length > 0) {
|
|
190
|
-
allLinks = [...allLinks, ...wsResult.links];
|
|
191
|
-
if (opts?.verbose) {
|
|
192
|
-
for (const s of wsResult.stats) {
|
|
193
|
-
logger.info(` workspace-deps: discovered ${s.linkCount} cross-${s.ecosystem.toLowerCase()} links from ${s.projectCount} ${s.ecosystem} projects`);
|
|
182
|
+
const wsResult = await discoverWorkspaceLinks(config.repos, repoPaths, dbExecutors);
|
|
183
|
+
if (wsResult.links.length > 0) {
|
|
184
|
+
allLinks = [...allLinks, ...wsResult.links];
|
|
185
|
+
if (opts?.verbose) {
|
|
186
|
+
for (const s of wsResult.stats) {
|
|
187
|
+
logger.info(` workspace-deps: discovered ${s.linkCount} cross-${s.ecosystem.toLowerCase()} links from ${s.projectCount} ${s.ecosystem} projects`);
|
|
188
|
+
}
|
|
194
189
|
}
|
|
195
190
|
}
|
|
196
191
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
192
|
+
if (allLinks.length > 0) {
|
|
193
|
+
const knownRepos = new Set(Object.keys(config.repos));
|
|
194
|
+
for (const link of allLinks) {
|
|
195
|
+
const dangling = [link.from, link.to].filter((r) => !knownRepos.has(r));
|
|
196
|
+
if (dangling.length > 0) {
|
|
197
|
+
logger.warn(`[group/sync] manifest link ${link.type}:${link.contract} references repos not in config.repos: ${dangling.join(', ')} — cross-links will use synthetic UIDs`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const manifestEx = new ManifestExtractor();
|
|
201
|
+
const manifestResult = await manifestEx.extractFromManifest(allLinks, dbExecutors);
|
|
202
|
+
autoContracts.push(...manifestResult.contracts);
|
|
203
|
+
manifestCrossLinks = manifestResult.crossLinks;
|
|
204
|
+
if (opts?.verbose) {
|
|
205
|
+
logger.info(` manifest: ${manifestCrossLinks.length} cross-links from ${allLinks.length} links (${config.links.length} declared + ${allLinks.length - config.links.length} discovered)`);
|
|
210
206
|
}
|
|
211
207
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (opts?.verbose) {
|
|
217
|
-
logger.info(` manifest: ${manifestCrossLinks.length} cross-links from ${allLinks.length} links (${config.links.length} declared + ${allLinks.length - config.links.length} discovered)`);
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
for (const id of [...new Set(openPoolIds)]) {
|
|
211
|
+
await closeLbug(id).catch(() => { });
|
|
218
212
|
}
|
|
219
213
|
}
|
|
220
214
|
const providerIndex = buildProviderIndex(autoContracts, config.matching);
|
package/package.json
CHANGED