Skip to content

[comp] Production Deploy#2689

Merged
Marfuen merged 3 commits intoreleasefrom
main
Apr 28, 2026
Merged

[comp] Production Deploy#2689
Marfuen merged 3 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 28, 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 device-agent installs getting stuck by redirecting binary updates to presigned S3 URLs and adding a legacy session alias. Also hardens employee sync by validating roles and auto-healing bad role values.

  • Bug Fixes
    • Auto-update: 302 to presigned S3 for binaries (.zip, .exe, .dmg, .AppImage, .blockmap); streams .yml manifests with cache.
    • HEAD: Signs URLs with HeadObject for binary checks; returns metadata for manifests; forces Cache-Control: no-store on redirects.
    • Portal proxy: Uses redirect: 'manual' and forwards 3xx so clients download from S3 directly (avoids function timeouts).
    • Legacy: Adds /api/auth/get-session alias in the portal that proxies to the API and preserves Set-Cookie.
    • Hardening: Validates filenames and maps S3 NoSuchKey to 404; adds unit tests for controller/service.
    • Employee sync: Sanitizes employee.role against built-in and org roles; drops unknown tokens and falls back to defaultRole; self-heals existing members on re-sync/reactivation; adds tests.

Written for commit 382f619. Summary will update on new commits. Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

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

Project Deployment Actions Updated (UTC)
comp-framework-editor (staging) Ready Ready Preview, Comment Apr 28, 2026 8:34pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app (staging) Skipped Skipped Apr 28, 2026 8:34pm
portal (staging) Skipped Skipped Apr 28, 2026 8:34pm

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

Requires human review: This PR modifies critical paths including device-agent update delivery and authentication proxying, which impacts production deployment and requires human verification.

#2690)

* fix(sync): validate employee.role against known roles before persisting

The generic employee sync service wrote employee.role straight into
member.role with no validation. A misconfigured DSL (notably the
Microsoft sync, which mapped Entra Graph's jobTitle into role) could
plant strings like "Senior Front End Engineer" in member.role with no
matching organization_role row. The Roles page correctly showed nothing
for these "limbo" roles, but the People list rendered them as Badges
(getRoleLabel falls back to title-case for unknown roles), and any
RBAC check against them silently denied permissions because the value
matched neither a built-in role nor a custom role.

Sanitize employee.role before insert: each comma-separated token must
be either a built-in role (BUILT_IN_ROLE_PERMISSIONS) or an existing
organization_role.name in the same org. Unknown tokens are dropped;
if every token is invalid (or role is empty), fall back to defaultRole.
Log a warning when this happens so a misconfigured DSL is visible in
sync logs instead of silently corrupting data.

Note: this is a forward fix only. Customers with already-polluted
member.role values need a one-time data scrub plus a fix to their
DynamicIntegration.syncDefinition JSON in the database (separate
operations on the DB side, not in this PR).

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

* fix(sync): self-heal existing members' limbo roles on re-sync

The previous commit guarded *new* member creation against unknown role
strings. This extends the same sanitizer to *existing* members the sync
re-encounters, so customers who already have polluted member.role
values get cleaned up automatically the next time they import — no
manual DB scrub required.

The heal is conservative: it only ever shrinks the role string (drops
unknown tokens, falls back to defaultRole if every token is invalid).
It never overwrites a member's currently-valid role with whatever the
provider sent, so a manually-assigned admin won't get downgraded by a
DSL still mis-mapping jobTitle. Both the "already a member" and the
"reactivate" paths heal.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel vercel Bot temporarily deployed to staging – portal April 28, 2026 20:33 Inactive
@vercel vercel Bot temporarily deployed to staging – app April 28, 2026 20:33 Inactive
@Marfuen Marfuen merged commit a7cf016 into release Apr 28, 2026
12 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

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