Dashboard › craft › Distillation
fda2e4e3-b4ff-48d1-816d-15e3aa9b0881["lore_tm_v1_mjxhvVnrlFYKi1CC9eDLDh3zMprYqyB0duGD7juBhhc","lore_tm_v1_k-Edqnvyi1w9KeusXzitT1G3vzJhcNEFKpr4fK51444","lore_tm_v1_SbNHLCWjfrR299_qXnR3DY3Yr3clNopvj6qLKWqIHdU","lore_tm_v1_cvazL5bNZbYHCqEUAn8YnY-EJOgCwA7QAfgrtzJ5HJY"]
Date: Sep 8, 2026
/home/byk/Code/getsentry/publish-root-location-bootstrap/src/publish/discover-location.js./home/byk/Code/getsentry/publish-root-location-bootstrap/src/publish/__tests__/discover-location.js./home/byk/Code/getsentry/publish-root-location-bootstrap/src/modules/publish-location.js.src/publish/discover-location.js is 82 lines and exports { discoverLocation, getWorkspaceNames }; main() parses process.env.PUBLISH_ARGS || "{}", throws "Publish input must define a path." when input.path is absent, invokes discoverLocation() with repositoryDirectory: process.env.PUBLISH_REPOSITORY_DIRECTORY || "__repo__", and writes JSON output under GitHub Actions output key "result".getWorkspaceNames({ repositoryDirectory, exists = existsSync, execFile = execFileSync }) returns [] when path.join(repositoryDirectory, ".craft.yml") is absent; otherwise runs docker run --rm --volume ${path.resolve(repositoryDirectory)}:/github/workspace/__repo__ --workdir /github/workspace/__repo__ getsentry/craft:latest workspace list with { encoding: "utf8" }, parses the output as JSON, and rejects malformed JSON or any non-array output with "Craft workspace discovery returned an invalid workspace list.".src/publish/discover-location.js:51-53: discoverLocation() returns { path: "." } for input.path === "."; all other inputs call resolvePublishLocation({ path: input.path, workspaceNames: getWorkspaceNames({ repositoryDirectory, exists, execFile }) }).src/publish/__tests__/discover-location.js has 5 Vitest tests and uses afterEach(() => vi.restoreAllMocks()): (1) preserves { path: "./packages/cli" } when .craft.yml is absent; (2) root "." returns { path: "." } without calling an execFile mock that would throw "workspace list is unavailable"; (3) Craft output ["packages/CLI"] resolves ./packages/CLI to { path: ".", workspace: "packages/CLI" } and asserts Docker invocation includes "getsentry/craft:latest", "workspace", and "list"; (4) output "{}" fails closed; (5) newline-only output "\n" fails closed.src/modules/publish-location.js resolves only valid publish paths and valid workspace-name arrays: invalid paths throw "Invalid publish path."; invalid workspace entries throw "Craft workspace discovery returned an invalid workspace list."; "." returns { path: "." }; an exact ./<workspace> match returns { path: ".", workspace: <workspace> }; otherwise it returns { path }.isPublishPath() accepts only "." or "./"-prefixed slash-separated safe segments; isSafeWorkspaceSegment() permits /^[A-Za-z0-9_.-]+$/ but rejects ".", "..", "__proto__", and segments beginning with "-". isWorkspaceName() applies this segment validation to every slash-separated workspace-name segment..github/workflows/publish.yml, src/modules/ci-poller-input.js, src/modules/details-from-context.js, src/modules/publish-issue-title.js, src/modules/publish-location.js, src/publish/discover-location.js, src/publish/resolve-location.js, and corresponding tests including src/modules/__tests__/publish-location.js and src/modules/__tests__/publish-workflow.js; full search output was saved at /home/byk/.local/share/opencode/tool-output/tool_0822d7888001GmQAkeNKZ850I9.