mirror of
https://github.com/stablyai/orca.git
synced 2026-10-09 08:02:35 +00:00
Scope completed worktree removal authorization refresh to its repository (#26253)
This commit is contained in:
@@ -24,7 +24,7 @@ import { terminalShellOverrideRefusal } from './terminal-shell-override-host-sup
|
||||
import { resolveTerminalStartupCwd } from '../../shared/terminal-startup-cwd'
|
||||
import { resolveLocalProjectRuntimeForWorktreeId } from '../local-project-runtime-resolution'
|
||||
import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../shared/execution-host'
|
||||
import { invalidateAuthorizedRootsCache } from '../ipc/filesystem-auth'
|
||||
import { invalidateAuthorizedRootsCacheForRepo } from '../ipc/filesystem-auth'
|
||||
import {
|
||||
resumeInterruptedWorktreeRemovals,
|
||||
retryFailedWorktreeRemoval,
|
||||
@@ -124,7 +124,7 @@ export class OrcaRuntimeWithResolveWorktreeRemovalTarget extends OrcaRuntimeWith
|
||||
this.removeWorktreeMetadataAndHistory(store, worktreeId, removalHostId)
|
||||
this.invalidateResolvedWorktreeCache()
|
||||
this.invalidateWorktreeScanCacheForRepo(repoId)
|
||||
invalidateAuthorizedRootsCache()
|
||||
invalidateAuthorizedRootsCacheForRepo(store, repoId)
|
||||
}
|
||||
|
||||
protected removeWorktreeMetadataAndHistory(
|
||||
|
||||
+2
-2
@@ -350,7 +350,7 @@ describe('OrcaRuntimeService', () => {
|
||||
// an unqualified purge would evict a same-id row owned by another host.
|
||||
expect(removeWorktreeMeta).toHaveBeenCalledWith(worktreeId, 'local')
|
||||
expect(deleteWorktreeHistoryDirMock).toHaveBeenCalledWith(worktreeId)
|
||||
expect(invalidateAuthorizedRootsCacheMock).toHaveBeenCalled()
|
||||
expect(invalidateAuthorizedRootsCacheMock).toHaveBeenCalledWith(runtimeStore, TEST_REPO_ID)
|
||||
expect(notifier.worktreesChanged).toHaveBeenCalledWith(TEST_REPO_ID)
|
||||
} finally {
|
||||
await rm(parentDir, { recursive: true, force: true })
|
||||
@@ -376,7 +376,7 @@ describe('OrcaRuntimeService', () => {
|
||||
// an unqualified purge would evict a same-id row owned by another host.
|
||||
expect(removeWorktreeMeta).toHaveBeenCalledWith(worktreeId, 'local')
|
||||
expect(deleteWorktreeHistoryDirMock).toHaveBeenCalledWith(worktreeId)
|
||||
expect(invalidateAuthorizedRootsCacheMock).toHaveBeenCalled()
|
||||
expect(invalidateAuthorizedRootsCacheMock).toHaveBeenCalledWith(runtimeStore, TEST_REPO_ID)
|
||||
expect(notifier.worktreesChanged).toHaveBeenCalledWith(TEST_REPO_ID)
|
||||
} finally {
|
||||
await rm(parentDir, { recursive: true, force: true })
|
||||
|
||||
@@ -489,6 +489,7 @@ describe('OrcaRuntimeService', () => {
|
||||
})
|
||||
)
|
||||
expect(deleteWorktreeHistoryDirMock).toHaveBeenCalledWith(TEST_WORKTREE_ID)
|
||||
expect(invalidateAuthorizedRootsCacheMock).toHaveBeenCalledWith(store, TEST_REPO_ID)
|
||||
expect(result.warning).toBe(
|
||||
`orca.yaml archive hook skipped for ${TEST_WORKTREE_PATH}; pass --run-hooks to run it.`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user