[Repo Assist] test(config): add JSON schema validation tests for opentelemetry config - #8588
Merged
lpcox merged 2 commits intoJul 3, 2026
Conversation
Add TestSchema_OpenTelemetryConfig table-driven tests to cover all defined fields in the opentelemetryConfig JSON schema definition. Tests verify that: - Minimal config (endpoint only) is accepted - headers field is accepted (guards against schema/struct drift) - All defined fields together are accepted - serviceName-only variant is accepted - Missing endpoint is rejected - Unknown fields are rejected (additionalProperties: false) The opentelemetry block had no schema tests, which allowed the 'headers' field to be documented but missing from the schema without any test failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
@copilot fix failimg ci check |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds JSON schema validation coverage for the gateway.opentelemetry JSON stdin configuration by introducing a new table-driven test in the config schema test suite.
Changes:
- Add
TestSchema_OpenTelemetryConfigto validate accepted/rejected OpenTelemetry config shapes against the embedded JSON schema. - Add
fmtimport to build per-test JSON configs viafmt.Sprintf.
Show a summary per file
| File | Description |
|---|---|
| internal/config/validation_schema_test.go | Adds a table-driven JSON schema validation test for gateway.opentelemetry configuration |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 3
- Review effort level: Low
Comment on lines
+775
to
+778
| // TestSchema_OpenTelemetryConfig verifies that the JSON schema accepts and rejects | ||
| // opentelemetry configurations correctly, covering all defined fields. | ||
| // These tests guard against schema/struct drift (the headers field in particular | ||
| // was documented but missing from the schema, causing silent acceptance failures). |
Contributor
Fixed in commit I investigated the failing CI run ( |
lpcox
deleted the
repo-assist/eng-otel-schema-tests-20260703-13aa2e2c3df878fb
branch
July 3, 2026 15:34
This was referenced Jul 3, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🤖 This is an automated pull request from Repo Assist, an AI assistant.
Why
The
opentelemetryConfigJSON schema definition had no test coverage at all. This allowed a regression to exist undetected: theheadersfield was documented inCONFIGURATION.mdbut was not present in the schema (despiteadditionalProperties: false), causing silent failures for any user who suppliedheadersin their JSON stdin config.The absence of schema tests for this block also means future struct/schema drift (e.g. adding a new field to
TracingConfigbut forgetting to add it to the schema) would go unnoticed until a user reports a bug.What
Adds
TestSchema_OpenTelemetryConfig— a table-driven test that verifies:The
headerstest case in particular acts as a regression guard for the schema/struct drift pattern.This PR is companion to a separate bug-fix PR that actually adds
headersto the schema and struct (issue #8461).Test Status
Tests cannot be run locally (Go module proxy is blocked in this sandbox). The additions follow the existing
TestValidateJSONSchematable-driven pattern in the same file. CI will validate on merge.Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
awmgmcpgproxy.golang.orgSee Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run