feat: merge backoffice provider flags into /features [SUP-829] - #475
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
Dominikkq
marked this pull request as ready for review
August 3, 2026 12:44
Dominikkq
requested review from
alexjavabraz,
annipi,
lserra-iov,
ronaldsg20 and
spoletijuan
and removed request for
annipi and
lserra-iov
August 3, 2026 12:45
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional Backoffice integration that fetches provider availability flags and merges them into the existing /features response without changing existing consumers’ contract.
Changes:
- Introduces
BackofficeFeatureFlagsServiceto authenticate to Backoffice, fetch provider flags, and cache them with stale-while-revalidate behavior. - Merges
FLYOVER/UNION_BRIDGE/POWPEGinto/featuresasflyover/union_bridge/powpegwithenabled/disabled, and wires the new service via DI. - Updates Node type definitions (for native
fetchtypings), adds unit tests, and documents new env vars.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/index.ts | Re-exports the new Backoffice flags service. |
| src/services/daemon.service.ts | Updates timer typing to NodeJS.Timeout for Node 20 types. |
| src/services/backoffice-feature-flags.service.ts | Implements Backoffice login + flag retrieval + SWR cache and feature-merge helper. |
| src/dependency-injection-handler.ts | Binds BackofficeFeatureFlagsService as a singleton in LoopBack DI. |
| src/dependency-injection-bindings.ts | Adds DI binding key for the new service. |
| src/controllers/features.controller.ts | Calls Backoffice flags service and merges provider flags into /features output. |
| src/tests/unit/services/backoffice-feature-flags.service.unit.ts | Adds unit coverage for caching/relogin/error fallback and merge behavior. |
| src/tests/unit/features.controller.unit.ts | Extends controller tests to validate merged flags and fallback behavior. |
| package.json | Bumps @types/node to v20 for native fetch typings. |
| package-lock.json | Lockfile updates aligned with @types/node bump. |
| ENV_VARIABLES.md | Documents new BACKOFFICE_* env vars and behavior. |
lserra-iov
reviewed
Aug 3, 2026
alexjavabraz
reviewed
Aug 4, 2026
| export type ProviderFlags = Record<ProviderFlagKey, boolean>; | ||
|
|
||
| const BROWSERS: (keyof SupportedBrowsers)[] = [ | ||
| 'chrome', 'firefox', 'safari', 'edge', 'brave', 'chromium', 'opera', |
Collaborator
There was a problem hiding this comment.
Don't need to hard-code these values. We want to configure this and receive it from feature flags.
alexjavabraz
reviewed
Aug 4, 2026
| "@types/bs58": "^4.0.1", | ||
| "@types/nock": "^10.0.3", | ||
| "@types/node": "^16.18.50", | ||
| "@types/node": "^20.19.43", |
Collaborator
There was a problem hiding this comment.
Will this impact CI/CD?
Contributor
Author
There was a problem hiding this comment.
No, its type definitions only, just because old @types/node 16 didn't have native fetch typings
alexjavabraz
reviewed
Aug 4, 2026
annipi
approved these changes
Aug 5, 2026
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.
What:
Fetches the provider flags (
FLYOVER,UNION_BRIDGE,POWPEG) from thebackoffice API and merges them into
/featuresasflyover/union_bridge/powpeg(enabled/disabled).BackofficeFeatureFlagsService: session login, re-login on 401,stale-while-revalidate cache (60s TTL), serves last known values if the
backoffice is down. Disabled unless
BACKOFFICE_*env vars are set(see
ENV_VARIABLES.md).@types/node16 → 20 for nativefetchtypes./featuresconsumers unaffected.
Task:
SUP-829