-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Update flags API #5602
Update flags API #5602
Conversation
@bogdandrutu @dmitryax is this what you had in mind with #5443? This implementation is currently a breaking change to show final state, but I think we'd need to handle deprecating HasFlag and the original constructor. |
Codecov Report
@@ Coverage Diff @@
## main #5602 +/- ##
==========================================
- Coverage 91.77% 91.53% -0.24%
==========================================
Files 192 192
Lines 11376 11456 +80
==========================================
+ Hits 10440 10486 +46
- Misses 742 776 +34
Partials 194 194
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
What should the strategy be to make this backwards compatible? The |
If too hard we can do an exception, otherwise a 2 step process is preferred, add a |
Done |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Not stale, waiting for @bogdandrutu to return from PTO. |
@bogdandrutu ready for another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the final state that I envisioned, the problem is that we need to do this in multiple steps and deprecate things first.
@@ -489,6 +493,15 @@ var exemplar = &messageValueStruct{ | |||
}, | |||
} | |||
|
|||
var dataPointFlagsFieldStruct = &messageValueField{ | |||
fieldName: "FlagsStruct", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open to suggestions on this name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing Flags()
api doesn't actually show as deprecated when used bc it auto-generated code. Is that ok or should we flag it and point people to FlagsStruct
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should mark that as deprecated, otherwise cannot expect people to change. We can do that in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
@@ -489,6 +493,15 @@ var exemplar = &messageValueStruct{ | |||
}, | |||
} | |||
|
|||
var dataPointFlagsFieldStruct = &messageValueField{ | |||
fieldName: "FlagsStruct", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable.
@@ -489,6 +493,15 @@ var exemplar = &messageValueStruct{ | |||
}, | |||
} | |||
|
|||
var dataPointFlagsFieldStruct = &messageValueField{ | |||
fieldName: "FlagsStruct", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should mark that as deprecated, otherwise cannot expect people to change. We can do that in a separate PR.
Description:
This PR updates the Flags API to hide all references to the Flags themselves. Instead, setting flags and checking if a flag is set is handled via functions that know about the flag being set/checked.
Link to tracking Issue:
Fixes #5443
Testing:
Updated unit tests