Pin JSON schema to v0.41.1 and add validation performance metrics#711
Merged
Pin JSON schema to v0.41.1 and add validation performance metrics#711
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update jsonschema module to latest version
Pin JSON schema to v0.41.1 and add validation performance metrics
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses build reproducibility concerns by pinning the JSON schema URL to a specific version (v0.41.1) instead of tracking the main branch, and adds performance metrics to help monitor validation operations.
Changes:
- Pinned schema URL from
mainbranch tov0.41.1for build reproducibility - Added timing instrumentation for schema fetch, compilation, parsing, and validation operations
- Updated documentation comments with clear instructions for updating schema versions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Schema URL pointed to
mainbranch, risking unexpected breaking changes and non-reproducible builds. No visibility into validation performance.Changes
Schema version pinning
https://raw.githubusercontent.com/github/gh-aw/v0.41.1/docs/public/schemas/mcp-gateway-config.schema.jsonPerformance metrics
config:validation_schemadebug logger (zero overhead when disabled)Example output with
DEBUG=config:*:Files changed:
internal/config/validation_schema.go(+30, -12)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/tmp/go-build1368616235/b271/launcher.test /tmp/go-build1368616235/b271/launcher.test -test.testlogfile=/tmp/go-build1368616235/b271/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -c=4 -nolocalimports -importcfg /tmp/go-build823456307/b258/importcfg -pack /home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/internal/config/config_core.go /home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/internal/config/config_feature.go conf�� unset TqgVVKUfb .12/x64/bin/as user.email(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build1368616235/b259/config.test /tmp/go-build1368616235/b259/config.test -test.testlogfile=/tmp/go-build1368616235/b259/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go s/internal/fips1--64 64/pkg/tool/linu-o(dns block)nonexistent.local/tmp/go-build1368616235/b271/launcher.test /tmp/go-build1368616235/b271/launcher.test -test.testlogfile=/tmp/go-build1368616235/b271/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -c=4 -nolocalimports -importcfg /tmp/go-build823456307/b258/importcfg -pack /home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/internal/config/config_core.go /home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/internal/config/config_feature.go conf�� unset TqgVVKUfb .12/x64/bin/as user.email(dns block)slow.example.com/tmp/go-build1368616235/b271/launcher.test /tmp/go-build1368616235/b271/launcher.test -test.testlogfile=/tmp/go-build1368616235/b271/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -c=4 -nolocalimports -importcfg /tmp/go-build823456307/b258/importcfg -pack /home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/internal/config/config_core.go /home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/internal/config/config_feature.go conf�� unset TqgVVKUfb .12/x64/bin/as user.email(dns block)this-host-does-not-exist-12345.com/tmp/go-build1368616235/b280/mcp.test /tmp/go-build1368616235/b280/mcp.test -test.testlogfile=/tmp/go-build1368616235/b280/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo 64/src/internal/bytealg/count_am--gdwarf2 ache/go/1.25.6/x64/pkg/tool/linu--64 pull.rebase bis(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>[go-fan] Go Module Review: jsonschema</issue_title>
<issue_description># 🐹 Go Fan Report: santhosh-tekuri/jsonschema
Module Overview
The
github.com/santhosh-tekuri/jsonschemamodule is a comprehensive JSON Schema validation library that supports multiple draft specifications (Draft 4, 6, 7, 2019-09, and 2020-12). It provides fast, spec-compliant validation with excellent error reporting capabilities.Repository: https://github.com/santhosh-tekuri/jsonschema⚠️ Major upgrade available
Current Version: v5.3.1 (April 2024)
Latest Version: v6.0.2 (May 2025)
Stars: 1,200+ | License: Apache 2.0
Current Usage in gh-aw-mcpg
Files & Import Count
This is one of our most heavily used validation modules:
internal/config/validation_schema.go(452 lines) - Core schema validationinternal/config/validation_schema_test.go(696 lines) - Test suiteinternal/config/validation_schema_fetch_test.go(591 lines) - Fetch testsinternal/config/validation_string_patterns_test.go- Pattern testsTotal Impact: 1,739 lines of schema-related code
Key APIs Used
NewCompiler(),compiler.Draft,AddResource(),Compile()schema.Validate(),*ValidationErrortype.CausesfieldUsage Patterns
✅ Excellent Implementation:
sync.Oncefor performancefetchAndFixSchema()function applies regex fixes for Draft 7 limitationsResearch Findings
Recent Updates
The module was last updated December 16, 2025 with validation fixes. The maintainer (santhosh-tekuri) is actively maintaining the project.
Version 6.0.2 Released
A major new version (v6) was released in May 2025 on the
boonbranch with significant improvements:OutputError.String()methodBest Practices from Maintainer
The repository demonstrates:
$refresolution for complex schemasImprovement Opportunities
🏃 Quick Wins
1. Pin Schema Version for Build Reproducibility
Priority: HIGH | Effort: 5 minutes
Current Issue:
The schema URL uses the
mainbranch which can change unexpectedly:Solution:
The code already has a TODO comment about this (lines 32-40 in
validation_schema.go). Pin to a specific version:Benefits:
2. Embed Schema with go:embed
Priority: MEDIUM | Effort: 15 minutes
Current Issue:
Network dependency with 10-second timeout on first validation.
Solution:
Benefits:
3. Add Schema Validation Metrics
Priority: LOW | Effort: 10 minutes
Solution:
Benefits:
✨ Feature Opportunities
Major Opportunity: Upgrade to v6.0.2
Priority: HIGH | Impact: Medium-High | Effort: 2-4 hours
Why Upgrade?
fetchAndFixSchema()function may no longer be needed - v6 might handle negative lookahead patterns nativelyOutputError.String()methodMigration Impact:
Testing Required:
Challenges:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.