Merged
Conversation
filipslezaklab
previously requested changes
Mar 9, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds Core-side log capture for proxy/gateway adoption/setup flows so that bounded, in-memory Core logs can be merged into existing component logs and returned to the UI on setup failures, and fixes a gateway wizard invalid-state route.
Changes:
- Introduces a task-local
setup_logsmechanism (CoreSetupLogLayer+scope_setup_logs) to capture bounded Core tracing output during adoption scopes. - Wraps proxy/gateway setup SSE streams to scope Core log capture (including spawned log-reader tasks) and merges captured Core logs into error SSE payloads; enables debug logs for
defguard_core::handlers::component_setup. - Adds integration/unit tests for log delivery/scoping/bounds and prevents
network_id=nullgateway wizard routing by redirecting.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/pages/GatewaySetupPage/GatewaySetupPage.tsx | Redirects away/reset wizard state when network_id is missing to avoid invalid gateway setup API URLs. |
| tools/defguard_generator/src/vpn_session_stats.rs | Minor transaction borrow adjustment while generating VPN session stats. |
| crates/defguard_core/tests/integration/api/mod.rs | Registers new component setup integration tests. |
| crates/defguard_core/tests/integration/api/component_setup.rs | Adds tests for adoption/setup error SSE log inclusion and setup_logs scoping/bounds. |
| crates/defguard_core/src/setup_logs.rs | Adds task-local, bounded Core tracing log capture layer and scoping helper. |
| crates/defguard_core/src/lib.rs | Exposes the new setup_logs module. |
| crates/defguard_core/src/handlers/component_setup.rs | Scopes Core log capture around proxy/gateway setup flows and merges Core logs into error SSE responses. |
| crates/defguard_core/Cargo.toml | Adds tracing-subscriber dependency required by the new log layer. |
| crates/defguard/src/main.rs | Installs CoreSetupLogLayer and enables component_setup debug logging in the main binary. |
| Cargo.lock | Lockfile update for new dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wojcik91
approved these changes
Mar 10, 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.
Related issue: #1925