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) {
|
if (!checkoutTxHash) {
|
||||||
console.log(JSON.stringify(result, null, 2));
|
// Keep running; governance install may still be valid for pre-existing entitlements.
|
||||||
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)}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const entitlements = await expectOK(
|
const checkoutConfirmRes = await requestJSON(
|
||||||
"GET",
|
"POST",
|
||||||
`/marketplace/entitlements?wallet=${encodeURIComponent(wallet)}`,
|
"/marketplace/checkout/confirm",
|
||||||
undefined,
|
{
|
||||||
|
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
|
sessionToken
|
||||||
);
|
);
|
||||||
result.stages.marketplace_checkout = {
|
if (!checkoutConfirmRes.ok) {
|
||||||
status: checkoutConfirmRes.data.status,
|
if (isTxPendingResponse(checkoutConfirmRes)) {
|
||||||
entitlement_id: checkoutConfirmRes.data.entitlement_id,
|
result.stages.marketplace_checkout = summarizeSkip(
|
||||||
tx_hash: checkoutTxHash,
|
"tx_pending",
|
||||||
entitlement_count: Array.isArray(entitlements.entitlements)
|
checkoutConfirmRes.status,
|
||||||
? entitlements.entitlements.length
|
checkoutConfirmRes.data?.error || JSON.stringify(checkoutConfirmRes.data || {})
|
||||||
: 0,
|
);
|
||||||
};
|
} 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