Continue control-plane smoke after checkout skips
Some checks are pending
check / contracts (push) Waiting to run
Some checks are pending
check / contracts (push) Waiting to run
This commit is contained in:
parent
af4f7796e7
commit
b918bad769
@ -322,53 +322,52 @@ async function main() {
|
||||
}
|
||||
}
|
||||
if (!checkoutTxHash) {
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
return;
|
||||
}
|
||||
|
||||
const checkoutConfirmRes = await requestJSON(
|
||||
"POST",
|
||||
"/marketplace/checkout/confirm",
|
||||
{
|
||||
quote_id: checkoutQuote.quote_id,
|
||||
wallet,
|
||||
offer_id: OFFER_ID,
|
||||
org_root_id: ORG_ROOT_ID,
|
||||
principal_id: PRINCIPAL_ID,
|
||||
principal_role: PRINCIPAL_ROLE,
|
||||
workspace_id: WORKSPACE_ID,
|
||||
tx_hash: checkoutTxHash,
|
||||
chain_id: CHAIN_ID,
|
||||
},
|
||||
sessionToken
|
||||
);
|
||||
if (!checkoutConfirmRes.ok) {
|
||||
if (isTxPendingResponse(checkoutConfirmRes)) {
|
||||
result.stages.marketplace_checkout = summarizeSkip(
|
||||
"tx_pending",
|
||||
checkoutConfirmRes.status,
|
||||
checkoutConfirmRes.data?.error || JSON.stringify(checkoutConfirmRes.data || {})
|
||||
);
|
||||
} else {
|
||||
throw new Error(
|
||||
`POST /marketplace/checkout/confirm failed (${checkoutConfirmRes.status}): ${JSON.stringify(checkoutConfirmRes.data)}`
|
||||
);
|
||||
}
|
||||
// Keep running; governance install may still be valid for pre-existing entitlements.
|
||||
} else {
|
||||
const entitlements = await expectOK(
|
||||
"GET",
|
||||
`/marketplace/entitlements?wallet=${encodeURIComponent(wallet)}`,
|
||||
undefined,
|
||||
const checkoutConfirmRes = await requestJSON(
|
||||
"POST",
|
||||
"/marketplace/checkout/confirm",
|
||||
{
|
||||
quote_id: checkoutQuote.quote_id,
|
||||
wallet,
|
||||
offer_id: OFFER_ID,
|
||||
org_root_id: ORG_ROOT_ID,
|
||||
principal_id: PRINCIPAL_ID,
|
||||
principal_role: PRINCIPAL_ROLE,
|
||||
workspace_id: WORKSPACE_ID,
|
||||
tx_hash: checkoutTxHash,
|
||||
chain_id: CHAIN_ID,
|
||||
},
|
||||
sessionToken
|
||||
);
|
||||
result.stages.marketplace_checkout = {
|
||||
status: checkoutConfirmRes.data.status,
|
||||
entitlement_id: checkoutConfirmRes.data.entitlement_id,
|
||||
tx_hash: checkoutTxHash,
|
||||
entitlement_count: Array.isArray(entitlements.entitlements)
|
||||
? entitlements.entitlements.length
|
||||
: 0,
|
||||
};
|
||||
if (!checkoutConfirmRes.ok) {
|
||||
if (isTxPendingResponse(checkoutConfirmRes)) {
|
||||
result.stages.marketplace_checkout = summarizeSkip(
|
||||
"tx_pending",
|
||||
checkoutConfirmRes.status,
|
||||
checkoutConfirmRes.data?.error || JSON.stringify(checkoutConfirmRes.data || {})
|
||||
);
|
||||
} else {
|
||||
throw new Error(
|
||||
`POST /marketplace/checkout/confirm failed (${checkoutConfirmRes.status}): ${JSON.stringify(checkoutConfirmRes.data)}`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
const entitlements = await expectOK(
|
||||
"GET",
|
||||
`/marketplace/entitlements?wallet=${encodeURIComponent(wallet)}`,
|
||||
undefined,
|
||||
sessionToken
|
||||
);
|
||||
result.stages.marketplace_checkout = {
|
||||
status: checkoutConfirmRes.data.status,
|
||||
entitlement_id: checkoutConfirmRes.data.entitlement_id,
|
||||
tx_hash: checkoutTxHash,
|
||||
entitlement_count: Array.isArray(entitlements.entitlements)
|
||||
? entitlements.entitlements.length
|
||||
: 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user