Skip to content

feat(env): allow to load secrets from files - #5

Merged
nfroidure merged 1 commit into
mainfrom
feat/secret_files
Aug 21, 2026
Merged

nfroidure merged 1 commit into
mainfrom
feat/secret_files

Conversation

@nfroidure

Copy link
Copy Markdown
Owner

No description provided.

@nfroidure
nfroidure requested a lite review from Copilot August 21, 2026 15:20
@nfroidure nfroidure self-assigned this Aug 21, 2026
@nfroidure nfroidure added the enhancement New feature or request label Aug 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for loading environment variable values from “secret files” (e.g., Docker Compose secrets) within the ENV service, and exposes the relevant helpers/types from the package entrypoint.

Changes:

  • Extend ENV service with ENV_SECRETS_FILES options and a readSecretFile() helper to populate env vars from file contents.
  • Add/extend Jest coverage for secret-file behavior and new E_SECRET_FILE_NOT_FOUND error typing.
  • Update public exports and generated docs/architecture notes; bump tooling/dependency versions.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/types/errors.ts Adds E_SECRET_FILE_NOT_FOUND to the typed YError registry.
src/services/timeMock.ts Moves architecture note and default export to improve file structure.
src/services/process.ts Exports DEFAULT_SIGNALS and relocates architecture note.
src/services/ENV.ts Implements secret-file loading, exports helpers/constants, adjusts isolation semantics docs.
src/services/ENV.test.ts Adds test coverage for secret-file loading and failure modes; updates snapshots.
src/index.ts Switches to explicit runtime exports + export type * to expose the new helpers/types.
README.md Documents secret-file feature and adds readSecretFile() section.
package.json Updates changelog preset and bumps dependencies/devDependencies.
commitlint.config.mjs Fixes @ts-check directive spelling.
ARCHITECTURE.md Regenerates architecture notes and fixes a typo.
API.md Updates generated API docs to include readSecretFile() and new config param docs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/services/ENV.ts Outdated
Comment thread src/services/ENV.ts
Comment thread src/services/ENV.ts Outdated
Comment thread src/services/ENV.ts Outdated
Comment thread src/services/ENV.test.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Comment thread src/services/ENV.ts
Comment thread src/services/ENV.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Suppressed comments (1)

src/services/process.ts:31

  • DEFAULT_SIGNALS is now exported as a mutable array. Consumers could accidentally mutate it (e.g., push/pop), changing the library's default behavior at runtime. Prefer an immutable/readonly default and type SIGNALS as readonly to prevent accidental mutation.
export const DEFAULT_SIGNALS: NodeJS.Signals[] = ['SIGTERM', 'SIGINT'];

export interface ProcessService {
  service: NodeJS.Process;
  dispose: () => Promise<void>;
}
export interface ProcessServiceConfig {
  PROCESS_NAME?: string;
  SIGNALS?: NodeJS.Signals[];
}

Comment thread src/services/ENV.ts
Comment thread src/services/ENV.ts
Comment thread src/services/ENV.ts
Comment thread src/services/ENV.ts
@nfroidure
nfroidure merged commit 3212af8 into main Aug 21, 2026
1 check passed
@nfroidure
nfroidure deleted the feat/secret_files branch August 21, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants