{"record":{"id":"1899ce4afc2a7369","repo":"badges/shields","slug":"no-milestone","errorCode":null,"errorMessage":"no milestone","messagePattern":"no milestone","errorType":"exception","errorClass":"InvalidResponse","httpStatus":424,"severity":"info","filePath":"services/github/github-issue-detail.service.js","lineNumber":162,"sourceCode":"  render: ({ property, value }) => {\n    const label = property === 'age' ? 'created' : 'updated'\n    return {\n      ...renderDateBadge(value),\n      label,\n    }\n  },\n}\n\nconst milestoneMap = {\n  schema: Joi.object({\n    ...commonSchemaFields,\n    milestone: Joi.object({\n      title: Joi.string().required(),\n    }).allow(null),\n  }).required(),\n  transform: ({ json }) => {\n    if (!json.milestone) {\n      throw new InvalidResponse({ prettyMessage: 'no milestone' })\n    }\n    return json.milestone.title\n  },\n  render: ({ value }) => ({\n    label: 'milestone',\n    message: value,\n    color: 'informational',\n  }),\n}\n\nconst propertyMap = {\n  state: stateMap,\n  title: titleMap,\n  author: authorMap,\n  label: labelMap,\n  comments: commentsMap,\n  age: ageUpdateMap,\n  'last-update': ageUpdateMap,","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/github/github-issue-detail.service.js#L144-L180","documentation":"The GitHub issue-detail service renders a 'milestone' badge from the issue's `milestone` field. The Joi schema declares `milestone` as an object that is `.allow(null)` — GitHub returns null when an issue has no milestone. Since a badge cannot render a null milestone, `transform` throws `InvalidResponse` with 'no milestone'.","triggerScenarios":"Requesting an issue-milestone badge for an issue that has no milestone assigned; API returns 200 with `milestone: null`.","commonSituations":"Issue was never assigned to a milestone; milestone was removed from the issue; querying the wrong issue number.","solutions":["Assign a milestone to the issue on GitHub","Check the issue number/repo in the badge URL","Choose a badge that handles milestone-less issues or guard the request"],"exampleFix":"// before\n/badge/issue-milestone/user/repo/123   // issue has no milestone -> error\n// after (in GitHub) assign issue 123 to milestone 'v2.0'","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  const milestone = await getIssueMilestone(user, repo, issueNumber)\n} catch (e) {\n  if (e.message === 'no milestone') return null // show 'no milestone' placeholder\n  throw e\n}","preventionTips":["Assign a milestone to the issue before using a milestone badge","Double-check the issue number in the badge URL","Be ready for null milestones — GitHub allows issues without them"],"tags":["github","empty-response","milestone"],"backgroundTag":"empty-response-no-data","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}