From 7e05c66a7443d67c636bd84274376f92bb572446 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 25 Jun 2025 03:33:38 -0500 Subject: [PATCH] fix: small ci fixes --- apps/api/src/lib/consumers/upsert-consumer.ts | 19 ++++---- apps/api/src/lib/exit-hooks.ts | 6 +-- apps/gateway/wrangler.jsonc | 45 +------------------ packages/cli/src/commands/deploy.ts | 2 +- 4 files changed, 16 insertions(+), 56 deletions(-) diff --git a/apps/api/src/lib/consumers/upsert-consumer.ts b/apps/api/src/lib/consumers/upsert-consumer.ts index a87f87e3..dd69859b 100644 --- a/apps/api/src/lib/consumers/upsert-consumer.ts +++ b/apps/api/src/lib/consumers/upsert-consumer.ts @@ -157,14 +157,17 @@ export async function upsertConsumer( .where(eq(schema.consumers.id, consumer.id)) .returning() } else { - ;[consumer] = await db.insert(schema.consumers).values({ - plan, - userId, - projectId, - deploymentId, - token: await createConsumerToken(), - _stripeCustomerId: stripeCustomer.id - }) + ;[consumer] = await db + .insert(schema.consumers) + .values({ + plan, + userId, + projectId, + deploymentId, + token: await createConsumerToken(), + _stripeCustomerId: stripeCustomer.id + }) + .returning() } assert(consumer, 500, 'Error creating consumer') diff --git a/apps/api/src/lib/exit-hooks.ts b/apps/api/src/lib/exit-hooks.ts index 7f53bfda..0852284f 100644 --- a/apps/api/src/lib/exit-hooks.ts +++ b/apps/api/src/lib/exit-hooks.ts @@ -35,9 +35,9 @@ export function initExitHooks({ asyncExitHook( async function shutdownDbExitHook() { try { - await db.$client.end({ - timeout: timeoutMs - }) + if ('end' in db.$client) { + await db.$client.end({ timeout: timeoutMs }) + } } catch { // TODO } diff --git a/apps/gateway/wrangler.jsonc b/apps/gateway/wrangler.jsonc index f17c178d..6a1543a2 100644 --- a/apps/gateway/wrangler.jsonc +++ b/apps/gateway/wrangler.jsonc @@ -36,55 +36,12 @@ "observability": { "enabled": true }, - - /** - * Smart Placement - * Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement - */ "placement": { "mode": "smart" }, - "upload_source_maps": true, - "analytics_engine_datasets": [ { "binding": "AE_USAGE_DATASET", "dataset": "agentic_api_gateway_usage" } - ], - - /** - * Environment Variables - * https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables - */ - "env": { - "dev": { - "vars": { - "ENVIRONMENT": "development", - "AGENTIC_API_BASE_URL": "http://localhost:3001" - } - }, - "prod": { - "vars": { - "ENVIRONMENT": "production", - "AGENTIC_API_BASE_URL": "https://api.agentic.so" - } - } - } - - /** - * Note: Use secrets to store sensitive data. - * https://developers.cloudflare.com/workers/configuration/secrets/ - */ - - /** - * Static Assets - * https://developers.cloudflare.com/workers/static-assets/binding/ - */ - // "assets": { "directory": "./public/", "binding": "ASSETS" }, - - /** - * Service Bindings (communicate between multiple Workers) - * https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings - */ - // "services": [{ "binding": "MY_SERVICE", "service": "my-service" }] + ] } diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index 119c48cc..c4057a8e 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -51,7 +51,7 @@ export function registerDeployCommand({ // publish it. const deployment = await oraPromise( client.createDeployment(config, { - publish: !!opts.publish + publish: opts.publish ? 'true' : 'false' }), { text: `Creating deployment for project "${config.name}"`,