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
Open
Conversation
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
observe datasetsubcommands for safely previewing the effect of dataset pipeline changes before applying them:observe dataset dry-run <file.json>observe dataset impact <file.json>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 handlerscmd_dataset_test.go— unit testscmd_dataset_integration_test.go— integration tests (build tag:integration)testdata/dataset_dryrun_input.json— example input for dry-rundocs/dataset.md— usage documentation