Skip to content

CS-345 [Bug] - When adding a new framework to and org, new policies pulled in, aren't regenerated to replace placeholders#2807

Merged
tofikwest merged 2 commits intomainfrom
chas/generate-policies
May 8, 2026
Merged

CS-345 [Bug] - When adding a new framework to and org, new policies pulled in, aren't regenerated to replace placeholders#2807
tofikwest merged 2 commits intomainfrom
chas/generate-policies

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

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

This is an automated pull request to merge chas/generate-policies into dev.
It was created by the [Auto Pull Request] action.


Summary by cubic

Automatically regenerates content for policies created when adding frameworks, so placeholders are filled while existing policies stay untouched. Runs generation as background jobs via Trigger.dev.

  • Bug Fixes
    • Track createdPolicyIds during framework upsert and return them from the addFrameworks transaction.
    • Queue update-policy tasks via @trigger.dev/sdk for new policies with org contextHub, deduped active frameworks, and memberId.
    • Add error handling for task triggers: log failures and abort if any trigger is rejected.
    • Controller forwards authContext.memberId to the service; external API response remains unchanged.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

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

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

Request Review

@chasprowebdev chasprowebdev changed the title [dev] [chasprowebdev] chas/generate-policies CS-345 [Bug] - When adding a new framework to and org, new policies pulled in, aren't regenerated to replace placeholders May 8, 2026
@linear
Copy link
Copy Markdown

linear Bot commented May 8, 2026

CS-345

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.

1 issue found across 3 files

Confidence score: 3/5

  • There is a concrete medium-risk behavior in apps/api/src/frameworks/frameworks.service.ts: Promise.allSettled outcomes are not checked, so rejected policy-trigger enqueue operations can be silently lost.
  • This creates user-impacting regression risk around reliability/observability, since failures may not surface via throw/log and downstream policy execution can be missed.
  • Given the issue’s moderate severity (6/10) and high confidence (8/10), this is mergeable with caution but not low-risk until rejection handling is added.
  • Pay close attention to apps/api/src/frameworks/frameworks.service.ts - ensure rejected allSettled results are handled so enqueue failures are observable.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/api/src/frameworks/frameworks.service.ts">

<violation number="1" location="apps/api/src/frameworks/frameworks.service.ts:674">
P2: `Promise.allSettled` results are ignored, so failed policy trigger enqueues are silently dropped. Check for rejected results and throw/log so failures are observable.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread apps/api/src/frameworks/frameworks.service.ts Outdated
@tofikwest
Copy link
Copy Markdown
Contributor

@cubic-dev-ai review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 8, 2026

@cubic-dev-ai review it

@tofikwest I have started the AI code review. It will take a few minutes to complete.

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.

@tofikwest tofikwest merged commit 8305166 into main May 8, 2026
11 checks passed
@tofikwest tofikwest deleted the chas/generate-policies branch May 8, 2026 15:29
@claudfuen
Copy link
Copy Markdown
Contributor

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