Skip to content

feat: contract verify accepts dataset DQN in addition to local file#2

Merged
santiviquez merged 8 commits intomainfrom
feat-contract-verify-dataset
Apr 4, 2026
Merged

feat: contract verify accepts dataset DQN in addition to local file#2
santiviquez merged 8 commits intomainfrom
feat-contract-verify-dataset

Conversation

@adkinsty
Copy link
Copy Markdown
Collaborator

@adkinsty adkinsty commented Apr 4, 2026

Summary

  • sodacli contract verify now accepts a dataset DQN (datasource/db/schema/table) as
    an alternative to a local contract file
  • When the argument doesn't end in .yml/.yaml, it is treated as a DQN — the latest
    contract is looked up in Soda Cloud and verified via the Runner, no local file needed
  • Existing file-based usage is unchanged

Motivation

Enables a clean division of labor: business users author contracts in the Soda Cloud UI,
engineers just supply the dataset DQN in their pipelines — no need to download or
maintain a local contract file.

Refactor

Extracted runContractVerify into three focused helpers:

  • runContractVerifyByFile — existing file push + verify path
  • runContractVerifyByDQN — new DQN lookup + verify path
  • pollAndDisplayVerification — shared poll and display logic

Test plan

  • sodacli contract verify datasource/db/schema/table — looks up contract by DQN,
    triggers verification, polls and displays results
  • sodacli contract verify my_contract.yml — existing file path still works
  • sodacli contract verify datasource/db/schema/table --no-wait — returns
    immediately with scan ID
  • Invalid DQN with no matching contract returns clear error message

🤖 Generated with Claude Code

Allows engineers to run `sodacli contract verify datasource/db/schema/table`
without needing a local contract YAML file. When the argument does not end
in .yml/.yaml it is treated as a DQN, the latest contract is fetched from
Soda Cloud by dataset, and verification is triggered via the Runner.

Refactors runContractVerify into three focused helpers:
- runContractVerifyByFile: existing file push + verify path
- runContractVerifyByDQN: new DQN lookup + verify path
- pollAndDisplayVerification: shared poll and display logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adkinsty adkinsty requested a review from santiviquez April 4, 2026 00:33
adkinsty and others added 7 commits April 3, 2026 20:49
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes tuple returns — each path (YAML/DQN) owns its full flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Reject `--local` with a DQN argument (clear error instead of cryptic file-not-found)
- Update command_tree.txt to reflect `<file|dqn>` usage
- Clarify README docs comments for DQN vs file verify
- Add TestContractVerifyDQN: local_rejects_dqn, nonexistent_dqn, verify_by_dqn
@santiviquez santiviquez merged commit f4430e7 into main Apr 4, 2026
1 check passed
@santiviquez
Copy link
Copy Markdown
Collaborator

Awesome, thanks @adkinsty!

@adkinsty adkinsty deleted the feat-contract-verify-dataset branch April 4, 2026 16:51
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