Skip to content

[comp] Production Deploy#3175

Merged
tofikwest merged 9 commits into
releasefrom
main
Jun 17, 2026
Merged

[comp] Production Deploy#3175
tofikwest merged 9 commits into
releasefrom
main

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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

Adds uploadable badge images for custom frameworks in the Trust Portal and shows them on admin and public views, falling back to initials when absent or expired. Also fixes a regression where the risk mitigation task could reopen closed risks by scoping updates to only open/unassigned risks.

  • New Features

    • API: POST/DELETE /v1/trust-portal/custom-frameworks/badge (trust:update), org-scoped. Stores PNG/JPEG/WebP ≤256KB in the org assets bucket and returns a 24h signed URL.
    • Validation: MIME-checked (SVG blocked), base64 + max length; decoded bytes capped at 256KB. Uploading a badge does not publish the framework.
    • Data: badgeUrl added to admin and public payloads for custom frameworks.
    • UI: New CustomFrameworkBadge with upload/replace/remove in settings; read-only users see the badge without controls. Falls back to initials on image load error.
  • Migration

    • DB: Add nullable badgeS3Key to TrustCustomFramework. Run migrations.
    • Ops: Ensure the org assets S3 bucket is configured and writable (APP_AWS_ORG_ASSETS_BUCKET). No breaking changes; existing frameworks continue showing initials.

Written for commit ed9387e. Summary will update on new commits.

Review in cubic

github-actions Bot and others added 8 commits June 17, 2026 14:57
Custom frameworks rendered with an initials avatar on the public Trust
Portal because they have no built-in SVG logo. Admins can now upload a
PNG/JPEG/WebP image (max 256KB) per custom framework, shown next to its
status; it falls back to the initials avatar when none is set.

- DB: nullable TrustCustomFramework.badgeS3Key (additive migration)
- API: POST/DELETE /v1/trust-portal/custom-frameworks/badge (trust:update),
  org-scoped tenant check, badge logic in TrustCustomFrameworkBadgeService;
  badgeUrl (24h signed URL, null-safe) added to admin + public payloads
- Admin UI: uploadable logo slot for custom frameworks; read-only users
  still see the badge but cannot edit it
- Reuses the favicon upload pattern (base64 -> S3 -> signed URL); uploading
  a badge never publishes a framework. SVG excluded (XSS).

Tests: 65 trust-portal jest specs (service + controller).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses cubic review on #3173:
- Badge upload now rejects on the MIME type alone (it's stored as the S3
  ContentType), so a disallowed type can no longer pass just because the
  filename carries an allowed extension. Drops the extension fallback.
- UploadCustomFrameworkBadgeDto.fileData is now @IsBase64 + @maxlength
  (~256KB), rejecting malformed/oversized payloads at the request boundary
  instead of only after decode. Service keeps the exact decoded-byte cap.
- Frontend badge picker aligned to the same MIME-only rule.

Tests: +1 service (disallowed-MIME-with-allowed-extension) and a new DTO
validation spec (base64 + max-length + required fields).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Marking a risk as "Closed" reverted to "Pending". Root cause: the
generate-risk-mitigation Trigger.dev task unconditionally wrote
status: pending (and reassigned assigneeId) on the risk every time it ran.
Besides onboarding, that task re-runs against EXISTING risks via the
"Regenerate" mitigation button and via task-unlink (refreshTreatmentPlan,
fire-and-forget). Those runs are async and land AFTER the user's synchronous
PATCH save, silently overwriting Closed -> Pending.

Fix: extract buildMitigationDefaultWrites, which scopes each write so the task
only applies onboarding DEFAULTS and never clobbers a user-managed risk:
- status: promote only a still-default `open` risk to `pending` (where status:
  open). Never downgrade a user-set pending/closed/archived.
- assigneeId: assign the author only when the risk is still unassigned.

The status/assignee where-clauses also make this race-safe if the user edits
the risk while the async job is in flight. Onboarding behavior is unchanged
(baseline/AI-drafted risks are created open/unassigned, so they still become
pending and get the author). Adds unit tests for the helper.

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

Addresses cubic review on #3173. The admin CustomFrameworkBadge <img> had
no onError handler, so an expired signed URL or failed load left a broken
image instead of the initials avatar (the public portal component already
did this). Adds an onError -> initials fallback, reset whenever badgeUrl
changes so a freshly uploaded/replaced badge gets a fresh attempt.

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

feat(trust-portal): upload custom framework badges on the trust portal
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment Jun 17, 2026 4:52pm
comp-framework-editor (staging) Ready Ready Preview, Comment Jun 17, 2026 4:52pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal (staging) Skipped Skipped Jun 17, 2026 4:52pm

Request Review

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 16 files

Confidence score: 5/5

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

Re-trigger cubic

…-to-pending

fix(risk): stop AI mitigation from reopening user-closed risks
@vercel vercel Bot temporarily deployed to staging – portal June 17, 2026 16:49 Inactive
@tofikwest tofikwest merged commit 9e7a26f into release Jun 17, 2026
14 checks passed
@claudfuen

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.84.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants