Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/application/confgen/generator.go`:
- Around line 194-203: deriveClientTunName currently treats settings.WSS as
unsupported which breaks deriveClientSettings for WSS; add a case for
settings.WSS to return clientWSTunName (same as settings.WS) and keep
ErrUnsupportedProtocol only for truly unknown protocols (e.g., settings.UNKNOWN)
so deriveClientSettings(...) succeeds for WSS. Update the switch in
deriveClientTunName to include settings.WSS alongside settings.WS returning
clientWSTunName.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6fd0d489-a59a-4121-ace6-bb2d738a3596
📒 Files selected for processing (10)
src/application/confgen/const.gosrc/application/confgen/errors.gosrc/application/confgen/generator.gosrc/application/confgen/generator_test.gosrc/infrastructure/PAL/configuration/server/configuration.gosrc/infrastructure/PAL/configuration/server/configuration_test.gosrc/infrastructure/PAL/configuration/server/const.gosrc/infrastructure/PAL/configuration/server/manager.gosrc/infrastructure/PAL/configuration/server/manager_test.gosrc/infrastructure/PAL/configuration/server/reader.go
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/application/confgen/generator.go (1)
24-33: Guard against nil resolver injection.Line 27 accepts
resolveras-is; if a caller passesnil,Generate()will fail later when invokingg.resolver.ResolveIPv4(). Add an early guard so failures are deterministic and non-panicking.♻️ Proposed fix
import ( + "errors" "fmt" "net/netip" "tungo/infrastructure/PAL/configuration/client" serverConfiguration "tungo/infrastructure/PAL/configuration/server" "tungo/infrastructure/cryptography/primitives" "tungo/infrastructure/settings" ) + +var errHostResolverNotConfigured = errors.New("host resolver is not configured") @@ func (g *Generator) Generate() (*client.Configuration, error) { + if g.resolver == nil { + return nil, errHostResolverNotConfigured + } + serverConf, err := g.serverConfigurationManager.Configuration()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/application/confgen/generator.go` around lines 24 - 33, NewGenerator currently assigns the passed resolver directly, which allows a nil resolver to be injected and causes a panic later in Generate when calling g.resolver.ResolveIPv4(); add an early guard in NewGenerator that checks if resolver == nil and returns nil (or an explicit error-producing Generator/stub) so construction fails deterministically instead of panicking—update NewGenerator to validate resolver and fail fast, referencing the NewGenerator function, the resolver parameter, the Generator struct, and the Generate method (g.resolver.ResolveIPv4) so callers cannot create a Generator with a nil resolver.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/application/confgen/generator.go`:
- Around line 24-33: NewGenerator currently assigns the passed resolver
directly, which allows a nil resolver to be injected and causes a panic later in
Generate when calling g.resolver.ResolveIPv4(); add an early guard in
NewGenerator that checks if resolver == nil and returns nil (or an explicit
error-producing Generator/stub) so construction fails deterministically instead
of panicking—update NewGenerator to validate resolver and fail fast, referencing
the NewGenerator function, the resolver parameter, the Generator struct, and the
Generate method (g.resolver.ResolveIPv4) so callers cannot create a Generator
with a nil resolver.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f09c59ec-4d01-4157-b1bf-4298a0c666fe
📒 Files selected for processing (7)
src/application/confgen/generator.gosrc/application/confgen/generator_test.gosrc/infrastructure/network/host_resolver/dial_resolver.gosrc/infrastructure/network/host_resolver/dial_resolver_test.gosrc/main.gosrc/presentation/ui/tui/internal/bubble_tea/configurator_session.gosrc/presentation/ui/tui/server_configurator.go
✅ Files skipped from review due to trivial changes (1)
- src/main.go
🚧 Files skipped from review as they are similar to previous changes (1)
- src/application/confgen/generator_test.go
See: #278
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Refactor