-
Notifications
You must be signed in to change notification settings - Fork 80
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
app/featureset: implement feature flags #446
Conversation
Codecov Report
@@ Coverage Diff @@
## main #446 +/- ##
==========================================
+ Coverage 54.87% 55.01% +0.14%
==========================================
Files 66 70 +4
Lines 6141 6218 +77
==========================================
+ Hits 3370 3421 +51
- Misses 2309 2329 +20
- Partials 462 468 +6
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.
LGTM
|
||
const ( | ||
// QBFTConsensus introduces qbft consensus, see https://github.com/ObolNetwork/charon/issues/445. | ||
QBFTConsensus Feature = "qbft_consensus" |
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 can also have proposer feature here
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.
Can add that in next PR
// state defines the current rollout status of each feature. | ||
state = map[Feature]status{ | ||
QBFTConsensus: statusAlpha, | ||
// Add all features and there status here. |
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.
here too proposer feature with statusAlpha
} | ||
|
||
// Init initialises the global feature set state. | ||
func Init(ctx context.Context, config Config) error { |
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.
so basically minStatus is very important and enabled and disabled are not that important it seems
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.
yup, minStatus
enables/disables different sets of features. While Enable/Disable
is to override individual features
@@ -73,6 +74,11 @@ func TestCmdFlags(t *testing.T) { | |||
Denylist: "", | |||
DBPath: "", | |||
}, | |||
Feature: featureset.Config{ |
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.
nit: add cmd test including enabled and disabled features too so that reader of this code would get more clarity how to use these flags.
Because from the name of these flags it seems that they are boolean flags (like enabled=true/false).
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'll see what I can do
Implement
featureset
package as per design proposal.category: feature
ticket: #381