@omen.foundation/node-microservice-runtime 0.1.94 → 0.1.95
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/package.json +1 -1
- package/scripts/publish-service.mjs +40 -3
package/package.json
CHANGED
|
@@ -1289,8 +1289,8 @@ async function main() {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
1291
1291
|
|
|
1292
|
-
//
|
|
1293
|
-
//
|
|
1292
|
+
// Match C# CLI: GetDockerImageRegistryUri() uses realm PID from context (X-BEAM-SCOPE)
|
|
1293
|
+
// uniqueName uses gamePid (matches backend's rc.gameId), but registry URL uses realm PID
|
|
1294
1294
|
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1295
1295
|
console.error(`[beamo-node] [STEP: Calculate Registry Path]`);
|
|
1296
1296
|
console.error(`[beamo-node] CID: ${cid}`);
|
|
@@ -1298,7 +1298,7 @@ async function main() {
|
|
|
1298
1298
|
console.error(`[beamo-node] Resolved Game PID: ${resolvedGamePid}`);
|
|
1299
1299
|
console.error(`[beamo-node] Service ID: ${serviceId}`);
|
|
1300
1300
|
}
|
|
1301
|
-
const registryUrl = await getRegistryUrl(apiHost, token, cid,
|
|
1301
|
+
const registryUrl = await getRegistryUrl(apiHost, token, cid, pid);
|
|
1302
1302
|
const uniqueNameInput = `${cid}_${resolvedGamePid}_${serviceId}`;
|
|
1303
1303
|
const uniqueName = md5Hex(uniqueNameInput).substring(0, 30);
|
|
1304
1304
|
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
@@ -1357,6 +1357,43 @@ async function main() {
|
|
|
1357
1357
|
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1358
1358
|
console.error(`[beamo-node] ✓ Image verification passed`);
|
|
1359
1359
|
}
|
|
1360
|
+
|
|
1361
|
+
// CRITICAL: Before publishing, verify using the backend's expected gameId
|
|
1362
|
+
// The backend resolves rc.gameId from the realm hierarchy, which might differ from our resolvedGamePid
|
|
1363
|
+
// We need to check what the backend will actually use
|
|
1364
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1365
|
+
console.error(`[beamo-node] [STEP: Pre-Publish Backend Simulation]`);
|
|
1366
|
+
console.error(`[beamo-node] Simulating backend's imageNameMD5 calculation...`);
|
|
1367
|
+
console.error(`[beamo-node] Backend will use: rc.cid, rc.gameId (resolved from realm hierarchy), serviceName`);
|
|
1368
|
+
console.error(`[beamo-node] Our calculation used: cid=${cid}, gamePid=${resolvedGamePid}, serviceName=${serviceId}`);
|
|
1369
|
+
console.error(`[beamo-node] Our uniqueName: ${uniqueName}`);
|
|
1370
|
+
console.error(`[beamo-node] WARNING: If backend's rc.gameId differs from our resolvedGamePid, the check will fail!`);
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
// Try to resolve what the backend's rc.gameId will be by making the same API call the backend would make
|
|
1374
|
+
// The backend resolves gameId from the realm hierarchy when processing X-BEAM-SCOPE
|
|
1375
|
+
try {
|
|
1376
|
+
const backendGamePidCheck = await resolveGamePid(apiHost, token, cid, pid, null); // Force resolution
|
|
1377
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1378
|
+
console.error(`[beamo-node] Backend's expected gameId (resolved from realm hierarchy): ${backendGamePidCheck}`);
|
|
1379
|
+
if (backendGamePidCheck !== resolvedGamePid) {
|
|
1380
|
+
console.error(`[beamo-node] ⚠️ MISMATCH DETECTED!`);
|
|
1381
|
+
console.error(`[beamo-node] Our resolvedGamePid: ${resolvedGamePid}`);
|
|
1382
|
+
console.error(`[beamo-node] Backend's expected gameId: ${backendGamePidCheck}`);
|
|
1383
|
+
console.error(`[beamo-node] This will cause imageNameMD5 mismatch!`);
|
|
1384
|
+
const backendUniqueNameInput = `${cid}_${backendGamePidCheck}_${serviceId}`;
|
|
1385
|
+
const backendUniqueName = md5Hex(backendUniqueNameInput).substring(0, 30);
|
|
1386
|
+
console.error(`[beamo-node] Backend will check: ${registryUrl}${backendUniqueName}/manifests/${shortImageId}`);
|
|
1387
|
+
console.error(`[beamo-node] But we uploaded to: ${registryUrl}${uniqueName}/manifests/${shortImageId}`);
|
|
1388
|
+
} else {
|
|
1389
|
+
console.error(`[beamo-node] ✓ Game PID matches - backend should find the image`);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
} catch (error) {
|
|
1393
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1394
|
+
console.error(`[beamo-node] Could not verify backend gameId resolution: ${error.message}`);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1360
1397
|
|
|
1361
1398
|
// Step 7: Discover storage, components, and dependencies
|
|
1362
1399
|
progress.start('Discovering storage objects and components');
|