Dashboard › craft › Distillation
cc503d3c-0aa9-49ad-82c0-5b3c7e650dd1["lore_tm_v1_TmPSShsRwjvgsbhpA9Z1yCrB9YeFLuYkdigLLq5yzKk"]
Date: Aug 25, 2026
/home/byk/Code/getsentry/publish-workspace-acceptance/src/modules/__tests__/update-issue.js (180 lines). It imports Vitest (vi, describe, test, expect, beforeAll, beforeEach, it) and Node fs, then requires { updateIssue, transformIssueBody } from ../update-issue.js.updateTargetsArgs test fixture uses inputs: { repo: "sentry", version: "21.3.1" }, GitHub context runId: "1234", repository getsentry/publish, issue number "211", and an Octokit mock with actions.getWorkflowRun() returning https://github.com/getsentry/sentry/actions/runs/1234 plus mocked issues.get, issues.update, and issues.removeLabel.beforeAll, the test sets process.env.GITHUB_WORKSPACE = ".", spies on fs.existsSync, mocks fs.promises.readFile to resolve { published: { lol: true, hey: false, github: true } }, and mocks the release issue body containing declared targets github, pypi, docker[release], and docker[latest].describe.each([false, true])("state file exists: %s", ...) verify updateIssue(updateTargetsArgs) checks exactly once for repository-local ./__repo__/.craft-publish-21.3.1.json, exposing the existing acceptance-action dependency on the old Craft state-file path.restore publish state expects issues.get once with { issue_number: "211", owner: "getsentry", repo: "publish" }, expects issues.update once, and verifies the updated body marks github and undeclared target lol as - [x], while pypi and undeclared target hey are - [ ].don't modify issue body expects octokit.rest.issues.update not to be called.remove label expects octokit.rest.issues.removeLabel exactly once with { owner: "getsentry", repo: "publish", issue_number: "211", name: "accepted" }.transformIssueBody test provides publication state { "npm[@sentry/node]": true, "aws-lambda": true, github: false, foo: true }; expected transformation normalizes target checkbox indentation, changes npm[@sentry/node] to checked, retains aws-lambda checked, changes github to unchecked, and appends undeclared foo as - [x] foo before the explanatory “Targets marked with a checkbox…” text.