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

feat: extend BFF feature flag to take into account Waffle flag #1239

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

adamstankiewicz
Copy link
Member

CHANGELOG

  • Extends the checks for whether the BFF is enabled for the customer/user to take into account the new enterprise.learner_bff_enabled Waffle flag exposed via the enterprise-learner REST API from the LMS in its serialized enterprise_features object.
    • If BFF is enabled for the specific enterprise customer, use the BFF.
    • If the enterprise.learner_bff_enabled Waffle flag is true for the user, use the BFF. This addition enables an incremental percentage based rollout to other enterprise learners beyond the learners explicitly opted in via the enterprise customer's configuration.
    • Otherwise, don't use the BFF in favor of the legacy/granular API calls.
  • Updates tests to account for Waffle-based feature flag.
  • Removes import React throughout codebase.

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)
  • Ensure English strings are marked for translation. See documentation for more details.

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.99%. Comparing base (3702531) to head (ce436da).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/components/site-header/menu/Menu.jsx 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1239      +/-   ##
==========================================
- Coverage   89.05%   88.99%   -0.07%     
==========================================
  Files         401      402       +1     
  Lines        8708     8721      +13     
  Branches     2123     2125       +2     
==========================================
+ Hits         7755     7761       +6     
- Misses        912      918       +6     
- Partials       41       42       +1     

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

Copy link
Member

@brobro10000 brobro10000 left a comment

Choose a reason for hiding this comment

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

Great job tackling the removal of all the React imports. One minor optional nit on coverage. Approved 👍🏽

export default function useIsBFFEnabled() {
const { data: enterpriseCustomer } = useEnterpriseCustomer();
const { data: enterpriseFeatures } = useEnterpriseFeatures();
return isBFFEnabled(enterpriseCustomer.uuid, enterpriseFeatures);
Copy link
Member

Choose a reason for hiding this comment

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

[nit/optional] I know tests already exist for the isBFFEnabled function, but because we have a new hook wrapping it, maybe just refactoring those tests to test for this hooks wrapper instead should pick this line up for coverage.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yeah. Didn't see this was missing coverage. Will account for it in tests before merging. Thanks!

@adamstankiewicz adamstankiewicz merged commit dd0cb8d into master Dec 18, 2024
4 of 6 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/extend-bff-feature-flags branch December 18, 2024 15:13
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.

2 participants