mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 13:02:18 +00:00
Refactor Foundry GitHub and sandbox flows
This commit is contained in:
parent
4bccd5fc8d
commit
ec8e816d0d
112 changed files with 4026 additions and 2715 deletions
|
|
@ -1,31 +1,34 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
githubStateKey,
|
||||
historyKey,
|
||||
organizationKey,
|
||||
repositoryKey,
|
||||
sandboxInstanceKey,
|
||||
taskKey,
|
||||
taskStatusSyncKey,
|
||||
historyKey,
|
||||
projectBranchSyncKey,
|
||||
projectKey,
|
||||
projectPrSyncKey,
|
||||
sandboxInstanceKey,
|
||||
workspaceKey,
|
||||
userGithubDataKey,
|
||||
} from "../src/actors/keys.js";
|
||||
|
||||
describe("actor keys", () => {
|
||||
it("prefixes every key with workspace namespace", () => {
|
||||
it("prefixes every key with organization namespace", () => {
|
||||
const keys = [
|
||||
workspaceKey("default"),
|
||||
projectKey("default", "repo"),
|
||||
organizationKey("default"),
|
||||
repositoryKey("default", "repo"),
|
||||
githubStateKey("default"),
|
||||
taskKey("default", "repo", "task"),
|
||||
sandboxInstanceKey("default", "daytona", "sbx"),
|
||||
historyKey("default", "repo"),
|
||||
projectPrSyncKey("default", "repo"),
|
||||
projectBranchSyncKey("default", "repo"),
|
||||
taskStatusSyncKey("default", "repo", "task", "sandbox-1", "session-1"),
|
||||
];
|
||||
|
||||
for (const key of keys) {
|
||||
expect(key[0]).toBe("ws");
|
||||
expect(key[0]).toBe("org");
|
||||
expect(key[1]).toBe("default");
|
||||
}
|
||||
});
|
||||
|
||||
it("uses a separate namespace for user-scoped GitHub auth", () => {
|
||||
expect(userGithubDataKey("user-123")).toEqual(["user", "user-123", "github"]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue