refactor: remove redundant enabled booleans, fix timeout types, delete coercion UnmarshalYAML methods#322
Merged
Merged
Conversation
…stencies, delete coercion UnmarshalYAML methods - Remove Enabled bool from HTTPCacheConfig; presence of cache block implies enabled - Remove EnableCORS *bool from CORS; presence of cors block implies CORS active - Remove Enabled bool from WebAppConfig - Change ScraperConfig.Timeout from int to string (Go duration, consistent with other executors) - Remove TimeoutDuration field from BrowserConfig (redundant alias for Timeout) - Delete BrowserAction, BrowserViewportConfig, BrowserConfig UnmarshalYAML coercions - Rename timeoutDuration yaml key to timeout across all schemas, examples, templates, and E2E tests - Simplify GetCORSConfig and CorsMiddleware accordingly - Update validator schema keys and JSON schema Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ocs/v2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…middleware The Write path at line 140 is only reached for non-browser content types (JSON, binary, etc.) — HTML is already escaped on the branch above. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ResponseWriterWrapper Write(b) is only reachable for non-browser content types (JSON, binary). Browser-rendered content is HTML-escaped via html.EscapeString on the branch above. The lgtm/codeql inline suppression comments do not work for path-problem queries, so we exclude the rule in the CodeQL config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s, deploy, registry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
ScraperConfig.Timeouttype fromint(seconds) tostring(Go duration) for consistencyUnmarshalYAMLcoercion methods that are no longer neededtimeoutDurationyaml key totimeoutacross all schemas, examples, templates, and docsChanges
Enabled boolfromHTTPCacheConfig— presence ofcache:block implies enabledEnableCORS *boolfromCORS— presence ofcors:block implies CORS activeEnabled boolfromWebAppConfigScraperConfig.Timeoutfrominttostring(Go duration)TimeoutDuration stringfromBrowserConfig(redundant alias forTimeout)BrowserAction.UnmarshalYAML,BrowserViewportConfig.UnmarshalYAML,BrowserConfig.UnmarshalYAMLtimeoutDuration→timeoutacross all schemas, examples, templates, E2E tests, and docsGetCORSConfig()andCorsMiddleware— removed*boolnil-check logicpkg/validator/schema.goandpkg/validator/schemas/resource.jsondocs/v2/to removeenableCors:references and renametimeoutDuration:totimeout:Test plan
go test -short ./...— 5960 passedmake lint— 0 issuesnpm run buildindocs/v2/— clean🤖 Generated with Claude Code