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 toggled specs #11821

Merged
merged 2 commits into from
Nov 22, 2023
Merged

Conversation

mkllnk
Copy link
Member

@mkllnk mkllnk commented Nov 17, 2023

What? Why?

I'm introducing a new tag to activate a feature for certain spec blocks. And it checks that the feature is actually defined in the code base. This could have prevented:

There's nothing to enforce the use of this helper tag and therefore user error is still possible, just less likely. We do need the original version of Flipper.enable to test our feature toggle logic but in most cases we can just use the new tag.

What should we test?

  • Specs only.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@mkllnk mkllnk added the technical changes only These pull requests do not contain user facing changes and are grouped in release notes label Nov 17, 2023
@mkllnk mkllnk self-assigned this Nov 17, 2023
@mkllnk mkllnk force-pushed the feature-toggled-specs branch from ddc1ce7 to f905967 Compare November 17, 2023 00:57
@mkllnk mkllnk marked this pull request as ready for review November 17, 2023 00:57
It's simple this way and we have one place to add logic to when needed
(see next commit).
There was one case where a typo meant that the desired feature wasn't
active and tests were not testing the right code path. Using this new
syntax should prevent that.

* openfoodfoundation#11705
@mkllnk mkllnk force-pushed the feature-toggled-specs branch from f905967 to 6f3bee7 Compare November 17, 2023 02:19
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition !

Copy link
Contributor

@filipefurtad0 filipefurtad0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🎉

I've tested this PR locally a bit and was able to trigger the error and enable one or more features for a given test group by adding, for example, feature: :invoices, feature: :admin_style_v3 👍

@mkllnk mkllnk merged commit e16429b into openfoodfoundation:master Nov 22, 2023
50 checks passed
@mkllnk mkllnk deleted the feature-toggled-specs branch November 22, 2023 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical changes only These pull requests do not contain user facing changes and are grouped in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants