-
Notifications
You must be signed in to change notification settings - Fork 177
Fix(plane)/fix issue: control plane #1089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6ae4992
be6e56c
06f0d24
5603516
85e1c49
e5c4020
78339ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ export abstract class BoxAction { | |
| errorReason?: string, | ||
| daemonVersion?: string, | ||
| recoverable?: boolean, | ||
| extraUpdateData?: Partial<Box>, | ||
| ) { | ||
| // check if the lock code is still valid | ||
| const lockKey = getStateChangeLockKey(box.id) | ||
|
|
@@ -64,6 +65,8 @@ export abstract class BoxAction { | |
| } | ||
|
|
||
| const updateData: Partial<Box> = { | ||
| // Some state transitions must atomically update related fields such as desiredState. | ||
| ...extraUpdateData, | ||
|
Comment on lines
67
to
+69
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift Publish foreground desired-state transitions only after commit. These paths persist
Based on learnings, 📍 Affects 3 files
🤖 Prompt for AI AgentsSource: Learnings |
||
| state, | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,7 +114,11 @@ export class RunnerAdapterV2 implements RunnerAdapter { | |
| } | ||
| } | ||
|
|
||
| async createBox(box: Box, metadata?: { [key: string]: string }): Promise<StartBoxResponse | undefined> { | ||
| async createBox( | ||
| box: Box, | ||
| metadata?: { [key: string]: string }, | ||
| skipStart?: boolean, | ||
| ): Promise<StartBoxResponse | undefined> { | ||
| if (!box.image) { | ||
| throw new Error(`Box ${box.id} has no image; cannot create on runner`) | ||
| } | ||
|
|
@@ -128,6 +132,12 @@ export class RunnerAdapterV2 implements RunnerAdapter { | |
| memoryQuota: box.mem, | ||
| storageQuota: box.disk, | ||
| env: box.env, | ||
| // Store launch configuration in the async job payload so task replay survives Runner restarts. | ||
| entrypoint: box.launchConfig?.entrypoint, | ||
| cmd: box.launchConfig?.cmd, | ||
| workingDir: box.launchConfig?.workingDir, | ||
| tty: box.launchConfig?.tty, | ||
| detach: box.launchConfig?.detach, | ||
| volumes: box.volumes?.map((volume) => ({ | ||
| volumeId: volume.volumeId, | ||
| mountPath: volume.mountPath, | ||
|
|
@@ -137,6 +147,7 @@ export class RunnerAdapterV2 implements RunnerAdapter { | |
| networkAllowList: box.networkAllowList, | ||
| metadata, | ||
| authToken: box.authToken, | ||
| skipStart, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Preserve Line 150 forwards the flag, but Suggested fix- case JobType.CREATE_BOX:
- return job.status === JobStatus.COMPLETED ? BoxState.STARTED : BoxState.CREATING
+ case JobType.CREATE_BOX: {
+ if (job.status !== JobStatus.COMPLETED) return BoxState.CREATING
+ const skippedStart = job.getPayload<{ skipStart?: boolean }>()?.skipStart === true
+ return skippedStart ? BoxState.STOPPED : BoxState.STARTED
+ }🤖 Prompt for AI Agents |
||
| organizationId: box.organizationId, | ||
| regionId: box.region, | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛑 BoxDesiredState used but never imported
Line 95 references BoxDesiredState.STOPPED but the file's imports (lines 7-19) never import BoxDesiredState, so apps/api fails to compile/typecheck; verified via grep '^import' showing no such import.