Repository navigation
fix(config): align void.json revalidate key schema with runtime validation - #224
Merged
Merged
Conversation
❌ Deploy Preview for staging-void-cloud failed.
|
hyfdev
marked this pull request as ready for review
June 18, 2026 14:35
Brooooooklyn
approved these changes
Jun 30, 2026
Member
Merge activity
|
…ation The editor JSON schema for routing.revalidate object keys used the pattern ^(/|\*), whose \* branch is unanchored — so it accepted keys like "*foo", "**", and "*/" that the runtime validator (config.ts) rejects (a key must be exactly "*" or start with "/"). Editors using $schema therefore showed no error for keys that fail at build time. Anchor the \* branch to ^(\/|\*$), matching the runtime contract and the already-correct routing.revalidateQueryAllowlist pattern.
Brooooooklyn
force-pushed
the
fix/schema-revalidate-key-pattern
branch
from
June 30, 2026 04:10
0bebacf to
6c93a18
Compare
cpojer
pushed a commit
that referenced
this pull request
Sep 11, 2026
* docs: plan 0077 — build-log tail in check-run output Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(api): completeCheckRun accepts optional output.text Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: oxfmt reflow of plan 0077 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(api): embed build-log tail in Void Build check-run output Container-build check runs now include the last 100 captured log lines (char-capped, fenced) as output.text on every terminal outcome. Assembled best-effort in BuildManager.finalizeCheckRun; github_actions checks unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(api): dynamic check-run log fence + whole-string 65535 cap A fixed six-backtick fence was escapable by a log line containing >=6 backticks (markdown injection into the check-run page). Fence now sizes to max(6, longest content backtick run + 1), and the whole output.text string converges to <=65535 so GitHub never rejects the PATCH. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: merge check-run log tail plan into 0076, rename to build logs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: drop references to the removed 0077 plan file Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(api): enforce check-run text caps in UTF-8 bytes + 422 drop-text fallback GitHub validates output.text by UTF-8 bytesize, not code units — CJK/emoji log tails passed our cap while exceeding GitHub's, stranding the check run on a rejected PATCH. Caps now measure UTF-8 bytes (surrogate-safe cuts), and completeCheckRun retries a 422 once without output.text so a rejected tail can never cost the completion itself. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <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.
Editors now correctly flag invalid
routing.revalidatekeys invoid.jsoninstead of silently accepting keys the build will reject.The bug
The editor JSON schema validated
routing.revalidateobject keys with the pattern^(/|\*). The\*branch is unanchored, so it matched any key merely starting with*— accepting"*foo","**","*/". The runtime validator (packages/void/src/config.ts:473) requires each key to be exactly"*"or to start with"/", and throwsconfig: "routing.revalidate" key '…' … must start with "/" or be "*".on anything else. So an editor using$schemashowed no warning for keys that fail at build.Expected-correct behavior
The schema should accept exactly what the runtime accepts: a key that is
"*"or starts with"/".The fix
Anchor the
*branch:^(/|\*)→^(\/|\*$). This is byte-identical to the already-correct sibling pattern used byrouting.revalidateQueryAllowlist(schema.json), restoring schema↔runtime parity.Tests
Added a parity test in
config.test.ts(in the same style as the existingschema.json sourceDir pattern matches runtime validation/redirect status enumparity tests): it loads the schema pattern and asserts it accepts*,/x,/docs/*and rejects*foo,**,*/,foo— failing onorigin/mainand passing after. Local gate:config.test.ts159/159; full--project unitzero-collateral vs a cleanorigin/mainbaseline; schema.json valid JSON; typecheck + lint + fmt clean. No existingvoid.json/ doc example uses a now-rejected key.Prepared with AI assistance.