{"record":{"id":"1c22bb160bf328c0","repo":"badges/shields","slug":"no-jobs-found","errorCode":null,"errorMessage":"no jobs found","messagePattern":"no jobs found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/appveyor/appveyor-job-build.service.js","lineNumber":45,"sourceCode":"          { name: 'repo', example: 'voicetranscoder' },\n          { name: 'job', example: 'Windows' },\n          { name: 'branch', example: 'master' },\n        ),\n      },\n    },\n  }\n\n  transform({ data, jobName }) {\n    if (!('build' in data)) {\n      // this project exists but no builds have been run on it yet\n      return { status: 'no builds found' }\n    }\n\n    const {\n      build: { jobs },\n    } = data\n    if (!jobs) {\n      throw new NotFound({ prettyMessage: 'no jobs found' })\n    }\n\n    const job = jobs.find(j => j.name === jobName)\n\n    if (!job) {\n      throw new NotFound({ prettyMessage: 'job not found' })\n    }\n\n    return { status: job.status }\n  }\n\n  async handle({ user, repo, job, branch }) {\n    const data = await this.fetch({ user, repo, branch })\n    const { status } = this.transform({ data, jobName: job })\n    return renderBuildStatusBadge({ status })\n  }\n}\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/appveyor/appveyor-job-build.service.js#L27-L63","documentation":"The AppVeyor job build service's transform() destructures data.build.jobs and throws NotFound with prettyMessage 'no jobs found' when jobs is missing or falsy. It guards against AppVeyor responses whose build object contains no jobs array, so the badge can render a clear 'not found' style message instead of crashing.","triggerScenarios":"AppVeyor API returns 200 with a build payload lacking a jobs array — e.g. build still queued/starting, buildId exists but has no recorded jobs, or an unexpected payload shape for the branch/account.","commonSituations":"Querying a build ID that was just created and has no jobs yet, AppVeyor API returning a minimal error-shaped payload with 200, self-hosted AppVeyor with different response shape, deleted builds.","solutions":["Confirm the build ID/build version exists on the AppVeyor project page and has completed jobs.","Wait until the build has at least one job before requesting the badge.","Verify the account/project/branch in the badge URL.","Check the raw AppVeyor API response (curl) to confirm build.jobs presence."],"exampleFix":"// before\n{ build: {} } -> NotFound: no jobs found\n// after (correct buildVersion with jobs)\n{ build: { jobs: [{ name: \"Build\", status: \"success\" }] } } -> badge renders","handlingStrategy":"type-guard","validationCode":"const hasJobs = data => Array.isArray(data?.build?.jobs) && data.build.jobs.length > 0\nif (!hasJobs(apiResponse)) throw new Error('build has no jobs yet')","typeGuard":"function buildHasJobs(data) { return !!data && typeof data === 'object' && Array.isArray(data.build?.jobs) && data.build.jobs.length > 0 }","tryCatchPattern":"try {\n  const { status } = await transform(jobName, data)\n} catch (err) {\n  if (err.name === 'NotFound') return renderNotFoundBadge()\n  throw err\n}","preventionTips":["Only request job badges for builds that have started and recorded jobs.","Verify the build ID exists on the project's AppVeyor page.","Check the raw API payload when payloads look unexpected.","Handle still-queued builds gracefully."],"tags":["not-found","appveyor","ci","upstream"],"backgroundTag":"upstream-resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}