Skip to content

fix: use jq for JSON field stripping in telemetry sync (#710)#717

Closed
stedfn wants to merge 1 commit intogarrytan:mainfrom
stedfn:stedfn/fix-telemetry-jq
Closed

fix: use jq for JSON field stripping in telemetry sync (#710)#717
stedfn wants to merge 1 commit intogarrytan:mainfrom
stedfn:stedfn/fix-telemetry-jq

Conversation

@stedfn
Copy link
Copy Markdown
Contributor

@stedfn stedfn commented Mar 31, 2026

Summary

  • Uses jq -c 'del(...)' for correct JSON field removal when jq is available
  • Keeps the existing sed regex as a fallback for environments without jq
  • Prevents silent data corruption when JSON values contain escaped quotes or commas

Fixes #710

Test plan

  • With jq installed: verify telemetry sync strips fields correctly
  • With jq absent: verify sed fallback still works for simple JSON

🤖 Generated with Claude Code

sed regex breaks on escaped quotes and commas in JSON values. Use jq
when available for correct JSON manipulation, keeping sed as a fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@garrytan
Copy link
Copy Markdown
Owner

garrytan commented Apr 5, 2026

Closing — overlaps with #749 which addresses the same issue. Thank you for the contribution!

@garrytan garrytan closed this Apr 5, 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.

Fragile JSON manipulation via sed in gstack-telemetry-sync

2 participants