test: lock in the env adapter as the single owner of process.env with static scan, mutation and deterministic probes (E00-S04-T04)
This commit is contained in:
@@ -226,6 +226,36 @@ jobs:
|
||||
- name: Run config log redaction test suite
|
||||
run: node --test tests/config-log-redaction.test.mjs
|
||||
|
||||
# E00-S04-T04: the static assertions of tests/config-env-adapter.test.mjs
|
||||
# gate every PR — the suite locks in the environment adapter (packages/config
|
||||
# is the single owner of process.env reads; the server and every other module
|
||||
# read no process.env, all settings flow through loadConfigFromEnv into the
|
||||
# validated config) with a comment-stripped workspace scan, mutation probes
|
||||
# (injecting a direct process.env read into any other module fails the scan),
|
||||
# a deterministic boundary probe (full env mapping, defaults, bad-PORT
|
||||
# fallback, missing required secret -> MissingRequiredSettingError) and
|
||||
# server-boot probes (a PORT/HOST override shows up in the resolved
|
||||
# configuration; a missing required secret still fails startup). The job
|
||||
# installs the frozen workspace and builds the config and database-postgres
|
||||
# packages because the probes boot the committed server which imports them.
|
||||
config-env-adapter:
|
||||
name: Env adapter owns process.env (E00-S04-T04)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Node.js 24
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
- name: Enable pnpm (corepack, pinned to 11.23.0 via packageManager)
|
||||
run: corepack enable
|
||||
- name: Install dependencies (frozen lockfile)
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Build the config and database-postgres packages (the probes boot the committed server which imports them)
|
||||
run: pnpm --filter @personal-blog/config build && pnpm --filter @personal-blog/database-postgres build
|
||||
- name: Run config env adapter test suite
|
||||
run: node --test tests/config-env-adapter.test.mjs
|
||||
|
||||
# E00-S04-T01: the static assertions of tests/config-schema.test.mjs gate
|
||||
# every PR — the suite locks in the TypeBox/Ajv configuration schema
|
||||
# (packages/config, golden-tuple pins @sinclair/typebox@0.34.52 +
|
||||
|
||||
Reference in New Issue
Block a user