ValidationScheme implements pflag.Value and json.Marshaler/Unmarshaler interfaces#807
Merged
aknuds1 merged 3 commits intoprometheus:mainfrom Aug 25, 2025
Merged
Conversation
70453fd to
06cb330
Compare
aknuds1
previously requested changes
Jul 31, 2025
06cb330 to
8454829
Compare
…er/Unmarshaler interfaces Signed-off-by: Julius Hinze <[email protected]>
8454829 to
2e9eb8f
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements the pflag.Value and json.Marshaler/Unmarshaler interfaces for the ValidationScheme type, enabling it to be used as a command-line flag and for JSON serialization/deserialization.
- Adds JSON marshaling/unmarshaling methods for
ValidationScheme - Implements
pflag.Valueinterface withSet()andType()methods - Refactors existing YAML unmarshaling to use the new
Set()method
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| model/metric.go | Implements JSON and pflag interfaces, refactors YAML unmarshaling |
| model/metric_test.go | Adds comprehensive test coverage for JSON marshaling and pflag Set method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
aknuds1
requested changes
Aug 25, 2025
Contributor
aknuds1
left a comment
There was a problem hiding this comment.
LGTM, except for a couple of superfluous casts.
Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
aknuds1
approved these changes
Aug 25, 2025
4 tasks
juliusmh
added a commit
to grafana/mimir
that referenced
this pull request
Aug 26, 2025
…etheus/common/model.ValidationScheme (#12505) <!-- Thanks for sending a pull request! Before submitting: 1. Read our CONTRIBUTING.md guide 2. Rebase your PR if it gets out of sync with main --> #### What this PR does Removes unnecessary `validation.ValidationSchemeValue` because prometheus/common#807 was merged. #### Checklist - [x] Tests updated. - [ ] Documentation added. - [ ] `CHANGELOG.md` updated - the order of entries should be `[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If changelog entry is not needed, please add the `changelog-not-needed` label to the PR. - [ ] [`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md) updated with experimental features.
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.
No description provided.