This repository was archived by the owner on Jun 23, 2026. It is now read-only.
feat: add opal subcommands for pipeline linting and reference - #8
Open
beengud wants to merge 1 commit into
Open
Conversation
* feat: implement observe opal check command Adds the opal command with check subcommand that validates OPAL pipelines using the checkQueries GraphQL API. Also includes skeleton implementations of opal verbs, opal functions, and opal validate-ingest to enable compilation (full implementations follow in issues #6 and #7). - cmd_opal.go: command registration, opal check implementation - ot_opal.go: verbsAndFunctions query, verbs/functions subcommands - cmd_opal_validate.go: validateIngestFilterExpression query/subcommand - cmd_opal_test.go: unit tests with mock HTTP client - docs/opal.md: command documentation Closes #5 * feat: implement observe opal verbs and opal functions subcommands Adds verbsAndFunctions query implementation in ot_opal.go and unit tests in ot_opal_test.go. Both subcommands query the Observe verbsAndFunctions GraphQL API and output results sorted alphabetically in tab-separated columns. - opal verbs: name | category | description - opal functions: name | category | returnType | description Closes #6 * test: add edge case unit tests and integration test stub for opal commands Reviews existing opal test coverage (issues #5, #6) and adds: - cmd_opal_extra_test.go: edge cases (empty pipeline, multiple errors, network errors for all subcommands, validate-ingest warning handling) - cmd_opal_integration_test.go: stub with build tag //go:build integration documenting the integration test plan for issue #9 - cmd_opal.go: move --dataset flag to parent opal flagset for correct parsing - cmd_opal_validate.go: update to use parent flagset flagOpalDataset Closes #8 * feat: add integration tests and fix GraphQL schema for opal commands (#9) Correct all three GQL queries to match the live Observe API schema (checkQueries uses col/row/text array response, verbsAndFunctions uses categories array, validateIngestFilterExpression only returns message). Add full integration test suite under //go:build integration. Fix global flagOpalFile leak between unit tests causing TestCmdOpalCheckEmptyTextError to fail when run after TestCmdOpalCheckFile. --------- 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 opalsubcommands for OPAL pipeline validation and language reference:observe opal check <pipeline>checkQueriesAPIobserve opal check --file <path>observe opal verbsobserve opal functionsobserve opal validate-ingest --dataset <id> <expr>These commands are useful for CI/CD pipelines that validate OPAL before deploying dataset changes, and for developers looking up OPAL syntax without leaving the terminal.
GraphQL schema notes (verified against live tenant)
checkQueriesresult fields:col/row/text(notline/column/message)verbsAndFunctions: usescategories []array (not acategorystring)validateIngestFilterExpression: returns only{ message }(no span info)Files
cmd_opal.go— CLI command handlerscmd_opal_validate.go— ingest validation subcommandot_opal.go/ot_opal_test.go— GraphQL operations and unit testscmd_opal_test.go/cmd_opal_extra_test.go— handler unit testscmd_opal_integration_test.go— integration tests (build tag:integration)cmd_opal_validate_test.go— validate unit testsdocs/opal.md— usage documentation