Skip to content

apollo_deployments: derive override schema by evaluating applicative jsonnet#14571

Closed
nimrod-starkware wants to merge 1 commit into
graphite-base/14571from
nimrod/jsonnet/override-schema-from-eval
Closed

apollo_deployments: derive override schema by evaluating applicative jsonnet#14571
nimrod-starkware wants to merge 1 commit into
graphite-base/14571from
nimrod/jsonnet/override-schema-from-eval

Conversation

@nimrod-starkware

Copy link
Copy Markdown
Contributor

The override-schema invariant test extracted overridable keys by scanning
applicative_config.libsonnet source for the substring overrides.
(split_once per line), which is brittle: a reformat that splits a
reference across lines, a second overrides. on one line, or the string
appearing in a comment all silently change the derived key set.

Replace the text scan with evaluation: build an overrides object that
places a path-encoding sentinel at every override path expected from
KEYS_TO_BE_REPLACED (collapsing optional configs marked .#is_none to
their option root, which the applicative reads whole), evaluate
applicative_config(overrides), and check which sentinels reached the
output. A sentinel that never appears is a replacer key the applicative
never reads; an override the applicative reads but KEYS_TO_BE_REPLACED
does not declare makes jsonnet fail to evaluate (missing field). Both
failure directions are exercised by mutation testing. The check is now
about actual consumption and is insensitive to jsonnet formatting.

The distinct "covered by more than one override" diagnostic the source
scan produced now surfaces as an evaluation error (indexing a sub-field
of a scalar sentinel) rather than a dedicated message.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

nimrod-starkware commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

…jsonnet

The override-schema invariant test extracted overridable keys by scanning
applicative_config.libsonnet source for the substring `overrides.`
(split_once per line), which is brittle: a reformat that splits a
reference across lines, a second `overrides.` on one line, or the string
appearing in a comment all silently change the derived key set.

Replace the text scan with evaluation: build an `overrides` object that
places a path-encoding sentinel at every override path expected from
KEYS_TO_BE_REPLACED (collapsing optional configs marked `.#is_none` to
their option root, which the applicative reads whole), evaluate
`applicative_config(overrides)`, and check which sentinels reached the
output. A sentinel that never appears is a replacer key the applicative
never reads; an override the applicative reads but KEYS_TO_BE_REPLACED
does not declare makes jsonnet fail to evaluate (missing field). Both
failure directions are exercised by mutation testing. The check is now
about actual consumption and is insensitive to jsonnet formatting.

The distinct "covered by more than one override" diagnostic the source
scan produced now surfaces as an evaluation error (indexing a sub-field
of a scalar sentinel) rather than a dedicated message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nimrod-starkware nimrod-starkware changed the base branch from nimrod/jsonnet/exact-equality-parity to graphite-base/14571 June 21, 2026 09:31
@nimrod-starkware nimrod-starkware force-pushed the nimrod/jsonnet/override-schema-from-eval branch from 975bd5d to 6948beb Compare June 21, 2026 09:32
@nimrod-starkware nimrod-starkware changed the base branch from graphite-base/14571 to nimrod/jsonnet/configmap-generator-optin June 21, 2026 09:32
@nimrod-starkware nimrod-starkware changed the base branch from nimrod/jsonnet/configmap-generator-optin to graphite-base/14571 June 21, 2026 12:10
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.

2 participants