Dashboard › craft › Distillation
aa0c246e-a9a4-4bd5-8c7b-6c6458f0754d["lore_tm_v1_p3QlFo_1Ug11FgGCaoBVD3d4tJsAAGp_JlYvDsVjpwI","lore_tm_v1_5bt38FhiQILZ9FwmlaWxQBbRJAkUIMMnv5W6AHZa3UU","lore_tm_v1_fZU7tqeB_zjbRQ3_r-MV1h8XYlP4QGXM_NisYMMW42w","lore_tm_v1_5liPaWgZYhqtpb7Sr8hFSAhJrCmoHRaycHH0yuxpE-c"]
Date: Aug 26, 2026
publish-workspace-acceptance/src/modules/__tests__/publish-workflow.js: getSetTargetsScript() reads ../../../.github/workflows/publish.yml and extracts the Set targets shell block via regex up to uses: docker://getsentry/craft:latest; it throws Missing Set targets workflow script if extraction fails and strips 10-space indentation.runSetTargets({ path, repo, version, workspace = "" }) creates a publish-workflow-test- temp directory, executes the extracted Set targets script with bash -e -c, sets CRAFT_PUBLISH_PATH, CRAFT_PUBLISH_REPO, CRAFT_PUBLISH_TARGETS_JSON='["github"]', CRAFT_PUBLISH_VERSION, CRAFT_PUBLISH_WORKSPACE, GITHUB_OUTPUT, and GITHUB_WORKSPACE, expects exit status 0, then returns the emitted state_file path and its JSON contents. afterEach() recursively removes all temporary directories."uses Craft's legacy root state filename" invokes runSetTargets with path: ".", repo: "sentry", and version: "21.3.1"; expects .craft-state/craft/publish-state-getsentry-sentry-c232c383e26f-21.3.1.json and state { published: { github: true } }."matches Craft's workspace state filename for a monorepo release" invokes runSetTargets with path: "./cli", repo: "toolkit", version: "1.2.3", and workspace: "cli"; expects .craft-state/craft/publish-state-getsentry-toolkit-21cf7beaeda4-workspace-Y2xp-1.2.3.json and state { published: { github: true } }.craft-workspace-action-propagation/src/utils/publishState.ts: publish-resume state was moved from repository-local .craft-publish-<version>.json to $XDG_STATE_HOME/craft/, falling back to $HOME/.local/state/craft/, because repository contents or earlier CI steps could prepopulate the old state file and make Craft incorrectly skip targets.getCraftStateDir() in src/utils/publishState.ts returns join(process.env.XDG_STATE_HOME, 'craft') when XDG_STATE_HOME is nonempty; otherwise it returns join(homedir(), '.local', 'state', 'craft'). In the getsentry/publish Docker image, HOME=/root, making this workflow-writable state location unreachable by committed checkout contents.sanitiseForFilename(raw) lowercases values, replaces runs of characters outside [a-z0-9._-] with _, and strips leading/trailing underscores. shortCwdHash(cwd) is the first 12 hex characters of SHA-1 of the absolute cwd.getPublishStateFilename(version, githubConfig, cwd = process.cwd(), workspace?) uses sanitized version; its optional workspace prefix is lossless base64url encoding: workspace-${Buffer.from(workspace).toString('base64url')}-. This isolates same-repository, same-version resumed publish state for independently selected release workspaces.getPublishStateFilename() produces publish-state-<owner>-<repo>-<sha1(cwd)[:12]>-<workspace-prefix><version>.json, with sanitized owner/repo. Without GitHub config, it produces publish-state-<sha256(cwd)[:16]>-<workspace-prefix><version>.json, preserving state isolation in offline/non-GitHub harnesses without writing inside the repo.getPublishStatePath(version, githubConfig, cwd = process.cwd(), workspace?) returns join(getCraftStateDir(), getPublishStateFilename(version, githubConfig, cwd, workspace)).craft-workspace-action-propagation/vitest.config.mts: Vitest uses globals, Node environment, include: ['src/**/*.test.ts'], excludes **/node_modules/**, **/dist/**, and **/fixtures/**, has testTimeout: 30000, and aliases '^marked$' to marked/lib/marked.umd.js.publish-workspace-acceptance/vitest.config.js: Vitest uses globals, Node environment, clearMocks: true, and includes src/**/__tests__/**/*.js.