Repository navigation
fix(import): only count new page components against free slots - #3100
Open
chrisblaschke wants to merge 1 commit into
Open
chrisblaschke wants to merge 1 commit into
chrisblaschke wants to merge 1 commit into
Conversation
|
@chrisblaschke is attempting to deploy a commit to the OpenStatus Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/services/src/import/phase-writers.ts">
<violation number="1" location="packages/services/src/import/phase-writers.ts:300">
P1: This early return bypasses idempotency resolution when the workspace is full, so existing components never enter `componentIdMap`. A full-workspace re-import can therefore create or reconcile incidents, maintenances, or subscribers without their component links; resolve existing components before applying the capacity skip.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
| .where(eq(pageComponent.workspaceId, workspaceId)); | ||
| const maxComponents = ctx.workspace.limits["page-components"]; | ||
| let remaining = maxComponents - (existingCount?.count ?? 0); | ||
| if (remaining <= 0) { |
Contributor
There was a problem hiding this comment.
P1: This early return bypasses idempotency resolution when the workspace is full, so existing components never enter componentIdMap. A full-workspace re-import can therefore create or reconcile incidents, maintenances, or subscribers without their component links; resolve existing components before applying the capacity skip.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/services/src/import/phase-writers.ts, line 300:
<comment>This early return bypasses idempotency resolution when the workspace is full, so existing components never enter `componentIdMap`. A full-workspace re-import can therefore create or reconcile incidents, maintenances, or subscribers without their component links; resolve existing components before applying the capacity skip.</comment>
<file context>
@@ -287,6 +287,24 @@ export async function writeComponentsPhase(
+ .where(eq(pageComponent.workspaceId, workspaceId));
+ const maxComponents = ctx.workspace.limits["page-components"];
+ let remaining = maxComponents - (existingCount?.count ?? 0);
+ if (remaining <= 0) {
+ for (const resource of phase.resources) {
+ resource.status = "skipped";
</file context>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A repeat import can skip new components even when there's room. The import trims the list to the number of free slots before checking which components already exist.
Only spend a slot after inserting a new component. The regression test re-imports a page with one slot left, then checks that a full workspace still marks the component phase as skipped.
Found and fixed with AI agents (GPT-6.2 Sol in Pi). The test was re-run on your current main before opening this.