logproto: Add deprecated annotation to LegacySample and LegacyLabelPair #5454
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.
Signed-off-by: Paschalis Tsilias [email protected]
What this PR does / why we need it:
The PR adds a docstring to those two messages, to discourage accidental use.
The changes were just
a) Adding a docstring on the LegacySample and LegacyLabelPair messages
b) Run
make protos
Basically just familiarizing myself with the contributing process for Loki :)
Which issue(s) this PR fixes:
Fixes #5312
Special notes for your reviewer:
I initially tried adding an option like
option deprecated = true;
or a comment like// Deprecated: Use Sample instead
, as I thought that this might translate better for other languages' proto compilers.Unfortunately, both these approaches trip staticheck, which complains about using a deprecated struct in tests and code. From its source, it seems that it will flag all structs where there's a docstring line with the prefix
Deprecated:
.So instead of littering the codebase with annotations such as
//nolint:staticcheck // Ignore SA1019 for deprecated fields
, I opted for a more generic annotation.The drawback is that it wouldn't autogenerate language-specific deprecation notices for other proto compilers (like
@Deprecated
in Java). Would you be okay with that?Also, I'm not sure if this warrants a change in the changelog or documentation (I'd say no), but let me know if you think otherwise.
Checklist
CHANGELOG.md
about the changes. (N/A)