{"record":{"id":"b11eaf67d05d6f9e","repo":"koala73/worldmonitor","slug":"sentry-returned-no-resolved-issues-for-org-project-a-project","errorCode":null,"errorMessage":"Sentry returned no resolved issues for ${org}/${project}. A project with history always has some, so this is a misread rather than a clean board: check SENTRY_ORG and SENTRY_PROJECT, and that the token can see this project. Reporting it clean would be the silent pass this audit exists to prevent.","messagePattern":"Sentry returned no resolved issues for (.+?)/(.+?)\\. A project with history always has some, so this is a misread rather than a clean board: check SENTRY_ORG and SENTRY_PROJECT, and that the token can see this project\\. Reporting it clean would be the silent pass this audit exists to prevent\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/audit-sentry-resolve-pins.mjs","lineNumber":182,"sourceCode":"  return lines.join('\\n');\n}\n\nexport function formatRepairRecipe() {\n  return [\n    'Only repair a confirmed incompatible pin; preserve valid automatic resolutions.',\n    'Check deployed release identity and recurrence evidence before changing status.',\n    '  1. PUT status=unresolved on the issue.',\n    '  2. GET the issue and confirm status is unresolved.',\n    '  3. PUT status=resolved with no statusDetails.',\n    '  4. GET the issue and confirm statusDetails has no release or commit pin keys.',\n    'Step 1 is not optional. A resolved-to-resolved write silently no-ops and',\n    'leaves the pin in place while reporting success.',\n  ].join('\\n');\n}\n\nexport function assertLiveBoardIsNotEmpty(issues, org, project) {\n  if (Array.isArray(issues) && issues.length > 0) return;\n  throw new Error(\n    `Sentry returned no resolved issues for ${org}/${project}. A project with history always `\n      + 'has some, so this is a misread rather than a clean board: check SENTRY_ORG and '\n      + 'SENTRY_PROJECT, and that the token can see this project. Reporting it clean would be '\n      + 'the silent pass this audit exists to prevent.',\n  );\n}\n\nexport function parseArguments(argv) {\n  const { values } = parseNodeArgs({\n    args: argv,\n    options: {\n      input: { type: 'string' },\n    },\n    allowPositionals: false,\n    strict: true,\n  });\n  return values;\n}","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/koala73/worldmonitor/blob/7d06c8633d256c18e38133030bc3613976a96ec9/scripts/audit-sentry-resolve-pins.mjs#L164-L200","documentation":"assertLiveBoardIsNotEmpty guards against a false 'clean' audit result. A Sentry project with history always has at least some resolved issues, so an empty result means the query misread — wrong org/project env vars or a token that cannot see the project — not that nothing violates the pins. Reporting that as clean would be exactly the silent pass this audit exists to prevent, so it throws.","triggerScenarios":"Calling assertLiveBoardIsNotEmpty with an empty array (or a non-array such as null/undefined) of issues for a given org/project — i.e. the Sentry query succeeded but returned zero rows, or returned nothing at all.","commonSituations":"SENTRY_ORG or SENTRY_PROJECT is mistyped so the query matches an empty or different project; the auth token lacks scope for the intended project and the API returns an empty list instead of an error; env vars point at a different Sentry instance than intended.","solutions":["Verify SENTRY_ORG and SENTRY_PROJECT match the real Sentry slugs (check the project URL in the Sentry UI).","Confirm the auth token has read access to the target project; generate a fresh token if scopes changed.","Query the Sentry API manually (curl with the same token and slug) to check whether resolved issues actually exist.","If the project is genuinely new with no resolved issues, audit a project with history rather than bypassing the assertion."],"exampleFix":"// before\nconst issues = await fetchResolvedIssues(token, org, project);\n// after\nconst issues = await fetchResolvedIssues(token, org, project);\nassertLiveBoardIsNotEmpty(issues, org, project); // throws with remediation hints if empty","handlingStrategy":"validation","validationCode":"if (!Array.isArray(issues) || issues.length === 0) {\n  throw new Error(`No resolved issues for ${org}/${project}; verify SENTRY_ORG, SENTRY_PROJECT, and token scope.`);\n}","typeGuard":"const hasResolvedIssues = (v) => Array.isArray(v) && v.length > 0;","tryCatchPattern":"try {\n  assertLiveBoardIsNotEmpty(issues, org, project);\n} catch (err) {\n  console.error(err.message); // includes org/project and remediation hints\n  process.exitCode = 1;\n}","preventionTips":["Pin SENTRY_ORG and SENTRY_PROJECT in one place and verify slugs against the Sentry UI URL.","Smoke-test the token's project access before the audit runs.","Treat an empty resolved-issue list as a misread, never as success.","Audit a project with known history to keep the check meaningful."],"tags":["sentry","empty-result","env"],"backgroundTag":"empty-result-set","analyzedSha":"7d06c8633d256c18e38133030bc3613976a96ec9","analyzedAt":"2026-09-15T16:44:39.439Z","contentChangedAt":"2026-09-15T16:44:39.439Z","schemaVersion":2},"datasetVersion":"2026-09-15T18:17:12.389Z"}