Skip to content
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

Merged
merged 4 commits into from
Apr 27, 2022
Merged

Conversation

corverroos
Copy link
Contributor

Implement featureset package as per design proposal.

category: feature
ticket: #381

@codecov
Copy link

codecov bot commented Apr 26, 2022

Codecov Report

Merging #446 (124a871) into main (cad0218) will increase coverage by 0.14%.
The diff coverage is 66.17%.

@@            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     
Impacted Files Coverage Δ
app/app.go 63.31% <0.00%> (-0.57%) ⬇️
app/featureset/status_string.go 50.00% <50.00%> (ø)
app/featureset/config.go 67.30% <67.30%> (ø)
app/featureset/featureset.go 100.00% <100.00%> (ø)
cmd/run.go 100.00% <100.00%> (ø)
app/lifecycle/hook.go 65.43% <0.00%> (ø)
app/lifecycle/manager.go 90.47% <0.00%> (+15.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cad0218...124a871. Read the comment docs.

Copy link
Contributor

@dB2510 dB2510 left a 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"
Copy link
Contributor

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

Copy link
Contributor Author

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.
Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor Author

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{
Copy link
Contributor

@dB2510 dB2510 Apr 27, 2022

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).

Copy link
Contributor Author

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

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Apr 27, 2022
@obol-bulldozer obol-bulldozer bot merged commit 1b9ce88 into main Apr 27, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/featureset branch April 27, 2022 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants