feature: add caching-proxy clean subcommand#39
Merged
Conversation
Add `evmx caching-proxy clean <dsn> "error:<regex>"` to purge wrongfully-cached error entries whose message matches a regex. The parent `caching-proxy` command still starts the server by default. - Full-scans the KV store, matches error entries (value prefix 0x01) against the regex on the rpc error message, and deletes them via BatchDelete in batches of --batch-size (1 = serial, bypassing batching). - --dry-run previews matches without deleting. - Prints a styled summary report via a small local stylex package (lipgloss + go-isatty, auto-plain when stdout is not a TTY).
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
Adds
evmx caching-proxy clean <dsn> "error:<regex>"to purge wrongfully-cached error entries from the caching-proxy KV store. The parentcaching-proxycommand still starts the JSON-RPC server by default;cleanis a new subcommand.Motivation
Some deterministic-looking errors were cached that should not have been (now prevented going forward by the
-32602fix ondevelop). This command lets operators remove the already-cached bad entries by matching their error message against a regex.Behavior
0x01), unmarshals therpc.ErrResponse, and tests the regex against itsMessage.BatchDeletein batches of--batch-size(default 100);--batch-size 1deletes serially, one key per call, bypassing batching.--dry-runpreviews matches without deleting anything.error:<regex>— theerror:prefix is reserved so future matcher kinds can be added.Report
Instead of a log line, prints a styled summary via a small local
stylexpackage (lipgloss + go-isatty), auto-plain when stdout is not a TTY:Tests
executor: TDD unit tests against a real badger store — only matching errors deleted, data + non-matching errors + malformed payloads kept; dry-run and--batch-size 1paths; invalid batch size rejected.cmd/evmx:error:<regex>matcher parsing and report rendering.