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

SIMSBIOHUB-79: Feature Flag Guard #1219

Merged
merged 15 commits into from
Jul 18, 2024
Merged

SIMSBIOHUB-79: Feature Flag Guard #1219

merged 15 commits into from
Jul 18, 2024

Conversation

NickPhura
Copy link
Collaborator

@NickPhura NickPhura commented Feb 23, 2024

Links to Jira Tickets

(must have been deleted or removed)

Description of Changes

Adds a new env var FEATURE_FLAGS which is a general purpose flag variable that can be used to disable frontend or backend features as needed.

APP

Adds a new type of guard that uses the FEATURE_FLAGS vars to disable child components.

The guard can be used to wrap components, which will be rendered as normal unless feature flags are specified and at least one matching flag is defined in the associated env var.

Replaced the REACT_APP_BIOHUB_FEATURE_FLAG with a new feature flag: APP_FF_SUBMIT_BIOHUB

API

Included the feature flags in the api pipeline/docker-compose as well, and added some helper util functions for working with the feature flag env var.

Replaced the BACKBONE_INTAKE_ENABLED with a new feature flag: API_FF_SUBMIT_BIOHUB

Testing Notes

Ex: If you set the FEATURE_FLAGS var in .env to FEATURE_FLAGS=APP_FF_SUBMIT_BIOHUB the publish button should be hidden from the UI.

Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 56.45%. Comparing base (ce90f56) to head (c7de391).

Files Patch % Lines
app/src/contexts/configContext.tsx 28.57% 5 Missing ⚠️
app/src/components/security/Guards.tsx 81.81% 1 Missing and 1 partial ⚠️
app/src/hooks/useBioHubApi.ts 0.00% 2 Missing ⚠️
app/src/hooks/useCritterbaseApi.ts 0.00% 2 Missing ⚠️
app/src/hooks/useTelemetryApi.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1219      +/-   ##
==========================================
+ Coverage   56.43%   56.45%   +0.01%     
==========================================
  Files         576      577       +1     
  Lines       17626    17645      +19     
  Branches     2745     2749       +4     
==========================================
+ Hits         9948     9962      +14     
- Misses       7014     7018       +4     
- Partials      664      665       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-commenter
Copy link

codecov-commenter commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 72.97297% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 53.29%. Comparing base (c5b0c6d) to head (d157889).

Files Patch % Lines
app/src/contexts/configContext.tsx 28.57% 5 Missing ⚠️
app/src/components/security/Guards.tsx 81.81% 1 Missing and 1 partial ⚠️
app/src/hooks/useTelemetryApi.ts 0.00% 2 Missing ⚠️
app/src/hooks/useCritterbaseApi.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1219      +/-   ##
==========================================
+ Coverage   53.26%   53.29%   +0.02%     
==========================================
  Files         547      548       +1     
  Lines       16237    16256      +19     
  Branches     2519     2523       +4     
==========================================
+ Hits         8649     8663      +14     
- Misses       7007     7011       +4     
- Partials      581      582       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NickPhura NickPhura added the Not Ready For Review Addressing feedback and/or refactoring label Mar 1, 2024
@NickPhura NickPhura added Do Not Merge PR should not be merged Early Feedback Welcome PR is not finished, but early review feedback is welcomed and removed Not Ready For Review Addressing feedback and/or refactoring labels Mar 11, 2024
@NickPhura NickPhura added Ready For Review PR is ready for review Early Feedback Welcome PR is not finished, but early review feedback is welcomed and removed Do Not Merge PR should not be merged Early Feedback Welcome PR is not finished, but early review feedback is welcomed Ready For Review PR is ready for review labels Mar 18, 2024
@NickPhura NickPhura added Ready For Review PR is ready for review and removed Early Feedback Welcome PR is not finished, but early review feedback is welcomed labels Apr 9, 2024
@NickPhura NickPhura marked this pull request as ready for review April 9, 2024 17:02
@NickPhura NickPhura requested a review from MacQSL April 9, 2024 17:02
Copy link

sonarcloud bot commented Apr 9, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@NickPhura NickPhura removed the Ready For Review PR is ready for review label Apr 26, 2024
@NickPhura NickPhura marked this pull request as draft May 30, 2024 23:42
@MacQSL MacQSL marked this pull request as ready for review July 17, 2024 18:01
Copy link

sonarcloud bot commented Jul 17, 2024

Copy link
Collaborator

@MacQSL MacQSL left a comment

Choose a reason for hiding this comment

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

S H I P I T

@NickPhura NickPhura merged commit f628082 into dev Jul 18, 2024
20 checks passed
@NickPhura NickPhura deleted the SIMSBIOHUB-79 branch July 18, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants