Skip to content

PLATL-650: add soda_runner alongside soda_agent in lint contract schema (backwards-compatible)#14

Merged
AidaPaul merged 3 commits into
mainfrom
platl-650-agent-runner-contract-schema-change
May 29, 2026
Merged

PLATL-650: add soda_runner alongside soda_agent in lint contract schema (backwards-compatible)#14
AidaPaul merged 3 commits into
mainfrom
platl-650-agent-runner-contract-schema-change

Conversation

@AidaPaul
Copy link
Copy Markdown
Contributor

Linear: PLATL-650

Summary

Mirrors the agent → runner rename landing across the rest of the stack (soda-server, soda-webapp, soda-core, soda-extensions). The lint command validates contracts against this embedded JSON Schema; without this change, contracts using the new soda_runner key would be rejected here because the schema's root has additionalProperties: false.

Changes

  • Add soda_runner as a new top-level property (same shape as soda_agent: checks_schedule with cron / timezone / variables).
  • Rewrite soda_agent description to "DEPRECATED: use 'soda_runner' instead. Kept for backwards compatibility."
  • Add a root oneOf enforcing "exactly one of the two keys, or neither" so contracts that set both fail validation cleanly.

No Go code changes

The schema is consumed via santhosh-tekuri/jsonschema/v6 as untyped JSON Schema; there is no key-name lookup in Go to update. Filename is unchanged (soda_data_contract_json_schema_1_0_0.json) so the //go:embed directive in schema.go keeps working — matches the filename-stability decision in sodadata/soda-core#2718.

Backwards compatibility

  • Contracts using soda_agent continue to validate.
  • Contracts using soda_runner start validating.
  • Contracts with both are rejected with a oneOf validation error (intentional — keeps schema clean).
  • No CLI flag changes, no Go struct changes.

Companion / related PRs

  • sodadata/soda#12250 — the same rename across the Java backend (ContractParser, autopilot serializer), the Angular contract editor, the server schema, and tests.
  • Independent of PR #13 (Michael's datasource API agentIdrunnerId cleanup) — disjoint file sets, land in any order.

Test plan

  • CI: existing lint tests should pass unchanged (no Go code modified)
  • Manual: soda contract lint on a contract using soda_runner: — should pass
  • Manual: soda contract lint on a contract using soda_agent: — should still pass (deprecated alias)
  • Manual: soda contract lint on a contract with both keys — should fail with oneOf validation error

…ma (backwards-compatible)

Mirrors the agent->runner rename landing in soda-server, soda-webapp,
soda-core, and soda-extensions. The lint command validates contracts
against this embedded JSON Schema; without the change, contracts using
the new `soda_runner` key are rejected because the root has
`additionalProperties: false`.

- Adds `soda_runner` as a new top-level property (same shape as
  `soda_agent`: `checks_schedule` with cron / timezone / variables).
- Rewrites `soda_agent` description to "DEPRECATED: use 'soda_runner'
  instead. Kept for backwards compatibility."
- Adds a root `oneOf` enforcing "exactly one of the two keys, or neither"
  so contracts that set both fail validation cleanly.

No Go code changes -- the schema is consumed via
`santhosh-tekuri/jsonschema/v6` as untyped JSON Schema, so there is no
key-name lookup to update. Filename is unchanged
(`soda_data_contract_json_schema_1_0_0.json`) so the `//go:embed`
directive in `schema.go` keeps working; this matches the
filename-stability decision in soda-core#2718.

Companion PR landing the same rename across the Java backend, the
Angular contract editor, and tests:
sodadata/soda#12250

Linear: PLATL-650 https://linear.app/sodadata/issue/PLATL-650
@AidaPaul AidaPaul self-assigned this May 26, 2026
…re description, add lint tests

Addresses review feedback on PR 14:

- Schema: replace 3-branch oneOf with {not: {required: [soda_runner, soda_agent]}}.
  Logically equivalent; produces a cleaner validator error (`$: 'not' failed`
  vs `must be valid to exactly one schema in oneOf`).
- Schema: drop dead `additionalProperties: false` nested inside the variables
  value schema. The keyword is unreachable because the value's `type` is
  ["string", "number"] (never an object). Pre-existing leftover, copied into
  the new soda_runner block; fixed in both.
- Schema: align soda_runner description with soda-core PR #2718 wording for
  cross-stack consistency.

Tests (lint_test.go):
- TestLintFile_AcceptsSodaRunner
- TestLintFile_AcceptsSodaAgentLegacyAlias
- TestLintFile_RejectsBothSodaRunnerAndSodaAgent

All 9 lint tests pass.
Per second-pass review feedback, the previous version of
TestLintFile_RejectsBothSodaRunnerAndSodaAgent asserted only that the
contract was rejected with at least one error -- not that the error
surfaced at the document root ('$') where the new `not: {required:
[soda_runner, soda_agent]}` constraint produces it. Adds an assertion
that one of the reported errors has Path == "$" so the user-visible
error location doesn't silently regress to e.g. a property-level
report.
@AidaPaul AidaPaul marked this pull request as ready for review May 26, 2026 09:50
@AidaPaul AidaPaul merged commit e90d8be into main May 29, 2026
1 check passed
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