Skip to content

feat(api): expose deviation values in stable text encoding - #539

Closed
steiler wants to merge 20 commits into
feat/grpcserver-adapterfrom
feat/deviation-value-text
Closed

steiler wants to merge 20 commits into
feat/grpcserver-adapterfrom
feat/deviation-value-text

Conversation

@steiler

@steiler steiler commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Adds ExpectedText and CurrentText to api.DeviationEntry, holding prototext of the typed value (empty when absent). Lets config-server keep writing the stored Deviation values in the format kubectl-sdcio parses. Expected and Current are unchanged.

Stacked on #538.

… ComputeCreateDSHash

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
…ash presence checks

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Remove Sync.Validate, Buffer and WriteWorkers: nothing read them, and
validation runs per transaction on the tree. Drop the unused
ComputeCreateDSHash. Add api.GNMIEncoding; unknown or numeric encodings
are rejected and a gNMI sync without an encoding inherits the target's.

go.mod temporarily replaces sdc-protos with the commit that reserves the
removed Sync fields.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
@steiler
steiler force-pushed the feat/deviation-value-text branch from 5e9c48e to ab26057 Compare November 9, 2026 15:43
@steiler
steiler force-pushed the feat/grpcserver-adapter branch from 606993a to 2aa2eee Compare November 9, 2026 15:43
config-server hashes the resolved DatastoreSpec plus referenced object
versions to decide when to recreate a datastore. Restore it without the
removed Sync fields and with the typed gNMI encoding, and document why the
hash is defined over DatastoreSpec.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
…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>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Add CreateDataStore, DeleteDataStore, TransactionSet/Confirm/Cancel,
GetIntent, BlameConfig, WatchDeviations and schema details/create/delete
to Core without any peer or gRPC dependency; Origin replaces the peer.

Share the datastore-locked and not-connected sentinels with pkg/api so
errors.Is and api.IsRetryable match them.

Deviation watchers get a bounded channel: a full channel blocks the
producer, a send blocked for 30s logs a warning, and a duplicate START
is ignored. The datastore takes a DeviationSink instead of a gRPC stream.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
@steiler
steiler force-pushed the feat/grpcserver-adapter branch from 2aa2eee to 9761a80 Compare November 9, 2026 15:56
@steiler
steiler force-pushed the feat/deviation-value-text branch from ab26057 to 072b9ac Compare November 9, 2026 15:56
steiler added a commit to sdcio/config-server that referenced this pull request Nov 10, 2026
TargetManager, TargetRuntime, the transactor, the deviation watcher and the
rollout transaction manager now call the embedded core through narrow
interfaces over pkg/api instead of a gRPC client. The target datastore
reconciler builds api.DatastoreSpec directly; the datastore hash and the
retry classification use api.ComputeCreateDSHash and api.IsRetryable, and
unknown datastores are matched with api.ErrUnknownDatastore.

Removed: DSConnManager, PhaseWaitingForDS, DSReady, the fake gRPC client,
the unused sdcctx package, GetLocalDataServerAddress and the dataserverpin
placeholder. The merged binary no longer opens the data-server metrics
listener on prometheus.address.

The api-server is a separate deployment without a core, so its target
helpers and dry-run keep the :56000 client.

Pairs with: sdcio/data-server#538, sdcio/data-server#539

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
steiler added a commit to sdcio/config-server that referenced this pull request Nov 10, 2026
TargetManager, TargetRuntime, the transactor, the deviation watcher and the
rollout transaction manager now call the embedded core through narrow
interfaces over pkg/api instead of a gRPC client. The target datastore
reconciler builds api.DatastoreSpec directly; the datastore hash and the
retry classification use api.ComputeCreateDSHash and api.IsRetryable, and
unknown datastores are matched with api.ErrUnknownDatastore.

Removed: DSConnManager, PhaseWaitingForDS, DSReady, the fake gRPC client,
the unused sdcctx package, GetLocalDataServerAddress and the dataserverpin
placeholder. The merged binary no longer opens the data-server metrics
listener on prometheus.address.

The api-server is a separate deployment without a core, so its target
helpers and dry-run keep the :56000 client.

Pairs with: sdcio/data-server#538, sdcio/data-server#539

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Add Datastore.IntentToInternalTI and share the flag and expansion logic
with the gRPC path through buildTransactionIntent. Explicit delete paths
that do not parse now fail with ErrInvalidArgument instead of being
skipped.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Blame and deviation trees may omit values on container nodes; ToString
on nil panicked in TestTransactionLifecycleWithoutPeer.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Wire DataServer and SchemaServer through pkg/core with interceptors,
ready gate, metrics, and handler-level error parity. Standalone main
only retries listen failures and shuts down core on signal.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Keep schema names through api.SchemaRef, echo the configured target type
and drop the target port in GetDataStore, and validate CreateDataStore in
the original order with the original messages. Map resource exhaustion and
deadline errors, keep untyped invalid-argument errors on the transaction
path and reject non-JSON update values instead of dropping them.

Run retries listen and serve errors with a growing delay and returns the
core start failure; main exits non-zero on it and stops the core on a
fresh context. Dedupe handler logging and error mapping, document the
caller contracts and add wire, error-table and lifecycle tests.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
SchemaRef gained an optional Name; a change to it must recreate the datastore.

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
@steiler
steiler force-pushed the feat/deviation-value-text branch from 072b9ac to 9d5f594 Compare November 11, 2026 08:38
@steiler
steiler force-pushed the feat/grpcserver-adapter branch from 9761a80 to a3da59d Compare November 11, 2026 08:38
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/core/transaction.go 71.42% 1 Missing and 1 partial ⚠️

📢 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.

@steiler
steiler force-pushed the feat/grpcserver-adapter branch from a3da59d to 5bb99e9 Compare November 11, 2026 10:41
@steiler
steiler removed this pull request from stack #536 November 11, 2026 10:52
@steiler
steiler force-pushed the feat/grpcserver-adapter branch 7 times, most recently from bffc31e to 16fbe76 Compare November 12, 2026 10:27
@steiler steiler closed this Nov 12, 2026
steiler added a commit to sdcio/config-server that referenced this pull request Nov 12, 2026
TargetManager, TargetRuntime, the transactor, the deviation watcher and the
rollout transaction manager now call the embedded core through narrow
interfaces over pkg/api instead of a gRPC client. The target datastore
reconciler builds api.DatastoreSpec directly; the datastore hash and the
retry classification use api.ComputeCreateDSHash and api.IsRetryable, and
unknown datastores are matched with api.ErrUnknownDatastore.

Removed: DSConnManager, PhaseWaitingForDS, DSReady, the fake gRPC client,
the unused sdcctx package, GetLocalDataServerAddress and the dataserverpin
placeholder. The merged binary no longer opens the data-server metrics
listener on prometheus.address.

The api-server is a separate deployment without a core, so its target
helpers and dry-run keep the :56000 client.

Pairs with: sdcio/data-server#538, sdcio/data-server#539

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
steiler added a commit to sdcio/config-server that referenced this pull request Nov 12, 2026
TargetManager, TargetRuntime, the transactor, the deviation watcher and the
rollout transaction manager now call the embedded core through narrow
interfaces over pkg/api instead of a gRPC client. The target datastore
reconciler builds api.DatastoreSpec directly; the datastore hash and the
retry classification use api.ComputeCreateDSHash and api.IsRetryable, and
unknown datastores are matched with api.ErrUnknownDatastore.

Removed: DSConnManager, PhaseWaitingForDS, DSReady, the fake gRPC client,
the unused sdcctx package, GetLocalDataServerAddress and the dataserverpin
placeholder. The merged binary no longer opens the data-server metrics
listener on prometheus.address.

The api-server is a separate deployment without a core, so its target
helpers and dry-run keep the :56000 client.

Pairs with: sdcio/data-server#538, sdcio/data-server#539

Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
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