Skip to content

1.3.0: Fix sed command error when component names contain forward slashes#32

Merged
konard merged 4 commits intomainfrom
issue-31-8743dd699319
Jan 29, 2026
Merged

1.3.0: Fix sed command error when component names contain forward slashes#32
konard merged 4 commits intomainfrom
issue-31-8743dd699319

Conversation

@konard
Copy link
Member

@konard konard commented Jan 29, 2026

Summary

  • Fix sed command error in disk space measurement workflow that broke when component names contained forward slashes
  • Add case study documentation for issue CI/CD failed #31
  • Add test script to verify the fix

Root Cause Analysis

The measure-disk-space.sh script used / as the sed delimiter:

sed "s/\"components\": \[\]/\"components\": [$new_component]/"

When measuring "C/C++ Tools (CMake, Clang, LLVM, LLD)", the / in the name broke the sed command:

sed: -e expression #1, char 20: unknown option to `s'

This caused the script to exit early (due to set -euo pipefail), recording only 2 components instead of ~25, with a total of 0MB.

Solution

Replace / with | as the sed delimiter to avoid conflicts with component names:

sed "s|\"components\": \[\]|\"components\": [$new_component]|"

Test Plan

  • Created test script (experiments/test-sed-fix.sh) that reproduces the bug and verifies the fix
  • Old method (with / delimiter) fails with exact same error
  • New method (with | delimiter) works correctly
  • CI workflow should pass after merge (workflow only runs on push to main)

Files Changed

File Change
scripts/measure-disk-space.sh Fixed sed delimiter from / to | in 6 places
docs/case-studies/issue-31/README.md Added root cause analysis documentation
experiments/test-sed-fix.sh Added test script to verify the fix

Fixes #31


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #31
@konard konard self-assigned this Jan 29, 2026
…shes

The disk space measurement workflow failed because the sed command used
`/` as the delimiter, which broke when component names contained `/`
(e.g., "C/C++ Tools (CMake, Clang, LLVM, LLD)").

Changes:
- Replace sed delimiter `/` with `|` in add_measurement() function
- Apply same fix in both main script and embedded sandbox-measure.sh
- Update finalize_json_output() for consistency
- Add case study documentation (docs/case-studies/issue-31)
- Add test script to verify the fix (experiments/test-sed-fix.sh)

Root cause: When sed "s/.../...$new_component/" was used with a component
name containing `/`, it caused "unknown option to 's'" error.

Fixes #31

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] CI/CD failed 1.3.0: Fix sed command error when component names contain forward slashes Jan 29, 2026
@konard konard marked this pull request as ready for review January 29, 2026 18:36
konard and others added 2 commits January 29, 2026 19:37
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard
Copy link
Member Author

konard commented Jan 29, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $5.506590 USD
  • Calculated by Anthropic: $3.891158 USD
  • Difference: $-1.615433 (-29.34%)
    📎 Log file uploaded as Gist (771KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 8f2430e into main Jan 29, 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.

CI/CD failed

1 participant