Skip to content

[comp] Production Deploy#2920

Merged
tofikwest merged 3 commits into
releasefrom
main
May 22, 2026
Merged

[comp] Production Deploy#2920
tofikwest merged 3 commits into
releasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 22, 2026

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Fixes nested JSON rendering in Cloud Tests remediation steps so IAM/bucket policies display as one formatted code block. Prevents mixed prose/code caused by the old regex splitter.

  • Bug Fixes
    • Replaced the regex with a brace-balanced scanner extract-json-segments that respects strings/arrays and validates via JSON.parse.
    • Updated RemediationDialog to use the new helper for inline JSON detection and pretty-printing.
    • Added unit tests covering deep nesting, arrays, multiple JSON blocks, escaped quotes, and invalid/unbalanced cases.

Written for commit 30b9e80. Summary will update on new commits. Review in cubic

github-actions Bot and others added 3 commits May 22, 2026 18:50
…ectly

Customer Simon reported that an IAM bucket policy embedded in an
auto-generated manual step was rendering with parts inside the code
block and parts as plain prose. Verified the cause in
RemediationDialog's `TextWithInlineCode`: the previous splitter used
a regex that only handles ONE level of brace nesting

    \{[^{}]*"(?:Version|Effect|Statement)"[^{}]*(?:\{[^{}]*\}[^{}]*)*\}

so a CloudTrail bucket policy — which has two-deep nesting via
`Statement[].Principal.{...}` AND `Statement[].Condition.StringEquals.
{...}` — matched only the first Statement object. The outer
`{"Version":...,"Statement":[` wrapper and the second Statement
escaped into prose around the code block.

Replaces the regex with a brace-balanced scan in a new helper
`extract-json-segments.ts`:

  - Walks the string counting braces, respecting string literals and
    escaped quotes so `"description":"} { inside"` doesn't confuse
    the depth counter.
  - Validates each candidate via `JSON.parse` before classifying it
    as a code block — invalid candidates fall through to text so we
    don't render garbage.
  - Pure function, no React/DOM, easy to test in isolation.

18 unit tests cover: arbitrary nesting, arrays of objects, multiple
JSONs in one step, escaped quotes, unbalanced braces, the customer-
reported CloudTrail-policy round-trip, and the no-JSON pass-through.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ndering

fix(cloud-tests): render nested JSON in manual remediation steps correctly
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment May 22, 2026 7:30pm
comp-framework-editor (staging) Ready Ready Preview, Comment May 22, 2026 7:30pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal (staging) Skipped Skipped May 22, 2026 7:30pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest tofikwest merged commit 0dde75e into release May 22, 2026
14 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.63.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants