fix(backend-api7): include plugins when dumping stream_route#452
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughToADC.transformStreamRoute now preserves the ChangesStream Route Plugins Fix
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
ToADC.transformStreamRoute dropped the plugins field, so dumping/fetching a stream_route from the API7 backend always returned it without plugins. The differ then saw the remote stream_route as plugin-less: adding plugins was detected (local has, remote empty) but REMOVING the last plugins was not (local empty == remote empty), leaving stale stream-route plugins on the gateway. FromADC.transformStreamRoute already writes plugins, so the read path was asymmetric. Map plugins in the dump direction too, mirroring transformRoute.
Adds an e2e spec that syncs a stream service + stream route carrying an ip-restriction plugin, dumps, and asserts the plugin survives the round-trip (this fails without the transformer fix), then removes the plugin and asserts the dump reflects it. Covers the full sync -> dump -> verify flow against a real backend.
528dfcd to
27491a0
Compare
Problem
ToADC.transformStreamRoute(the dump / read direction) drops thepluginsfield, while
FromADC.transformStreamRoute(the write direction) keeps it.So dumping a stream route from the API7 backend always returns it without
plugins.
The differ relies on the dumped remote state to know the current plugins. With
plugins missing from the dump:
empty), so stale stream-route plugins are left on the gateway ✗
Fix
Map
pluginsinToADC.transformStreamRoute, mirroringtransformRouteandthe write-direction
FromADC.transformStreamRoute.Verification
Added
libs/backend-api7/test/transformer.spec.ts. Confirmed by running it bothways:
ToADC.transformStreamRoute preserves pluginsfails(
Received: undefined)Full
backend-api7(20) anddiffer(31) unit suites pass.Summary by CodeRabbit
Bug Fixes
Tests