{"record":{"id":"c13d190560f5ec86","repo":"badges/shields","slug":"unknown-build-state","errorCode":null,"errorMessage":"unknown build state","messagePattern":"unknown build state","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"warning","filePath":"services/copr/copr.service.js","lineNumber":104,"sourceCode":"      options: {\n        searchParams: {\n          ownername: owner,\n          projectname: project,\n          packagename: packageName,\n          with_latest_build: 'True',\n        },\n      },\n      httpErrors: {\n        404: 'project or package not found',\n      },\n    })\n  }\n\n  transform({ builds }) {\n    const { state } = builds.latest\n    const status = stateStatusMap[state]\n    if (!status) {\n      throw new NotFound({ prettyMessage: 'unknown build state' })\n    }\n    return { status }\n  }\n\n  async handle(\n    { owner, project, package: packageName },\n    { baseUrl = 'https://copr.fedorainfracloud.org' },\n  ) {\n    const json = await this.fetch({\n      baseUrl,\n      owner,\n      project,\n      package: packageName,\n    })\n    const { status } = this.transform(json)\n    return this.constructor.render({ status })\n  }\n}","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/copr/copr.service.js#L86-L122","documentation":"The Copr service maps the latest build's `state` through stateStatusMap; if the state string is not in the map, NotFound with 'unknown build state' is thrown. This guards against Copr introducing new or unexpected build states the badge does not recognize.","triggerScenarios":"transform({ builds }) reads builds.latest.state and the value is absent from stateStatusMap — e.g. a newly added Copr build state, a null/undefined state, or an unexpected API payload.","commonSituations":"Copr API adding a new state value after a platform update, projects whose latest build is in a transient/unusual state, or malformed API responses where builds.latest is null.","solutions":["Check the latest build's state for this project in the Copr web UI and see which value it reports","Retry later — the build may transition to a standard state (succeeded/failed/canceled)","Update the service's stateStatusMap to include the new Copr state if you run a fork","Open an issue with the badge service so the new state value can be mapped"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const KNOWN_STATES = ['succeeded','failed','canceled','starting','importing','running','waiting'];\nif (latestBuild && !KNOWN_STATES.includes(latestBuild.state)) console.warn(`unrecognized Copr state: ${latestBuild.state}`);","typeGuard":"function hasKnownState(build, map) { return build?.state != null && map[build.state] != null; }","tryCatchPattern":"try {\n  const badge = await fetchBadge(`/copr/build/${owner}/${project}/${pkg}`);\n} catch (e) {\n  if (e.status === 404 && e.message.includes('unknown build state')) console.warn('Copr reports a state the badge does not map — check upstream');\n  else throw e;\n}","preventionTips":["Check the build state in the Copr web UI when the badge errors","Retry while a build is in a transient state","Track Copr releases for new state values","Report unmapped states to the badge service maintainers"],"tags":["copr","unmapped-value","upstream","build-state"],"backgroundTag":"unrecognized-enum-value","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}