Skip to content

feat: merge backoffice provider flags into /features [SUP-829] - #475

Merged
Dominikkq merged 4 commits into
mainfrom
feat-SUP-829
Aug 6, 2026
Merged

feat: merge backoffice provider flags into /features [SUP-829]#475
Dominikkq merged 4 commits into
mainfrom
feat-SUP-829

Conversation

@Dominikkq

Copy link
Copy Markdown
Contributor

What:

Fetches the provider flags (FLYOVER, UNION_BRIDGE, POWPEG) from the
backoffice API and merges them into /features as
flyover/union_bridge/powpeg (enabled/disabled).

  • New 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).
  • Bumps @types/node 16 → 20 for native fetch types.
  • Unit-tested and verified against a live backoffice; existing /features
    consumers unaffected.

Task:
SUP-829

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/@types/node 20.19.43 🟢 6.6
Details
CheckScoreReason
Code-Review🟢 9Found 28/29 approved changesets -- score normalized to 9
Maintained🟢 1030 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Signed-Releases⚠️ -1no releases found
License🟢 9license file detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing⚠️ 0project is not fuzzed

Scanned Files

  • package-lock.json

@Dominikkq
Dominikkq marked this pull request as ready for review August 3, 2026 12:44
@Dominikkq
Dominikkq requested review from alexjavabraz, annipi, lserra-iov, ronaldsg20 and spoletijuan and removed request for annipi and lserra-iov August 3, 2026 12:45
@lserra-iov
lserra-iov requested a review from Copilot August 3, 2026 18:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 BackofficeFeatureFlagsService to authenticate to Backoffice, fetch provider flags, and cache them with stale-while-revalidate behavior.
  • Merges FLYOVER/UNION_BRIDGE/POWPEG into /features as flyover/union_bridge/powpeg with enabled/disabled, and wires the new service via DI.
  • Updates Node type definitions (for native fetch typings), 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.

Comment thread src/services/backoffice-feature-flags.service.ts Outdated
@Dominikkq
Dominikkq requested a review from lserra-iov August 4, 2026 09:53
export type ProviderFlags = Record<ProviderFlagKey, boolean>;

const BROWSERS: (keyof SupportedBrowsers)[] = [
'chrome', 'firefox', 'safari', 'edge', 'brave', 'chromium', 'opera',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't need to hard-code these values. We want to configure this and receive it from feature flags.

Comment thread package.json
"@types/bs58": "^4.0.1",
"@types/nock": "^10.0.3",
"@types/node": "^16.18.50",
"@types/node": "^20.19.43",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Will this impact CI/CD?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, its type definitions only, just because old @types/node 16 didn't have native fetch typings

Comment thread src/services/backoffice-feature-flags.service.ts Outdated

@alexjavabraz alexjavabraz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Dominikkq
Dominikkq merged commit 0df7500 into main Aug 6, 2026
6 checks passed
@Dominikkq
Dominikkq deleted the feat-SUP-829 branch August 6, 2026 09:01
@annipi annipi mentioned this pull request Aug 6, 2026
annipi added a commit that referenced this pull request Aug 6, 2026
@lserra-iov
lserra-iov restored the feat-SUP-829 branch August 6, 2026 20:31
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.

5 participants