Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

feat: add dataset dry-run and impact commands - #9

Open
beengud wants to merge 1 commit into
observeinc:mainfrom
beengud:upstream/feat-dataset-commands
Open

feat: add dataset dry-run and impact commands#9
beengud wants to merge 1 commit into
observeinc:mainfrom
beengud:upstream/feat-dataset-commands

Conversation

@beengud

@beengud beengud commented Jun 2, 2026

Copy link
Copy Markdown

Summary

Adds observe dataset subcommands for safely previewing the effect of dataset pipeline changes before applying them:

Command Description
observe dataset dry-run <file.json> Validate a dataset definition without saving; shows which rows/columns would change
observe dataset impact <file.json> Show downstream impact: dependent datasets, monitors, worksheets affected by the change

These commands are particularly useful in CI/CD workflows to catch regressions in OPAL pipeline changes before they reach production.

Files

  • cmd_dataset.go — CLI command handlers
  • cmd_dataset_test.go — unit tests
  • cmd_dataset_integration_test.go — integration tests (build tag: integration)
  • testdata/dataset_dryrun_input.json — example input for dry-run
  • docs/dataset.md — usage documentation

* feat: add dataset dry-run and unit tests

Implements `observe dataset dry-run <file.json>` which calls the
saveDatasetDryRun GraphQL mutation and reports which dataset would be
saved, which downstream datasets would be rematerialized, and any
compilation errors (exits 1 if errors present).

Also implements `observe dataset impact <file.json>` which calls
getDatasetsAffectedByDatasetUpdate and prints a table of affected
datasets with their dependency types.

Closes #21

* test: extend dataset unit test coverage

Review of existing tests from branches 21/22 found the following gaps:
- Multiple simultaneous errorDatasets not tested
- GraphQL-level error response not tested for either subcommand
- Missing file case not tested for impact subcommand

Adds TestCmdDatasetDryRunMultipleErrors, TestCmdDatasetDryRunGqlError,
TestCmdDatasetImpactGqlError, and TestCmdDatasetImpactMissingFile.

All existing cases (empty affected list, single error dataset, malformed
JSON, missing args) were already comprehensive and are retained.

Closes #23

* test: add dataset integration tests with build tag

Adds cmd_dataset_integration_test.go (//go:build integration) with:
- TestIntegrationDatasetDryRun: calls saveDatasetDryRun against the
  real Observe API; accepts success or compilation error responses as
  valid (both prove connectivity)
- TestIntegrationDatasetImpact: calls getDatasetsAffectedByDatasetUpdate
  against the real API

Credentials fall back to hardcoded defaults if OBSERVE_CUSTOMERID /
OBSERVE_AUTHTOKEN env vars are not set.

Also adds testdata/dataset_dryrun_input.json targeting workspace 42379913
with a minimal "filter true" pipeline.

Run with: go test -tags integration ./...

Closes #24

---------

Co-authored-by: Aaron Brewbaker <abrewbaker@nhl.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant