Skip to content

Change validation resilience and parallelisation to RRI migration script#5347

Draft
backspace wants to merge 2 commits into
mainfrom
rri-lax-json-cs-10754
Draft

Change validation resilience and parallelisation to RRI migration script#5347
backspace wants to merge 2 commits into
mainfrom
rri-lax-json-cs-10754

Conversation

@backspace

@backspace backspace commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

When running it in staging, I got a warning about some files not being valid JSON after migration. But the files already were invalid JSON!

This also adds a --jobs flag to migrate more than one file at once, since it took quite a while to run.

…ct files

The post-run JSON check flagged any changed file that didn't parse strictly,
but a prefix substitution can't turn valid JSON invalid (it never touches
structural characters) — so every failure was a file that was already
non-strict (trailing commas, unescaped embedded source) and which the realm
server's lenient parser tolerates. Record which files parsed cleanly before
editing and only fail on a valid -> invalid regression; report already-non-strict
files as a note. A genuine break still exits non-zero.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Host Test Results

    1 files  ±0      1 suites  ±0   2h 8m 20s ⏱️ +43s
3 272 tests ±0  3 257 ✅ ±0  15 💤 ±0  0 ❌ ±0 
3 291 runs  ±0  3 276 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit 3f9f599. ± Comparison against earlier commit ef128dc.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   8m 51s ⏱️ -31s
1 663 tests ±0  1 663 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 742 runs  ±0  1 742 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 3f9f599. ± Comparison against earlier commit ef128dc.

Edit files concurrently via `xargs -P` to hide per-file I/O latency on
networked filesystems (EFS), where the sequential per-file loop was the
bottleneck on large realm trees.

- Add -j/--jobs <n> flag (default 16).
- Each worker writes its own patch fragment (concurrent appends to one
  shared patch file would interleave and corrupt it); fragments are
  concatenated into the rollback patch after the run. Worker results
  (changed-JSON list, processed count, errors) go to shared list files
  aggregated afterward, since arrays can't cross the xargs boundary.
- JSON verification reads its path lists from files rather than argv,
  which also makes it ARG_MAX-safe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@backspace backspace changed the title Change RRI migration script to not report failure on already-invalid JSON Change validation resilience and parallelisation to RRI migration script Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant