fix(server-nestjs): make PROJECTS_ROOT_DIR optional — container startup crash (#2377) - #2378
Closed
shikanime wants to merge 3 commits into
Closed
fix(server-nestjs): make PROJECTS_ROOT_DIR optional — container startup crash (#2377)#2378shikanime wants to merge 3 commits into
shikanime wants to merge 3 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #2377.
apps/server-nestjs/src/config/base.config.tsdeclaredPROJECTS_ROOT_DIRasz.string().min(1)with no default, while the committed CI Docker template (.env.docker-example) does not set it. At boot,main.tscallsapp.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.tsandgitlab.config.ts:PROJECTS_ROOT_DIRis nowz.string().optional(), defaulting to""in the transform.apps/server-nestjs/src/modules/infrastructure/config/base.config.ts:18) already declaresprojectsRootDir?: string, so this only aligns the schema with its own contract — no consumer behavior changes.src/config/base.config.spec.tsasserting the factory no longer throws when the var is unset (passes locally).Verification
apps/server-nestjsvitest:src/config/base.config.spec.ts→ 1 passed.Note
PROJECTS_ROOT_DIRis genuinely optional for boot (gitlab/argocd vault path generation only needs it when those features run). The deeper follow-up (audit allregisterAsschemas 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