diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..32aff8c --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,23 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +# yaml template to refer to https://docs.coderabbit.ai/reference/yaml-template#enterprise +language: "en-US" +reviews: + collapse_walkthrough: false + profile: "chill" + high_level_summary: true + request_changes_workflow: true + poem: false + in_progress_fortune: false + sequence_diagrams: false + suggested_labels: false + suggested_reviewers: false + auto_review: + enabled: true + drafts: false + finishing_touches: + docstrings: + enabled: false + unit_tests: + enabled: false +chat: + art: false diff --git a/create-db-worker/src/index.ts b/create-db-worker/src/index.ts index a4c7066..5b53420 100644 --- a/create-db-worker/src/index.ts +++ b/create-db-worker/src/index.ts @@ -94,6 +94,7 @@ export default { region?: string; name?: string; analytics?: { eventName?: string; properties?: Record }; + userAgent?: string; }; let body: CreateDbBody = {}; @@ -104,16 +105,17 @@ export default { return new Response('Invalid JSON body', { status: 400 }); } - const { region, name, analytics: analyticsData } = body; + const { region, name, analytics: analyticsData, userAgent } = body; if (!region || !name) { return new Response('Missing region or name in request body', { status: 400 }); } - + console.log('userAgent:', userAgent); const prismaResponse = await fetch('https://api.prisma.io/v1/projects', { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${env.INTEGRATION_TOKEN}`, + 'User-Agent': userAgent || '', }, body: JSON.stringify({ region, diff --git a/create-db/index.js b/create-db/index.js index e794ddc..3c0c058 100755 --- a/create-db/index.js +++ b/create-db/index.js @@ -431,7 +431,8 @@ async function createDatabase(name, region, userAgent, silent = false) { body: JSON.stringify({ region, name, - utm_source: userAgent || CLI_NAME, + utm_source: CLI_NAME, + userAgent, }), });