Skip to content

fix(cloud-tests): cubic follow-ups from production deploy review#2864

Merged
tofikwest merged 1 commit into
mainfrom
tofik/cubic-cloud-tests-followup
May 15, 2026
Merged

fix(cloud-tests): cubic follow-ups from production deploy review#2864
tofikwest merged 1 commit into
mainfrom
tofik/cubic-cloud-tests-followup

Conversation

@tofikwest
Copy link
Copy Markdown
Contributor

@tofikwest tofikwest commented May 15, 2026

Summary

Cubic flagged 5 issues on PR #2862 (the auto-generated main → release production deploy PR). 4 were real and are fixed here; 1 was a false positive (jest hoisting with ts-jest).

Real bugs fixed

Severity File Bug
P1 CloudTestsSection.tsx "Fix All" could include passing findings in the batch target. Service groups merge failed+passed, and canFixFinding doesn't gate on status — so a passing check could be queued for remediation. Now filtered explicitly.
P2 exception-expiry.utils.ts ISO 8601 regex made the timezone offset optional; timestamps without Z/+00:00 got parsed in server-local time, giving inconsistent expiries on UTC vs Pacific hosts. Offset now required.
P2 reconciliation.service.ts Dead !prior.passed === false line — identical to the next if (prior.passed) continue. Removed for clarity.
P2 ai-description.prompt.ts \bA\.\d+\.\d+(\.\d+)?\b/ lacked /i, so lowercase ISO 27001 control citations (a.5.1.2) slipped past the forbidden-content guard. Added /i and a regression test.

False positive skipped

  • P1 Jest hoisting in exception.service.spec.ts / reconciliation.service.spec.ts: that rule is enforced by babel-plugin-jest-hoist (default in babel-jest). This project uses ts-jest, which doesn't enforce the strict mock* naming convention. CI is green and all 145 tests pass. Renaming would be cosmetic insurance against a future babel-jest migration; not blocking.

Test plan

  • npx jest src/cloud-security/exception-expiry src/cloud-security/ai-description src/cloud-security/reconciliation — 32 tests pass
  • npx tsc --noEmit on both apps/api and apps/app — clean for changed files
  • Visual: open a service group with only passing findings, confirm "Fix All" button doesn't appear (the existing group.failed > 1 guard already gates the button, so this fix is belt-and-suspenders for any future code path that opens the batch dialog directly)
  • Visual: try to mark an exception with expiresAt = "2026-08-13T23:59:59" (no TZ) and confirm the API rejects with a clear message

🤖 Generated with Claude Code


Summary by cubic

Fixes four issues flagged by Cubic in the production deploy review to prevent incorrect batch remediation and ensure consistent validation. One Jest hoisting warning was a false positive and skipped.

  • Bug Fixes
    • Cloud tests: “Fix All” now only targets failing findings before applying canFixFinding.
    • Exception expiry: ISO 8601 timestamps now require an explicit timezone offset; timezone-less inputs are rejected.
    • Reconciliation: Removed redundant !prior.passed === false check for clarity; behavior unchanged.
    • AI description: ISO 27001 control regex is now case-insensitive to block lowercase citations (e.g., a.5.1.2).

Written for commit 33042e7. Summary will update on new commits. Review in cubic

Four real issues caught by cubic on the main→release deploy review.
The two Jest-hoisting findings (exception/reconciliation specs) were
skipped — that rule is babel-jest only, project uses ts-jest, all
tests pass in CI.

P1 — "Fix All" could target passing findings
  Service groups store the merged failed+passed set, and
  `canFixFinding` returns a key for any finding with a `findingKey`
  regardless of status. The batch dialog was happily including
  already-passing checks in the remediation target list. Now filter
  by `status === 'failed'` before consulting canFixFinding.

P2 — exception-expiry accepted timezone-less timestamps
  ISO 8601 regex made the timezone offset optional, so
  `2026-08-13T23:59:59` passed validation but `new Date()` parsed
  it in server-local time — same input, different expiry on
  UTC vs Pacific hosts. Made the offset required; updated the
  spec to assert both acceptance (with offset) and rejection
  (without offset).

P2 — dead `!prior.passed === false` in reconciliation
  The line evaluated identically to the very next `if (prior.passed)
  continue`. Removed; behavior unchanged, clarity restored.

P2 — ISO control-number regex was case-sensitive
  `/\bA\.\d+\.\d+(\.\d+)?\b/` had no /i flag, so lowercase
  variants like "a.5.1.2" would slip past the forbidden-content
  guard. Added /i and a regression test.

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

vercel Bot commented May 15, 2026

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

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment May 15, 2026 10:53pm
comp-framework-editor Ready Ready Preview, Comment May 15, 2026 10:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal Skipped Skipped May 15, 2026 10:53pm

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 6 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 e080cd2 into main May 15, 2026
11 checks passed
@tofikwest tofikwest deleted the tofik/cubic-cloud-tests-followup branch May 15, 2026 22:54
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.56.0 🎉

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants