Skip to content

refactor(backend): land backend refactor stack#4747

Draft
robertsLando wants to merge 6 commits into
masterfrom
backend-refactor
Draft

refactor(backend): land backend refactor stack#4747
robertsLando wants to merge 6 commits into
masterfrom
backend-refactor

Conversation

@robertsLando

Copy link
Copy Markdown
Member

Draft. Landing PR for the backend refactor stack (umbrella: #4722). This aggregates the linear stack staged on the backend-refactor integration branch and is the surface where the cumulative diff gets reviewed as one unit and where issue-closure actually fires.

Do not merge until the full stack (#4723#4742) has landed on backend-refactor and this PR reflects the complete change. Review order, tiering and the merge train are tracked in #4745.

Why this PR exists

The stack merges PR-by-PR into backend-refactor, not into master. Closing keywords on those sub-PRs are inert (they target a non-default branch, so GitHub never creates the links) and do not replay when this branch lands. This PR — which does target the default branch — is the only place a Closes keyword works.

Issue closure

Before marking ready for review

Closes #4722

Adds HTTP contract coverage before the backend is decomposed.

- Locks the 35 routes’ authentication, response shapes,
status/header/stream behavior, and side effects.
- Keeps production routing unchanged behind a minimal app-construction
seam.
- Review focus: contract fidelity and assertions that target application
behavior rather than harness mechanics.

Part of #4722. Stack root on `backend-refactor`.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: robertsLando <daniel.sorridi@gmail.com>
@coveralls

coveralls commented Jul 15, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29563628241

Coverage increased (+30.1%) to 38.102%

Details

  • Coverage increased (+30.1%) from the base build.
  • Patch coverage: 212 uncovered changes across 7 files (810 of 1022 lines covered, 79.26%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
api/app.ts 845 658 77.87%
api/lib/ZnifferManager.ts 19 6 31.58%
api/lib/Gateway.ts 22 19 86.36%
api/lib/MqttClient.ts 12 9 75.0%
api/bin/www.ts 2 0 0.0%
api/lib/BackupManager.ts 9 7 77.78%
api/lib/DebugManager.ts 9 7 77.78%
Total (16 files) 1022 810 79.26%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 6720
Covered Lines: 2739
Line Coverage: 40.76%
Relevant Branches: 4353
Covered Branches: 1480
Branch Coverage: 34.0%
Branches in Coverage %: Yes
Coverage Strength: 24.0 hits per line

💛 - Coveralls

@robertsLando

Copy link
Copy Markdown
Member Author

cc @AlCalzone here we can keep track of the issues closed by this otherwise marging prs into this branch want close the issues

AlCalzone and others added 4 commits July 16, 2026 11:45
Locks the current Socket.IO and dynamic Z-Wave API wire behavior before
backend handlers and classes are split.

- Review the real HTTP/Socket.IO harness isolation and test-only
`createApp()` hooks.
- Verify the seven inbound and 24 outbound event contracts, ACK
envelopes, authentication fallback, room routing, producer payloads, and
timing.
- Confirm the complete `allowedApis`/`callApi()` compatibility surface,
including underscore-prefixed APIs and preserved wire quirks, without
consumer changes.

Stacked on #4723. Part of #4722.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Locks both Home Assistant integrations before they are moved.

- Covers legacy MQTT discovery, custom-device loading, persistence, and
`@zwave-js/server` lifecycle behavior.
- Preserves existing topic, payload, cache, and startup-order quirks.
- Review focus: whether fixtures describe production contracts rather
than fake or helper behavior.

Part of #4722. Stacked on #4724.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

fix(config): validate nullable and incomplete persisted settings feat: backend refactor

3 participants