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

Feature Toggles #9254

Closed
pihme opened this issue Apr 29, 2022 · 3 comments · Fixed by #9257
Closed

Feature Toggles #9254

pihme opened this issue Apr 29, 2022 · 3 comments · Fixed by #9257
Assignees
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior version:8.1.0-alpha2 version:8.1.0 Marks an issue as being completely or in parts released in 8.1.0

Comments

@pihme
Copy link
Contributor

pihme commented Apr 29, 2022

Is your feature request related to a problem? Please describe.
We are using feature toggles more frequently now. But there currently is no standardized way to define a feature toggle.

This makes implementing a feature toggle for a certain feature take more effort than necessary.

Describe the solution you'd like

  • Implement a template for feature toggles.
  • Document how to add/use/test a feature toggle

Describe alternatives you've considered
Adding https://www.togglz.org/quickstart.html as a dependency. However, this doesn't integrate nicely with what we have already. Also it would add a number of transitive dependencies.

Additional context
Add any other context or screenshots about the feature request here.

@pihme pihme added the kind/feature Categorizes an issue or PR as a feature, i.e. new behavior label Apr 29, 2022
@pihme
Copy link
Contributor Author

pihme commented Apr 29, 2022

Implementation Approach

  • Add a new class FeatureToggleCfg as child of ExperimentalCfg
  • Feature toggles are boolean settings pretty much copied from ConsistencyCheckCfg
  • Add documentation to config templates, add JavaDoc comments to explain how to add a feature toggle

This assumes that feature toggles are only temporary (that's why it's under experimental configuration)

@npepinpe
Copy link
Member

Looks good to me. What would that look like in practice?

zeebe:
  broker:
    experimental:
      features:
        myCoolFeature: false

or

zeebe:
  broker:
    experimental:
      flags:
        myCoolFeatureFlag: false

So all environment variables would also be something like ZEEBE_BROKER_EXPERIMENTAL_FLAGS_MYCOOLFEATUREFLAG or the likes?

@pihme
Copy link
Contributor Author

pihme commented Apr 29, 2022

Don't know yet. I guess we will finalize that in the review :-)

@pihme pihme self-assigned this Apr 29, 2022
zeebe-bors-camunda bot added a commit that referenced this issue May 2, 2022
9257: feat(broker): add feature flag template r=pihme a=pihme

## Description

Adds template to add feature flags. The template consists of two parts:
* `FeatureFlags` to hold the flags and default values. Visible in most of the code base
* `FeatureFlagsCfg` to make feature flags configurable. Instances of this class can be used to obtain a `FeatureFlags` object

## Review Hints
* I did try to implement reflection based tests to check that e.g. the cfg object and the feature flags object have the same getters, and that values are passed in correctly. However, this spiraled out of control into a big chunk of over-engineered tests. So I dropped these completely
* Secondly there are often config tests like `ExperimentalCfgTest` not sure if these add value. Let me know if you miss them as part of the template
* Overall, this is a minimal implementation. Please let me know if you want to change any names or such things.

## Related issues

closes #9254



Co-authored-by: pihme <pihme@users.noreply.github.com>
zeebe-bors-camunda bot added a commit that referenced this issue May 3, 2022
9274: [Backport stable/8.0] feat(broker): add feature flag template r=pihme a=github-actions[bot]

# Description
Backport of #9257 to `stable/8.0`.

relates to #9254

Co-authored-by: pihme <pihme@users.noreply.github.com>
zeebe-bors-camunda bot added a commit that referenced this issue May 3, 2022
9274: [Backport stable/8.0] feat(broker): add feature flag template r=pihme a=github-actions[bot]

# Description
Backport of #9257 to `stable/8.0`.

relates to #9254

Co-authored-by: pihme <pihme@users.noreply.github.com>
@Zelldon Zelldon added the version:8.1.0 Marks an issue as being completely or in parts released in 8.1.0 label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior version:8.1.0-alpha2 version:8.1.0 Marks an issue as being completely or in parts released in 8.1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants