-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(function): custom sandboxes #6071
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
Open
icecrasher321
wants to merge
40
commits into
staging
Choose a base branch
from
staging-v11
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
158d832
feat(sandboxes): workspace dependency sets for Function blocks
icecrasher321 d5d30b9
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 3f6b6bc
chore(db): regenerate the sandboxes migration as 0273
icecrasher321 8849268
chore(db): drop the sandboxes migration ahead of the staging merge
icecrasher321 41bc220
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 de81dfe
chore(db): regenerate the sandboxes migration as 0275
icecrasher321 6766c36
fix(billing): consolidate the Max-tier entitlement onto one predicate
icecrasher321 4509743
chore(db): drop the sandboxes migration ahead of the staging merge
icecrasher321 ce615d3
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 49272f3
chore(db): regenerate the sandboxes migration as 0277
icecrasher321 71f24cc
feat(sandboxes): gate on the enterprise feature flags, drop the rollo…
icecrasher321 8e636dc
fix(sandboxes): let the language menu match its trigger width
icecrasher321 3f6f715
fix(sandboxes): re-queue a build when resolution finds the image unus…
icecrasher321 20162f6
improvement(sandboxes): let the picker show just the sandbox name
icecrasher321 c45c39d
fix(sandboxes): show the sandbox name on the block card, not its uuid
icecrasher321 7bcd8fa
fix(sandboxes): hide the Sandboxes section with no provider configured
icecrasher321 5893e27
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 3d789d7
docs(sandboxes): correct three claims the code no longer makes
icecrasher321 d97ae29
feat(sandboxes): release the provider image when nothing references it
icecrasher321 b18d312
fix(sandboxes): rate-limit the automatic rebuild, drop the one-off st…
icecrasher321 9b1b022
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 0d68a8c
fix(sandboxes): claim the image row and its reference check in one st…
icecrasher321 2d84fe2
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 d9bcc57
fix(sandboxes): route the retention sweep through the same image claim
icecrasher321 70ea74b
fix(sandboxes): rebuild a hash adopted while its image was being deleted
icecrasher321 d63cfd4
fix(sandboxes): reclaim a ready row whose image was deleted underneat…
icecrasher321 e446f2b
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 081485c
fix(sandboxes): let a same-spec save retry a failed build
icecrasher321 c505851
docs(sandboxes): correct the image cache's staleness invariant
icecrasher321 964b129
docs(sandboxes): note that a JavaScript sandbox needs an import to apply
icecrasher321 4170319
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 6fca142
fix(sandboxes): stop create mode surviving a return to an open sandbox
icecrasher321 ae753cb
fix(ci): pin the sandbox flag in the second nav catalog test, bump th…
icecrasher321 edcfb40
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 a549393
fix(sandboxes): keep the row restore to a refused delete only
icecrasher321 29b7442
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 f09dc99
fix(sandboxes): drop the dead row when a re-adopt rebuild cannot be s…
icecrasher321 2994141
feat(sandboxes): repair a missing image at create, where the truth is…
icecrasher321 af63079
Merge remote-tracking branch 'origin/staging' into staging-v11
icecrasher321 4e21e64
fix(sandboxes): key the build trigger by attempt, not by spec
icecrasher321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { createLogger } from '@sim/logger' | ||
| import { getErrorMessage } from '@sim/utils/errors' | ||
| import { type NextRequest, NextResponse } from 'next/server' | ||
| import { verifyCronAuth } from '@/lib/auth/internal' | ||
| import { withRouteHandler } from '@/lib/core/utils/with-route-handler' | ||
| import { runCleanupSandboxImages } from '@/background/cleanup-sandbox-images' | ||
|
|
||
| export const dynamic = 'force-dynamic' | ||
|
|
||
| const logger = createLogger('CleanupSandboxImagesAPI') | ||
|
|
||
| /** | ||
| * Retention sweep for prebuilt sandbox images. A runtime-strategy deployment has | ||
| * nothing to collect, so the sweep is a no-op there rather than a special case | ||
| * here. | ||
| */ | ||
| export const GET = withRouteHandler(async (request: NextRequest) => { | ||
| const authError = verifyCronAuth(request, 'sandbox image cleanup') | ||
| if (authError) return authError | ||
|
|
||
| try { | ||
| const result = await runCleanupSandboxImages() | ||
| return NextResponse.json({ success: true, ...result }) | ||
| } catch (error) { | ||
| logger.error('Failed to sweep sandbox images', { error }) | ||
| return NextResponse.json( | ||
| { error: getErrorMessage(error, 'Failed to sweep sandbox images') }, | ||
| { status: 500 } | ||
| ) | ||
| } | ||
| }) |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.