Conversation
Resolve conflicts in favor of the branch: keep the backoffice feature-flags service, its wiring and tests, which the revert on main (676deb0) had removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolve conflicts in favor of the branch: keep the backoffice feature-flags service, its wiring and tests, which the revert on main (676deb0) had removed.
…to feat-SUP-868
…t-SUP-868 # Conflicts: # package-lock.json # package.json
Recreate feat-SUP-829
# Conflicts: # ENV_VARIABLES.md # src/__tests__/unit/features.controller.unit.ts # src/__tests__/unit/services/backoffice-feature-flags.service.unit.ts # src/controllers/features.controller.ts # src/services/backoffice-feature-flags.service.ts
feat: wallet supportedBrowsers from backoffice flags [SUP-868]
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a Backoffice integration that fetches and merges remotely managed feature flags (and provider/pairs availability) into the existing /features endpoint response, alongside a minor Node typing update and accompanying documentation/tests.
Changes:
- Added
BackofficeFeatureFlagsServiceto fetch/cache backoffice flags and merge them into locally stored features. - Wired the new service into dependency injection and
FeaturesController.get()so/featurescan include backoffice-driven flags/providers. - Added unit tests and documented new environment variables; bumped package version and updated
@types/node.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/index.ts | Re-exports the new backoffice feature flags service. |
| src/services/daemon.service.ts | Updates interval type to NodeJS.Timeout for modern Node typings. |
| src/services/backoffice-feature-flags.service.ts | Implements backoffice flag retrieval, caching, parsing, and feature merging logic. |
| src/dependency-injection-handler.ts | Registers BackofficeFeatureFlagsService as a singleton binding. |
| src/dependency-injection-bindings.ts | Adds a DI binding key for the backoffice flags service. |
| src/controllers/features.controller.ts | Calls backoffice service and merges returned flags/providers into /features output. |
| src/tests/unit/services/backoffice-feature-flags.service.unit.ts | Adds unit coverage for flag/provider retrieval, caching, and merge rules. |
| src/tests/unit/features.controller.unit.ts | Extends controller unit tests to cover merged backoffice flags/providers behavior. |
| package.json | Bumps version to 4.1.0 and updates @types/node (Node engine already >=20). |
| package-lock.json | Updates lockfile to match the new version and @types/node resolution. |
| ENV_VARIABLES.md | Documents backoffice-related environment variables and /features merge semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
69
to
75
| features = await this.featuresDatService.getAll(); | ||
| responseCode = this.HTTP_SUCCESS_OK; | ||
| const backofficeFlags = await this.backofficeFeatureFlagsService.getProviderFlags(); | ||
| if (backofficeFlags) { | ||
| features = applyProviderFlags(features, backofficeFlags); | ||
| } | ||
| this.logger.info({method: 'get', featureCount: features.length}, 'Retrieved the features'); |
Comment on lines
+4
to
+16
| /** Any JSON value the backoffice can hold for a flag, except null. */ | ||
| export type FlagValue = boolean | string | number | Record<string, unknown> | unknown[]; | ||
|
|
||
| export type ProviderFlags = Record<string, FlagValue>; | ||
|
|
||
| /** | ||
| * A feature as `/features` serves it: the stored shape, widened to the flag | ||
| * values the backoffice can hold, plus the pairs of a provider. | ||
| */ | ||
| export type MergedFeature = Omit<FeaturesDbDataModel, 'value'> & { | ||
| value: FlagValue; | ||
| pairs?: ProviderPair[]; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.