Skip to content

feat(core): in-process core constructor with GetDataStore (PR B) - #535

Open
steiler wants to merge 3 commits into
feat/api-typesfrom
feat/core-constructor
Open

steiler wants to merge 3 commits into
feat/api-typesfrom
feat/core-constructor

Conversation

@steiler

@steiler steiler commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #534 (PR A); retarget to main once A lands.

What

  • Adds pkg/core: New, Start, Stop (idempotent), WaitReady, WithDialOptions.
  • GetDataStore runs end to end through the core with pkg/api types (credentials redacted in the returned spec).
  • WatchDeviations(ctx, name) (<-chan api.DeviationEvent, error) fixes the API shape; it emits no events yet.
  • Start returns an error instead of calling os.Exit, and fails if a configured initial datastore cannot be created (previously logged and ignored).

Tests

Go test constructs the core from a *config.Config, waits ready and calls GetDataStore with no gRPC or peer. go test ./... passes.

Notes

  • pkg/server is untouched; schema/cache init is duplicated until the grpcserver adapter ticket.
  • go test -race ./pkg/core hits an existing race in pkg/datastore (Datastore.sbi written in the connect goroutine, read in Stop).

@steiler
steiler requested a review from a team as a code owner November 6, 2026 14:07
@steiler
steiler added this pull request to stack #536 November 6, 2026 14:11
@steiler
steiler force-pushed the feat/core-constructor branch from 66b143d to de21566 Compare November 9, 2026 09:59
@steiler
steiler force-pushed the feat/core-constructor branch 3 times, most recently from e58f6d1 to 1f8d04a Compare November 11, 2026 10:49
@steiler
steiler removed this pull request from stack #536 November 11, 2026 10:52
@steiler
steiler added this pull request to stack #544 November 11, 2026 10:52
@steiler
steiler force-pushed the feat/core-constructor branch from 1f8d04a to 1a8ff0d Compare November 11, 2026 11:02
@steiler
steiler force-pushed the feat/core-constructor branch from 1a8ff0d to 5eafb7f Compare November 11, 2026 12:37
…DataStore

Adds pkg/core, which builds the schema store, cache and datastores from a
*config.Config without a gRPC listener or peer. GetDataStore returns
api.DatastoreInfo and maps unknown/empty names to api sentinels.
WatchDeviations fixes the channel API shape.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
…and errors

Names the core logger data-server, validates the datastore name in one
place, drops the error alias and documents swallowed errors.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
@steiler
steiler force-pushed the feat/core-constructor branch from 5eafb7f to 1b262a1 Compare November 11, 2026 12:49
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.32812% with 99 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/core/datastore.go 46.66% 42 Missing and 6 partials ⚠️
pkg/core/init.go 43.05% 36 Missing and 5 partials ⚠️
pkg/core/core.go 89.36% 6 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant