mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
fix(sandbox): pin neutral entrypoint and persist opencode upgrades across rebuilds
This commit is contained in:
1 parent
cadc283738
commit
f2d0ae0595
14 files changed
+339
-15
No files matched your search
@@ -152,6 +152,22 @@ describe('workspace ownership configuration', () => {
|
||||
expect(compose).toMatch(/^volumes:\n(?:.*\n)*?\s+opencode-workspace:/m)
|
||||
})
|
||||
|
||||
it('mounts a dedicated named volume at /home/node/.opencode/bin with a top-level declaration', () => {
|
||||
const compose = read(composePath)
|
||||
expect(compose).toContain('opencode-bin:/home/node/.opencode/bin')
|
||||
expect(compose).toMatch(/^volumes:\n(?:.*\n)*?\s+opencode-bin:/m)
|
||||
})
|
||||
|
||||
it('persists only the opencode bin directory, not the whole ~/.opencode home', () => {
|
||||
const compose = read(composePath)
|
||||
expect(compose).not.toMatch(/:\/home\/node\/\.opencode(?:\s|$)/)
|
||||
})
|
||||
|
||||
it('lists the opencode-bin volume in the installation docs table', () => {
|
||||
const docs = read(join(repoRoot, 'docs/getting-started/installation.md'))
|
||||
expect(docs).toContain('| `opencode-bin` | `/home/node/.opencode/bin` |')
|
||||
})
|
||||
|
||||
it('keeps the docker docs compose snippet in sync with docker-compose.yml', () => {
|
||||
const compose = read(composePath)
|
||||
const docs = read(dockerDocsPath)
|
||||
@@ -188,6 +204,26 @@ describe('workspace ownership configuration', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('docker lifecycle scripts', () => {
|
||||
it('keeps docker:down non-destructive and docker:reset destructive', () => {
|
||||
const pkg = read(join(repoRoot, 'package.json'))
|
||||
expect(pkg).toContain('"docker:down": "docker-compose down"')
|
||||
expect(pkg).toContain('"docker:reset": "docker-compose down -v"')
|
||||
})
|
||||
|
||||
it('documents the preserved-volume shutdown and the destructive reset', () => {
|
||||
const docs = read(dockerDocsPath)
|
||||
expect(docs).toContain('named volumes are preserved')
|
||||
expect(docs).toContain('docker-compose down -v')
|
||||
})
|
||||
|
||||
it('documents a targeted opencode-bin volume reset that preserves the other volumes', () => {
|
||||
const docs = read(join(repoRoot, 'docs/troubleshooting.md'))
|
||||
expect(docs).toContain('docker volume rm <project>_opencode-bin')
|
||||
expect(docs).toContain('without touching the workspace or database volumes')
|
||||
})
|
||||
})
|
||||
|
||||
describe('sandbox compose overlay', () => {
|
||||
const overlayPath = join(repoRoot, 'docker-compose.sandbox.yml')
|
||||
const overlay = read(overlayPath)
|
||||
|
||||
Reference in new issue
Block a user