Add production packaging and runtime operations for bundled NetEase rules - #28
Merged
Merged
Conversation
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.
Motivation
Description
default(RE2/CGO-free) target and an opt-inpcre2target that builds withCGO_ENABLED=1 -tags pcre2and installs PCRE2 build/runtime bits only for the PCRE2 image, and addmake docker-build,make docker-build-pcre2,make docker-smoke, andmake docker-smoke-pcre2targets.--validate-configand--print-bundled-summaryflags tocmd/serverto validate config and emit a safe bundled-runtime summary (and error clearly ifregex_engine: pcre2is selected but binary lacks PCRE2).regex_engine,regex_backend_availableand a successful reload timestamp while continuing to avoid exposing raw regex patterns or offensive content, and add conservativeconfig.bundled-rules.examples.ymlsnippets plus adocker-compose.pcre2.example.ymloverride.docs/production-runtime-ops.md, updateREADME.md,CHANGELOG.md, andCODEX.mddescribing default RE2 path, opt-in PCRE2 tradeoffs, operational checks (make verify-bundled-netease,--validate-config,--print-bundled-summary), and GPL/MIT data boundary notes.Testing
gofmt,go test ./...,go vet ./...,go build ./...,CGO_ENABLED=0 go build ./...,make verify-bundled-netease,make fmt-check,make smoke,make e2e,make gosec(0 issues), andgo run ./cmd/server --config config.example.yml --validate-configplus--print-bundled-summary, all of which completed successfully in the default RE2/CGO-free environment.go test -tags pcre2 ./...,go build -tags pcre2 ./...,make test-pcre2, andmake build-pcre2, which failed due to missing PCRE2 development files in the environment with the exact pkg-config error:Package 'libpcre2-8', required by 'virtual:world', not found(environment limitation, not code failure)./bin/bash: line 1: docker: command not found), so Docker image builds/smoke runs were not executed here but theDockerfilemulti-target and Makefile targets are added and documented with exactmake/docker buildcommands for CI or operator use.feature/production-packaging-runtime-ops(local HEADb4231bbc839be93bca21bebf7bc18aa8538eff4b); attempting to push failed due to missing GitHub HTTPS credentials so no remote PR URL was created in this environment, and the only failed checks are environment-limited PCRE2 and Docker operations as noted above.Codex Task