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

refactor: to remove query to load menu feature toggles #3578

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

tdeekens
Copy link
Contributor

@tdeekens tdeekens commented Aug 5, 2024

Summary

This removes the query to load all menu feature toggles.

Description

Internal applications can be hidden on demand. This can be due to them not being available across all clouds mostly. As applications pass flags of their interest to LD, so that we don't load all flags, we need to pass flags of other applications (not viewed) to LD too so that they're included in the response.

For this, each application (mostly internals) can declare a featureToggle property on their menu.json. This query (in a service) then walks over all internal applications and aggregates those feature toggles by name. These are then passed on to LaunchDarkly, so that LD includes them when building up its flag subscription.

When adopting feature flagging we first only relied on LD but soon after build more long-lived feature configuration flags into an internal API exposed using the allFeatures query. We then recommended to use this to enable/disable applications instead of using LD.

Currently, all teams use the allFeatures query to enable/disable applications across environments or projects (during rollout). No team uses, or intends to, use LD for this. In addition with using lazy caching with LD it becomes less interesting to use LD as flag rule changes don't affect running applications instantly any more.

As a result we can remove this query entirely. Saving us a query at boot time of the application. It also lowers the options to hide applications. Internally we will also adopt an enableApplication* pattern for features returned from allFeature to make clear if a feature targets an entire application.

Note, as a follow-up the query will be deprecated in the API and return an empty array.

@tdeekens tdeekens requested a review from a team as a code owner August 5, 2024 08:32
Copy link

vercel bot commented Aug 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mc-app-kit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2024 8:44am
merchant-center-application-kit-components-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2024 8:44am

Copy link

changeset-bot bot commented Aug 5, 2024

🦋 Changeset detected

Latest commit: 06a67ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@commercetools-frontend/application-shell Patch
@commercetools-frontend/cypress Patch
@commercetools-applications/merchant-center-template-starter-typescript Patch
@commercetools-applications/merchant-center-template-starter Patch
@commercetools-applications/merchant-center-custom-view-template-starter-typescript Patch
@commercetools-applications/merchant-center-custom-view-template-starter Patch
@commercetools-local/playground Patch
@commercetools-local/visual-testing-app Patch
@commercetools-backend/eslint-config-node Patch
@commercetools-backend/express Patch
@commercetools-backend/loggers Patch
@commercetools-frontend/actions-global Patch
@commercetools-frontend/application-components Patch
@commercetools-frontend/application-config Patch
@commercetools-frontend/application-shell-connectors Patch
@commercetools-frontend/assets Patch
@commercetools-frontend/babel-preset-mc-app Patch
@commercetools-frontend/browser-history Patch
@commercetools-frontend/codemod Patch
@commercetools-frontend/constants Patch
@commercetools-frontend/create-mc-app Patch
@commercetools-frontend/eslint-config-mc-app Patch
@commercetools-frontend/i18n Patch
@commercetools-frontend/jest-preset-mc-app Patch
@commercetools-frontend/jest-stylelint-runner Patch
@commercetools-frontend/l10n Patch
@commercetools-frontend/mc-dev-authentication Patch
@commercetools-frontend/mc-html-template Patch
@commercetools-frontend/mc-scripts Patch
@commercetools-frontend/notifications Patch
@commercetools-frontend/permissions Patch
@commercetools-frontend/react-notifications Patch
@commercetools-frontend/sdk Patch
@commercetools-frontend/sentry Patch
@commercetools-frontend/url-utils Patch
@commercetools-website/components-playground Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

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

💯

@tdeekens tdeekens merged commit 839d185 into main Aug 5, 2024
17 of 19 checks passed
@tdeekens tdeekens deleted the td/remove-menu-feature-toggle-query branch August 5, 2024 09:16
@ct-changesets ct-changesets bot mentioned this pull request Aug 5, 2024
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