Skip to content

Commit 00f8f13

Browse files
committed
ci(quality): set DATABASE_CONNECTION_URI so the build gate actually runs
The Check Code Quality job has been red since dd552c7 and never reached its "Check build" step: Prisma 7's prisma.config.ts resolves datasource.url via env("DATABASE_CONNECTION_URI"), which throws PrismaConfigEnvError when the variable is absent, and the runner has no .env (the Dockerfile copies .env.example, which is why image builds got past this point). prisma generate never opens a connection, so a syntactically valid URI is enough. Without this the build gate stays dead and the next dependency bump breaks develop unnoticed, exactly as this one did. Also aligns the EvoHub req.params.id cast with the convention used by the other 30 call sites in src (as string), instead of String().
1 parent 7db484e commit 00f8f13

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/check_code_quality.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737

3838
- name: Generate Prisma client
3939
run: npm run db:generate
40+
env:
41+
# prisma.config.ts resolves datasource.url from this variable when the Prisma CLI
42+
# loads, and there is no .env on the runner. `prisma generate` never opens a
43+
# connection, so any syntactically valid URI works.
44+
DATABASE_PROVIDER: postgresql
45+
DATABASE_CONNECTION_URI: postgresql://user:pass@localhost:5432/evolution?schema=public
4046

4147
- name: Check build
4248
run: npm run build

src/api/integrations/channel/evohub/evohub.controlplane.router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class EvoHubControlPlaneRouter extends RouterBroker {
3737
});
3838

3939
this.router.get('/evohub/channels/:id', guard, async (req, res) => {
40-
res.json(await evoHubClient.getChannel(String(req.params.id)));
40+
res.json(await evoHubClient.getChannel(req.params.id as string));
4141
});
4242

4343
this.router.get('/evohub/available-channels', guard, async (_req, res) => {
@@ -114,7 +114,7 @@ export class EvoHubControlPlaneRouter extends RouterBroker {
114114
});
115115

116116
this.router.post('/evohub/channels/:id/meta-connect', guard, async (req, res) => {
117-
res.json(await evoHubClient.connectToMeta(String(req.params.id), req.body));
117+
res.json(await evoHubClient.connectToMeta(req.params.id as string, req.body));
118118
});
119119
}
120120
}

0 commit comments

Comments
 (0)