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

CHEF-7670 Ability to set feature preview flag using ENV #6833

Merged
merged 4 commits into from
Oct 30, 2023
Merged

Conversation

Nik08
Copy link
Contributor

@Nik08 Nik08 commented Oct 26, 2023

Description

Ability to set feature preview flag using ENV. This extends the functionality of the existing Inspec feature subsystem if some feature execution needs to be conditionalised.

Details:
This subsystem uses env_preview: true or env_preview: false, set in the config file etc/features.yaml to determine if a feature is previewable or not.

  • If it is previewable, meaning env_preview: true, then the feature block is only executed if the ENV value CHEF_PREVIEW_#{FEATURE_NAME} is set in the environment.
  • If it is not previewable, meaning env_preview: false, then the feature block is not executed.

In all the other scenarios, the behaviour is unaltered, i.e. it always executes block.

Note
Dev docs for the feature subsystem can be covered separately since a doc on this subsystem does not exist now.
Usage of a feature flag from a user perspective can be updated on a per-feature basis. The first flag will be introduced with PR #6705

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.

Signed-off-by: Nik08 <nikita.mathur@progress.com>
@Nik08 Nik08 requested a review from a team as a code owner October 26, 2023 13:49
@netlify
Copy link

netlify bot commented Oct 26, 2023

Deploy Preview for chef-inspec canceled.

Name Link
🔨 Latest commit dfc56eb
🔍 Latest deploy log https://app.netlify.com/sites/chef-inspec/deploys/653fb27d22bc43000803d60a

etc/features.yaml Outdated Show resolved Hide resolved
etc/features.yaml Outdated Show resolved Hide resolved
Signed-off-by: Nik08 <nikita.mathur@progress.com>
Signed-off-by: Nik08 <nikita.mathur@progress.com>
@Nik08 Nik08 changed the title [W.I.P] CHEF-7670 Ability to set feature flag using ENV CHEF-7670 Ability to set feature flag using ENV Oct 27, 2023
@Nik08 Nik08 changed the title CHEF-7670 Ability to set feature flag using ENV CHEF-7670 Ability to set feature preview flag using ENV Oct 27, 2023
@Nik08 Nik08 added the inspec-6 label Oct 27, 2023
Copy link
Contributor

@clintoncwolfe clintoncwolfe left a comment

Choose a reason for hiding this comment

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

Just want a comment example about the transformation between a feature name and an env var, but other wise looks great!

Signed-off-by: Nik08 <nikita.mathur@progress.com>
@Nik08 Nik08 merged commit 456fa5c into main Oct 30, 2023
7 of 8 checks passed
@Nik08 Nik08 deleted the nm/feature-flag branch October 30, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants