Skip to content

perf(core): let parser packages read credentials without loading the server entry - #456

Merged
Medformatik merged 1 commit into
mainfrom
fix/credentials-light-import
Nov 24, 2026
Merged

Medformatik merged 1 commit into
mainfrom
fix/credentials-light-import

Conversation

@Medformatik

Copy link
Copy Markdown
Contributor

What changed and why

Main CI has failed twice on 707bb68 (#455), both times in the same two bounded-subprocess tests: packages/cameras/src/__tests__/tfl.test.ts ("unclosed view parentheses finish within a bounded child process") and packages/charging/src/__tests__/site.test.ts ("malformed power whitespace completes within a bounded subprocess"). Each took about 2050 ms against its 2 s bound.

The cause is #455's deduplication of the credential reader. packages/ingest-framework/src/catalog/credentials.ts now imports readCredential and strictCredential from @openconditions/core/server. Every parser package's import graph therefore loads the whole server entry, with database, crypto and migrations, and each child process those tests start pays for it.

packages/core now builds src/credentials.ts, which only uses node:fs, as its own entry @openconditions/core/credentials. The ingest framework imports from there. @openconditions/core/server still re-exports the same functions, so services are unchanged.

Verification and limits

  • Import cost: on this Mac, importing the cameras test helper in a fresh tsx process takes about 250 ms, down from about 530 ms. @openconditions/core/server alone costs about 335 ms against 79 ms for @openconditions/core.
  • Local checks:
    • vitest run on both failing files and packages/ingest-framework: 715 passed.
    • pnpm typecheck, pnpm lint (including import boundaries), pnpm check:packed-packages and pnpm check:release-information pass.
  • Not shown locally: whether hosted main CI now stays under the bound. The next main run is the evidence.

Release and upgrade impact

None. @openconditions/core is private, and the new subpath only narrows an import inside the workspace.

@Medformatik Medformatik self-assigned this Nov 24, 2026
@Medformatik
Medformatik merged commit 2605a28 into main Nov 24, 2026
21 checks passed
@Medformatik
Medformatik deleted the fix/credentials-light-import branch November 24, 2026 09:49
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant