fix: bind overseas receiving to shared warehouse

This commit is contained in:
2026-08-24 21:46:19 +08:00
parent 3607bebbfd
commit 8cc4c6f6da
61 changed files with 774 additions and 118 deletions
+18 -1
View File
@@ -50,6 +50,19 @@ function stableTopologicalOrder(modules) {
return result
}
function dependencyClosure(module, visiting = new Set()) {
if (visiting.has(module)) throw new Error(`HTTP 验收模块依赖存在循环: ${[...visiting, module].join(',')}`)
const next = new Set(visiting).add(module)
const result = []
for (const dependency of MODULE_DEPENDENCIES.get(module) || []) {
for (const transitive of dependencyClosure(dependency, next)) {
if (!result.includes(transitive)) result.push(transitive)
}
if (!result.includes(dependency)) result.push(dependency)
}
return result
}
export function normalizeModuleOrder(modules) {
const normalized = [...modules]
const manualGroups = ['order-inbound-status-fixtures', 'manual-state-loading-pda', 'manual-state-ocean-trucking']
@@ -169,6 +182,10 @@ export function normalizeModuleOrder(modules) {
normalized.splice(overviewIndex, 1)
normalized.splice(normalized.indexOf('phase3-loading') + 1, 0, 'phase3-container-overview')
}
for (const module of [...normalized]) {
const missing = dependencyClosure(module).filter((dependency) => !normalized.includes(dependency))
if (missing.length > 0) normalized.splice(normalized.indexOf(module), 0, ...missing)
}
return stableTopologicalOrder(normalized)
}
@@ -897,7 +914,7 @@ export class AcceptanceRun {
const matrixMarker = this.marker
const variantMarker = `${matrixMarker}-P4-${label}`
const contextKeys = ['orderDestinationType', 'phase4ProducerMatrixMarker']
const createdKeys = ['phase3Loading', 'phase3LoadingCompletedProducer']
const createdKeys = ['phase3Loading', 'phase3LoadingCompletedProducer', 'orchestrationFixtures']
const contextSnapshot = new Map(contextKeys.map((key) => [key, {
present: Object.hasOwn(this.context, key), value: this.context[key],
}]))