Skip to content

[comp] Production Deploy#2310

Merged
Marfuen merged 6 commits intoreleasefrom
main
Mar 16, 2026
Merged

[comp] Production Deploy#2310
Marfuen merged 6 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
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.

github-actions bot and others added 2 commits March 14, 2026 21:48
* chore: align all package names to @trycompai scope

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

* fix: update CLAUDE.md @comp/ui reference and regenerate bun.lock

- Fix last @comp/ui reference in CLAUDE.md design system section
- Regenerate bun.lock to reflect @trycompai/* workspace names
  (CI with --frozen-lockfile would fail without this)

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

* ci: disable maced contract canary while API is unavailable

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 15, 2026

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

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment Mar 16, 2026 11:41pm
comp-api-test Ready Ready Preview, Comment Mar 16, 2026 11:41pm
portal (staging) Ready Ready Preview, Comment Mar 16, 2026 11:41pm

Request Review

@cursor
Copy link

cursor bot commented Mar 15, 2026

PR Summary

Medium Risk
Adds new platform-admin API surface area plus changes to authentication-derived admin/impersonation handling and audit logging, which could impact access control and log integrity if misconfigured. Also includes widespread package-scope renames and build/CI config tweaks that may affect deployments.

Overview
Introduces a new platform-admin API module under v1/admin/organizations/* for listing/activating orgs, inviting members, viewing audit logs, and admin-scoped CRUD over org resources (policies, tasks, vendors, findings, context, evidence), with controller-level throttling, validation, and comprehensive Jest coverage.

Adds AdminAuditLogInterceptor for these admin endpoints (including entity-name resolution and sensitive-field sanitization) and extends the existing audit log interceptor to record impersonatedBy and prefix descriptions during impersonated sessions.

Hardens admin authentication by standardizing “platform admin” checks on User.role === 'admin', adding Better Auth admin() plugin + audit hooks for Better Auth /admin/* actions, and adding an Upstash-backed Express rate limiter for /api/auth/admin/* routes.

Performs repo-wide housekeeping: migrates references from @comp/* to @trycompai/* in docs/config/tests/buildspec, updates syncpack rules accordingly, and temporarily disables the maced-contract-canary workflow due to upstream unavailability.

Written by Cursor Bugbot for commit f81148b. This will update automatically on new commits. Configure here.

* feat(admin-organizations): add admin context and findings controllers with audit logging

- Implemented AdminContextController and AdminFindingsController for managing context entries and findings within organizations.
- Added AdminAuditLogInterceptor to log changes made through the admin endpoints.
- Created corresponding service methods and DTOs for context and findings management.
- Included unit tests for all new controllers to ensure functionality and reliability.

* fix(api): update finding-related types and improve admin audit logging

- Changed `findUnique` to `findFirst` for database queries in admin audit log tests.
- Updated `memberId` type to allow null in `FindingAuditParams` and related service methods.
- Modified admin findings controller to handle null `memberId` when creating audit logs.
- Enhanced audit logging to skip entries if no active organization ID is present in the session.

* feat(audit): enhance admin audit logging and introduce platform audit log interceptor

- Added new audit log descriptions for user impersonation, session revocation, and user removal actions.
- Replaced `AdminAuditLogInterceptor` with `PlatformAuditLogInterceptor` in the AdminIntegrationsController for improved logging.
- Implemented `PlatformAuditLogInterceptor` to log platform credential changes with user context and action descriptions.

* fix(api): update admin findings and organizations tests for null handling

- Modified admin findings controller test to handle null `memberId` when creating audit logs.
- Enhanced admin organizations service test to include additional search criteria for members with the role of 'owner' based on user name and email.

* fix(api): handle null frequency in admin policies controller and improve user role update logic

- Updated admin policies controller to set frequency to null instead of undefined when the body frequency is null.
- Enhanced user role update logic in auth server to fetch current user data before checking platform admin status, ensuring accurate updates.

* fix(api): normalize limit and offset handling across admin controllers

- Updated limit and offset parameters in AdminEvidenceController, AdminOrganizationsController, AdminFindingsController, AdminTasksController, and AdminVendorsController to ensure proper parsing and default values.
- Moved AdminRequest interface to platform-admin-auth-context for better type management and consistency across controllers.

* fix(api): enhance admin integrations controller and credential handling

- Updated AdminIntegrationsController to simplify credential hint retrieval by removing unnecessary async calls and integrating hints directly into the response.
- Refactored credential handling in PlatformCredentialRepository to include client ID and secret hints.
- Added client ID and secret hint properties to CreatePlatformCredentialDto and updated related service methods for consistent credential management.
- Introduced a static method in OAuthCredentialsService to mask secrets for improved security.

* fix(api): improve invitation revocation logic in admin organizations service

- Updated the revokeInvitation method to check for 'pending' status when retrieving invitations, ensuring only valid invitations can be revoked.
- Enhanced the NotFoundException message for better clarity on the invitation status.

* test(admin): add integration tests for PlatformAdminGuard functionality

* chore: update imports to use @trycompai/ui and adjust auth package entry points

* fix(db): correct casing for task relation fields in Prisma schema

* refactor(admin): update ImpersonationBanner to use window.location for navigation and enhance AddFrameworkModal with session-based permission checks

* fix(admin): update ImpersonationBanner to use router for navigation and session notifications

* feat(auth): implement admin rate limiting middleware with tests

* refactor(auth): improve HybridAuthGuard to resolve isPlatformAdmin from User.role

* refactor(admin): enhance AdminAuditLogInterceptor for improved readability and maintainability

* refactor(auth): enhance PermissionGuard for improved permission handling and readability

---------

Co-authored-by: Lewis Carhart <lewis@trycomp.ai>
#2311)

The getCodeScanningStatus function previously returned early with
ghas-required or permission-denied when the code-scanning API returned
403, skipping workflow file scanning entirely. This prevented detection
of third-party SAST tools (Semgrep, Snyk, Trivy) that upload SARIF
results via github/codeql-action/upload-sarif.

The code-scanning API requires GHAS for private repos, but reading
workflow file contents only requires contents:read — these are
independent permission scopes. A 403 on the API should not prevent
checking for code scanning workflows.

Now the 403 handler sets a flag instead of returning early, always
falls through to workflow scanning, and only returns the appropriate
error status if no workflows are found either.

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

* feat(admin-organizations): add admin context and findings controllers with audit logging

- Implemented AdminContextController and AdminFindingsController for managing context entries and findings within organizations.
- Added AdminAuditLogInterceptor to log changes made through the admin endpoints.
- Created corresponding service methods and DTOs for context and findings management.
- Included unit tests for all new controllers to ensure functionality and reliability.

* fix(api): update finding-related types and improve admin audit logging

- Changed `findUnique` to `findFirst` for database queries in admin audit log tests.
- Updated `memberId` type to allow null in `FindingAuditParams` and related service methods.
- Modified admin findings controller to handle null `memberId` when creating audit logs.
- Enhanced audit logging to skip entries if no active organization ID is present in the session.

* feat(audit): enhance admin audit logging and introduce platform audit log interceptor

- Added new audit log descriptions for user impersonation, session revocation, and user removal actions.
- Replaced `AdminAuditLogInterceptor` with `PlatformAuditLogInterceptor` in the AdminIntegrationsController for improved logging.
- Implemented `PlatformAuditLogInterceptor` to log platform credential changes with user context and action descriptions.

* fix(api): update admin findings and organizations tests for null handling

- Modified admin findings controller test to handle null `memberId` when creating audit logs.
- Enhanced admin organizations service test to include additional search criteria for members with the role of 'owner' based on user name and email.

* fix(api): handle null frequency in admin policies controller and improve user role update logic

- Updated admin policies controller to set frequency to null instead of undefined when the body frequency is null.
- Enhanced user role update logic in auth server to fetch current user data before checking platform admin status, ensuring accurate updates.

* fix(api): normalize limit and offset handling across admin controllers

- Updated limit and offset parameters in AdminEvidenceController, AdminOrganizationsController, AdminFindingsController, AdminTasksController, and AdminVendorsController to ensure proper parsing and default values.
- Moved AdminRequest interface to platform-admin-auth-context for better type management and consistency across controllers.

* fix(api): enhance admin integrations controller and credential handling

- Updated AdminIntegrationsController to simplify credential hint retrieval by removing unnecessary async calls and integrating hints directly into the response.
- Refactored credential handling in PlatformCredentialRepository to include client ID and secret hints.
- Added client ID and secret hint properties to CreatePlatformCredentialDto and updated related service methods for consistent credential management.
- Introduced a static method in OAuthCredentialsService to mask secrets for improved security.

* fix(api): improve invitation revocation logic in admin organizations service

- Updated the revokeInvitation method to check for 'pending' status when retrieving invitations, ensuring only valid invitations can be revoked.
- Enhanced the NotFoundException message for better clarity on the invitation status.

* test(admin): add integration tests for PlatformAdminGuard functionality

* chore: update imports to use @trycompai/ui and adjust auth package entry points

* fix(db): correct casing for task relation fields in Prisma schema

* refactor(admin): update ImpersonationBanner to use window.location for navigation and enhance AddFrameworkModal with session-based permission checks

* fix(admin): update ImpersonationBanner to use router for navigation and session notifications

* feat(auth): implement admin rate limiting middleware with tests

* refactor(auth): improve HybridAuthGuard to resolve isPlatformAdmin from User.role

* refactor(admin): enhance AdminAuditLogInterceptor for improved readability and maintainability

* refactor(auth): enhance PermissionGuard for improved permission handling and readability

* refactor(db): streamline migration to ensure user roles are set correctly and remove redundant column

* refactor(db): remove redundant isPlatformAdmin column from user migration

* refactor(db): add isPlatformAdmin field to User model and clean up whitespace

* fix(auth): add isPlatformAdmin default value to mock user creation

* refactor(auth): update package entry points and improve type definitions in permissions module

---------

Co-authored-by: Lewis Carhart <lewis@trycomp.ai>
Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
* fix(auth): add rate limiting for admin endpoints

* chore(deps): update @upstash/ratelimit to version 2.0.8 and adjust package.json dependencies

---------

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
@Marfuen Marfuen merged commit 858dac7 into release Mar 16, 2026
11 of 13 checks passed
@claudfuen
Copy link
Contributor

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

3 participants