{"record":{"id":"450ea7353996f366","repo":"badges/shields","slug":"no-builds-found","errorCode":null,"errorMessage":"no builds found","messagePattern":"no builds found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/buildbot/buildbot.service.js","lineNumber":96,"sourceCode":"    return renderBuildStatusBadge({ status })\n  }\n\n  async fetch({ baseUrl, builder }) {\n    return this._requestJson({\n      schema,\n      url: `${baseUrl}/api/v2/builders/${encodeURIComponent(builder)}/builds`,\n      options: {\n        searchParams: { limit: '1', order: '-number' },\n      },\n      httpErrors: {\n        404: 'builder not found',\n      },\n    })\n  }\n\n  transform({ builds }) {\n    if (builds.length === 0) {\n      throw new NotFound({ prettyMessage: 'no builds found' })\n    }\n\n    const { complete, results } = builds[0]\n    if (!complete) {\n      return { status: 'building' }\n    }\n\n    return { status: resultMap[results] ?? 'unknown' }\n  }\n\n  async handle({ builder }, { baseUrl }) {\n    const json = await this.fetch({ baseUrl, builder })\n    const { status } = this.transform({ builds: json.builds })\n    return this.constructor.render({ status })\n  }\n}\n","sourceCodeStart":78,"sourceCodeEnd":113,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/buildbot/buildbot.service.js#L78-L113","documentation":"The Buildbot service inspects the builds array from the Buildbot API. If the array is empty, transform throws NotFound 'no builds found' because there is no build to derive status from. If a build exists but is not complete, it renders 'building' instead; the error is reserved for the zero-builds case.","triggerScenarios":"Requesting a Buildbot badge where the builds API returns an empty builds array for the given builder — a nonexistent builder name, a builder that has never run, or filtered queries (e.g. by branch) matching nothing.","commonSituations":"Typo in the builder name in the badge URL; new builder created but never triggered; querying a branch with no builds; Buildbot instance migrated and builders renamed; private instances with restricted API access returning empty lists.","solutions":["Verify the builder name in the badge URL against the Buildbot waterfall view.","Trigger at least one build on the builder/branch being queried.","Remove or broaden query filters (branch, property) that exclude all builds.","Update badges after Buildbot builder renames or instance migrations."],"exampleFix":"// before\n/badge/buildbot/instance/old-builder\n// after\n/badge/buildbot/instance/renamed-builder","handlingStrategy":"validation","validationCode":"const res = await fetch(`${buildbotUrl}/api/v2/builders/${builder}/builds`)\nconst data = await res.json()\nif (!data.builds?.length) throw new Error(`No builds for builder '${builder}'`)","typeGuard":null,"tryCatchPattern":"try {\n  return await buildbotBadge(params)\n} catch (e) {\n  if (e instanceof NotFound) return renderBadge('no builds')\n  throw e\n}","preventionTips":["Verify builder names against the Buildbot waterfall before embedding them in badges","Trigger at least one build on new builders before publishing their status badge","Update badge URLs after builder renames or Buildbot migrations"],"tags":["buildbot","ci","not-found","builds","builder"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}