Refactor WASM guard detection placement and inline config validation log wrappers#5774
Merged
Merged
Conversation
Closed
4 tasks
Copilot
AI
changed the title
[WIP] Refactor semantic function clustering analysis with targeted improvements
Refactor WASM guard detection placement and inline config validation log wrappers
May 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs low-risk refactoring to improve cohesion around WASM guard detection and simplify config validation logging without changing validation behavior.
Changes:
- Moved baked-in WASM guard path detection from proxy command code into the WASM cache module.
- Removed private validation log wrapper helpers and inlined equivalent
logValidation.Printfcalls. - Kept proxy command guard defaulting behavior intact via
detectGuardWasm().
Show a summary per file
| File | Description |
|---|---|
internal/cmd/wasm_cache.go |
Adds colocated baked-in guard path constant and detection helper. |
internal/cmd/proxy.go |
Removes guard detection helper now provided by the WASM cache module. |
internal/config/validation.go |
Inlines validation logging calls and removes wrapper helpers. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
This was referenced May 15, 2026
This was referenced May 16, 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.
Semantic clustering surfaced two low-risk refactors: WASM guard auto-detection lived in
cmd/proxy.goinstead of the WASM cache module, andconfig/validation.goused one-line private logging wrappers that obscured validation flow. This PR tightens cohesion ininternal/cmdand simplifies config validation control flow without behavior changes.WASM setup cohesion (
internal/cmd)containerGuardWasmPathanddetectGuardWasm()frominternal/cmd/proxy.gotointernal/cmd/wasm_cache.go.newProxyCmd()behavior unchanged (defaultGuard := detectGuardWasm()), but colocated guard-path detection with other WASM cache/bootstrap logic.Validation flow simplification (
internal/config)logValidateServerStartlogValidateServerPassedlogValidateServerFailedlogValidation.Printf(...)calls at usage sites in server/auth/containerization validation paths to make control flow directly readable.Illustrative change