Skip to content

Fix ArgumentError on invalid UTF-8 in tooling job output#8474

Merged
iHiD merged 2 commits into
mainfrom
fix/8466
Feb 9, 2026
Merged

Fix ArgumentError on invalid UTF-8 in tooling job output#8474
iHiD merged 2 commits into
mainfrom
fix/8466

Conversation

@iHiD
Copy link
Copy Markdown
Member

@iHiD iHiD commented Feb 9, 2026

Closes #8466

Summary

  • Use .scrub before .blank? on strings from external tooling services (test runners, analyzers, representers) to prevent ArgumentError: invalid byte sequence in UTF-8 when the data contains invalid UTF-8 bytes
  • Applied the fix to all three affected process commands: Submission::TestRun::Process, Submission::Analysis::Process, and Submission::Representation::Process
  • Added a test for invalid UTF-8 handling in test run processing

Test plan

  • bundle exec rails test test/commands/submission/test_run/process_test.rb — 18 tests pass, 0 failures
  • New test verifies that invalid UTF-8 bytes in results.json don't raise ArgumentError
  • Pre-commit hooks (rubocop, prettier) pass

🤖 Generated with Claude Code

iHiD and others added 2 commits February 9, 2026 11:02
Use .scrub before .blank? to sanitize strings from external tooling
services that may contain invalid UTF-8 byte sequences. This prevents
BLANK_RE regex from raising ArgumentError when matching against them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the JSON key doesn't exist in execution_output, the value is nil.
Calling .scrub on nil raises NoMethodError. Using &.scrub allows nil
to fall through to .blank? which correctly returns true for nil.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iHiD iHiD merged commit 7c04247 into main Feb 9, 2026
40 checks passed
@iHiD iHiD deleted the fix/8466 branch February 9, 2026 12:36
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.

ArgumentError: invalid byte sequence in UTF-8 (ArgumentError)

1 participant