Testing & Release
Prove the adapter contract, migrate provider-scoped identities, configure the database Provider, and enable catalog and schedules in controlled stages.
On this page
Test the contract without real provider credentials
npm run test:integrations| Area | Required evidence |
|---|---|
| Discovery and manifest | Validation failures, duplicate aliases, built-in loader discovery, external directory/package discovery, and required-hook checks. |
| Authentication | Every method, invalid and missing fields, challenge failures, provider validation, 401 reconnect, explicit 403 semantics, refresh, throttling, and safe errors. |
| Sync and mapping | Full pagination, empty account, deterministic groups, account/group/event identity, ticket prices/currency/availability, partial counts, complete deactivation, and partial retention. |
| Checkout pricing | checkout_fee schema rejection, component order/basis and rounding, free orders, purchaser/merchant payer choices, invalid payer fail-closed behavior, immutable Purchase snapshots, replay, and payer-aware full refunds. |
| Provider resilience | Timeouts, response limits, rate limits, bounded retries, abort signals, and logs/error bodies without credentials. |
| Fulfillment | Success, provider-confirmed failure, repeated and concurrent idempotency keys, stale leases, bounded safe retry, ambiguous outcome, manual reconciliation, and projection replay. |
| Identity scope | Two providers can return identical upstream account, group, event, and ticket IDs without database collisions. |
Inject or mock the provider client. Automated tests must not call a live provider, depend on developer credentials, or require network access. Add a focusedvalidateAdapter(adapter) contract test beside provider mapping and error tests, then keep the full suite as the release gate.
Run the provider-scoped index migration before traffic
node migrations/database/migrate-ticket-integration-indexes.jsnode migrations/database/migrate-ticket-integration-indexes.js --applyUpstream IDs are unique only inside their Provider and owner scope. The migration replaces legacy global uniqueness with Provider-scoped account, group, event, and fulfillment identities. It also canonicalizes one accepted Provider row, backfills connection generations and creates scheduler, rate-limit TTL, and commission indexes.
- Dry-run blocks on duplicate provider names, duplicate normalized keys, and manifest key/name/alias disagreements.
- Malformed Provider config, broken non-null group references, or ambiguous owner/account matches require manual repair; the migration does not guess or auto-merge rows.
- Production runs with autoIndex disabled, so application startup cannot replace this pre-traffic gate.
- Use a database backup and normal change window. The deployment workflow must stop before versioning, artifact build, or Lambda traffic if apply mode fails.
node migrations/database/migrate-integration-app-pricing.jsnode migrations/database/migrate-integration-app-pricing.js --applyThe second migration fills missing public app metadata andProvider.config.checkout_fee for the canonical Bookt, Posh, and Eventbrite rows, snapshots missing raw_data.checkout_fee_policy on imported resources, and defaults a missingProviderAccount.settings.integration_fee_payer. It preserves existing reviewed copy, protected Provider config, explicit payer choices, and historical snapshots. Invalid or ambiguous state blocks apply instead of being overwritten.
Configure the real Provider row before enabling inventory
Keep the adapter disabled
Ship with
catalog.enabledByDefault: falseand leave scheduled sync off.Bind the catalog row
Deploy the reviewed adapter so catalog initialization resolves or creates the environment's Provider row by key/name and binds its actual Mongo ID.
Verify identity
Confirm the row's
key, canonicalname, environment-owned_id, andconfig.integration_keydescribe the same integration.Add protected application settings
Place provider-level application credentials and operational settings in Provider.config through the restricted operator process, never through a client request.
Review checkout pricing
Add a versioned
Provider.config.checkout_feepolicy with a canonical currency, ordered components, allowed/default payers, public source, verification date, and summary before an adapter declaring ticket inventory imports new classes.Configure auth throttling
Set a stable independently generated
INTEGRATION_AUTH_RATE_LIMIT_HASH_SECRETand apply the migration-created TTL index before exposing login methods.
Exercise the complete live chain in staging
Connect an internal owner
Use an approved provider test account and the same authentication method the production manifest will expose.
Compare imports
Verify every organization/group, event page, ticket class, nominal price, currency, availability, pagination count, and partial error against the provider.
Test Eventbrite surfaces independently
For Eventbrite, run organizer login, official profile/organization/event reads, private ticket inventory, and private guest-list issuance. Prove the connected-user token on each surface.
Place controlled payer orders
Use a safe event and buyer with Purchaser pays and Merchant covers. Verify the server quote, Stripe charge/application fee, Purchase.checkout_pricing snapshot, one upstream issuance, and provider reference.
Exercise full refunds
Verify purchaser-paid fees retain the snapshotted fee while refunding the base, merchant-paid fees refund the full buyer charge and application fee, and both reverse the transfer without changing the original snapshot.
Repeat the same attempt
Dispatch fulfillment again with the identical test idempotency key and confirm that exactly one provider order or guest exists.
Exercise recovery
Simulate a retryable failure and an ambiguous response. Verify bounded retry, reconciliation_required behavior, withheld confirmation, and audited manual resolution.
Enable catalog access before scheduled work
Enable only in staging or a pilot environment
Turn on the Provider catalog in a staging or otherwise isolated pilot environment first while scheduled sync remains disabled. The current catalog does not provide a per-account enablement gate.
Observe manual use
Monitor authentication failures, partial-sync counts, item errors, provider latency, rate limits, reconnect state, and fulfillment attention rows.
Enable the shared schedule
Declare and enable scheduled sync only after connect-time and manual sync are stable. Confirm queue leases, fairness indexes, abort propagation, batch limits, and Lambda safety windows.
Promote one environment at a time
After the isolated pilot is stable, enable the Provider catalog in the next environment while comparing Diem counts and upstream records. Keep an assigned owner for reconciliation and credential rotation.
| Signal | Response |
|---|---|
| Authentication 401 increase | Stop new connections if necessary, mark affected accounts reconnect-required, and verify credential/application-token rotation. |
| Event-scoped documented 403 | Keep the sync partial and last-known-good inventory; investigate provider ownership or permission for that event. |
| Partial counts or pagination drift | Compare fetched/saved/failed counts and disable catalog or schedule if buyers could see stale availability. |
| Fulfillment failed or reconciliation_required | Do not reissue blindly. Compare the provider reference/order, payment, durable line state, Purchase projection, email, DM, and commission finalization. |
Rollback availability, not data safety
- Disable catalog access and scheduled work first; prevent new connections and imports while preserving durable records for investigation.
- Do not restore legacy global unique indexes during an application rollback. They encode the cross-provider collision defect the migration removes.
- Do not delete imported events, fulfillment rows, Provider accounts, or Provider configuration to make a dashboard look clean.
- Reconcile every settled payment and ambiguous provider issuance before resuming traffic; use the same stable idempotency key and provider reference.
- Rotate compromised provider credentials at the upstream service and in the protected Provider row, then require reconnect where necessary.
- Document the affected provider, accounts, resources, time window, partial counts, buyer orders, and audited manual corrections before re-enabling.