-
-
Notifications
You must be signed in to change notification settings - Fork 1
Replace abandoned dependencies gjson and go-supportscolor #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Internal package to replace github.com/tidwall/gjson with stdlib-only implementation. Supports dot-notation paths with array indices (e.g., "data.result.0.value.1").
Replace gjson.Valid with jsonpath.Valid for JSON validation.
Replace gjson with jsonpath for JSON validation and key lookups.
Replace gjson with jsonpath for JSON path queries in HTTP responses.
Replace gjson with jsonpath for parsing Prometheus API responses.
Use golang.org/x/term for TTY detection and add explicit CI environment detection for GitHub Actions, GitLab CI, CircleCI, Travis, Jenkins, Azure Pipelines, Buildkite, TeamCity, Drone, Bitbucket, AWS CodeBuild, and Woodpecker CI. Also adds support for NO_COLOR and CLICOLOR_FORCE standards.
Removed: - github.com/tidwall/gjson (and transitive deps match, pretty) - github.com/jwalton/go-supportscolor golang.org/x/term is now a direct dependency.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
+ Coverage 88.72% 88.99% +0.26%
==========================================
Files 31 32 +1
Lines 1313 1408 +95
==========================================
+ Hits 1165 1253 +88
- Misses 108 113 +5
- Partials 40 42 +2
🚀 New features to boost your workflow:
|
Document all CI systems that are now auto-detected for color support and add new environment variables (CLICOLOR_FORCE, PREFLIGHT_COLOR=0).
Release notes are tracked in GitHub Releases.
Test shouldEnableColor() and isCIEnvironment() to improve coverage.
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.
Summary
Replaces two abandoned/stale dependencies with stdlib-based alternatives:
github.com/tidwall/gjson→ Internalpkg/jsonpathpackage usingencoding/jsongithub.com/jwalton/go-supportscolor→golang.org/x/term+ explicit CI detectionBenefits
NO_COLORandCLICOLOR_FORCEstandardsChanges
New
pkg/jsonpathpackage (~100 lines) providing:Valid(s string) bool- JSON validationGet(json, path string) Result- dot-notation path queriesdata.result.0.value.1)Updated checks to use jsonpath:
pkg/envcheck- JSON validationpkg/jsoncheck- JSON validation and key lookupspkg/httpcheck- JSON path queries in responsespkg/promcheck- Prometheus API response parsingNew color detection in
pkg/output:term.IsTerminal()PREFLIGHT_COLOR,NO_COLOR,CLICOLOR_FORCEsupport