Refactor workspace service boundaries (#25152)

This commit is contained in:
Kit Langton 2026-04-30 15:34:37 -04:00 committed by GitHub
commit 0e9d9282c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 421 additions and 405 deletions

View file

@ -50,6 +50,7 @@ const it = testEffect(
NodeHttpServer.layerTest,
NodeServices.layer,
Project.defaultLayer,
Workspace.defaultLayer,
Socket.layerWebSocketConstructorGlobal,
),
)
@ -116,16 +117,17 @@ const syncResponse = (request: HttpServerRequest.HttpServerRequest) => {
const createWorkspace = (input: { projectID: Project.Info["id"]; type: string; adaptor: WorkspaceAdaptor }) =>
Effect.acquireRelease(
Effect.promise(async () => {
Effect.gen(function* () {
registerAdaptor(input.projectID, input.type, input.adaptor)
return Workspace.create({
const workspace = yield* Workspace.Service
return yield* workspace.create({
type: input.type,
branch: null,
extra: null,
projectID: input.projectID,
})
}),
(workspace) => Effect.promise(() => Workspace.remove(workspace.id)).pipe(Effect.ignore),
(info) => Workspace.Service.use((workspace) => workspace.remove(info.id)).pipe(Effect.ignore),
)
const createRemoteWorkspace = (input: {