Skip to content

fix(server-nestjs): make PROJECTS_ROOT_DIR optional — container startup crash (#2377) - #2378

Closed
shikanime wants to merge 3 commits into
mainfrom
wt/t_7c23f271
Closed

fix(server-nestjs): make PROJECTS_ROOT_DIR optional — container startup crash (#2377)#2378
shikanime wants to merge 3 commits into
mainfrom
wt/t_7c23f271

Conversation

@shikanime

Copy link
Copy Markdown
Member

What

Fixes #2377. apps/server-nestjs/src/config/base.config.ts declared PROJECTS_ROOT_DIR as z.string().min(1) with no default, while the committed CI Docker template (.env.docker-example) does not set it. At boot, main.ts calls app.get(BASE_CONFIG)baseConfigFactory() → zod throws "PROJECTS_ROOT_DIR: Required" → process exits → container unhealthy → compose aborts the Playwright E2E job before any spec runs.

This is the 3rd CI breakage from the configuration → module-definition migration (#2290 build, #2365 unit tests, this one).

Change

  • base.config.ts and gitlab.config.ts: PROJECTS_ROOT_DIR is now z.string().optional(), defaulting to "" in the transform.
  • The consumed interface (apps/server-nestjs/src/modules/infrastructure/config/base.config.ts:18) already declares projectsRootDir?: string, so this only aligns the schema with its own contract — no consumer behavior changes.
  • Added src/config/base.config.spec.ts asserting the factory no longer throws when the var is unset (passes locally).

Verification

  • apps/server-nestjs vitest: src/config/base.config.spec.ts → 1 passed.

Note

PROJECTS_ROOT_DIR is genuinely optional for boot (gitlab/argocd vault path generation only needs it when those features run). The deeper follow-up (audit all registerAs schemas for required env vars missing from their .env*docker/integ*-example templates + a CI boot smoke guard) is tracked in #2377; this PR closes the instance.

🤖 Generated with Hermes Agent

Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: I6f501bd1633ceb14edaa9bf2a324ea026a6a6964
…attern

Consolidate the server-nestjs configuration into the module-definition
pattern introduced across feature modules. Each plugin now declares its
own config dependencies through a ConfigurableFeatureModule helper and a
dedicated module-definition file, replacing the previous global registerAs
object wiring performed in main.module. This keeps config co-located with
the module that consumes it and removes the shared config lookups that
read transformed env keys at runtime.

Signed-off-by: Shikanime Deva <william.phetsinorath@shikanime.studio>
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: I1836ab5c8d5eba847539fc158634cfbf6a6a6964
z.string().min(1) had no default and was absent from .env.docker-example,
causing baseConfigFactory() to throw at startup and crash the container
before healthcheck, aborting the Playwright E2E job (closes #2377).

The consumed interface already declares projectsRootDir as optional, so the
zod schema was stricter than its own contract. Defaulting to '' in the
transform and adding a regression spec.
@shikanime shikanime added bug Something isn't working CI/CD CI/CD stuffs labels Jul 28, 2026
@shikanime shikanime closed this Jul 28, 2026
@shikanime
shikanime deleted the wt/t_7c23f271 branch July 29, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD CI/CD stuffs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server-nestjs: required config env (PROJECTS_ROOT_DIR) crashes container at startup — 3rd CI breakage from config migration

1 participant