mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
Revert "fix(sandbox-control): a workspace started without a repo gets an empty repository Orca can open"
This reverts commit 0c4ec3ac451e173fe0b0c5840a139b08728fc9fb.
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
# and checked out; if that fails the workspace still opens at the build's commit.
|
||||
# - Otherwise clone ORCA_REPO_URL here so a repo with no commits yet also opens: it gets an empty
|
||||
# first commit on the requested branch, which Orca needs to create the workspace's worktree.
|
||||
# - No repo at all (the user chose "Start empty"): a fresh repository with that same first commit.
|
||||
set -uo pipefail
|
||||
P=/vercel/sandbox/project
|
||||
ROOT=/vercel/sandbox/repos
|
||||
@@ -51,8 +50,5 @@ elif [ ! -e "$P" ] && [ -n "${ORCA_REPO_URL:-}" ]; then
|
||||
fi
|
||||
fi
|
||||
first_commit
|
||||
elif [ ! -e "$P" ]; then
|
||||
git init --quiet "$P" || exit 1
|
||||
first_commit
|
||||
fi
|
||||
exit 0
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -457,12 +457,9 @@ export async function createSandbox(
|
||||
deps.background?.(refill)
|
||||
}
|
||||
const claimedAt = deps.now()
|
||||
// Every first boot gets the prelude: with no repo it makes an empty repository, so Orca can still
|
||||
// create the workspace's worktree in it.
|
||||
const prelude: StartInputs['prelude'] = {
|
||||
script: WORKSPACE_PRELUDE_SCRIPT,
|
||||
env: source?.repoDir ? { ORCA_ENV_REPO_DIR: source.repoDir } : {}
|
||||
}
|
||||
const prelude: StartInputs['prelude'] = request.repo
|
||||
? { script: WORKSPACE_PRELUDE_SCRIPT, env: source?.repoDir ? { ORCA_ENV_REPO_DIR: source.repoDir } : {} }
|
||||
: undefined
|
||||
const id = pooled?.id ?? randomId()
|
||||
// Write-ahead row and the VM-independent prep (secrets, repo token) run together.
|
||||
const [row, prep] = await timer.time('prepare', async () => {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { createHarness } from './harness'
|
||||
|
||||
describe('a workspace started without a repo ("Start empty")', () => {
|
||||
it('still runs the prelude, which makes an empty repository Orca can open', async () => {
|
||||
const h = await createHarness()
|
||||
const created = await h.call('POST', '/v1/sandboxes', {
|
||||
body: { workspaceId: 'empty', machineSize: 'standard' }
|
||||
})
|
||||
expect(created.status).toBe(200)
|
||||
const start = h.vercel.commands.filter((c) => c.command === '/opt/orca/bin/orca-sandbox-start').at(-1)!
|
||||
expect(start.env.ORCA_REPO_URL).toBeUndefined()
|
||||
expect(start.env.ORCA_PRELUDE).toContain('git init --quiet "$P"')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user