{"record":{"id":"e6dfd4899dcdfa78","repo":"badges/shields","slug":"no-tags-found-e6dfd4","errorCode":null,"errorMessage":"no tags found","messagePattern":"no tags found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"info","filePath":"services/gitlab/gitlab-tag.service.js","lineNumber":81,"sourceCode":"\n  async fetch({ project, baseUrl }) {\n    // https://docs.gitlab.com/ee/api/tags.html\n    // N.B. the documentation has contradictory information about default sort order.\n    // As of 2020-10-11 the default is by date, but we add the `order_by` query param\n    // explicitly in case that changes upstream.\n    return super.fetch({\n      schema,\n      url: `${baseUrl}/api/v4/projects/${encodeURIComponent(\n        project,\n      )}/repository/tags`,\n      options: { searchParams: { order_by: 'updated' } },\n      httpErrors: httpErrorsFor('project not found'),\n    })\n  }\n\n  static transform({ tags, sort, includePrereleases }) {\n    if (tags.length === 0) {\n      throw new NotFound({ prettyMessage: 'no tags found' })\n    }\n\n    if (sort === 'date') {\n      return tags[0].name\n    }\n\n    return latest(\n      tags.map(t => t.name),\n      { pre: includePrereleases },\n    )\n  }\n\n  async handle(\n    { project },\n    {\n      gitlab_url: baseUrl = 'https://gitlab.com',\n      include_prereleases: pre,\n      sort,","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/gitlab/gitlab-tag.service.js#L63-L99","documentation":"The GitLab tag service throws this NotFound when the repository has no tags at all. Since sorting (e.g. by date, date+semver) requires at least one tag, an empty list produces a 'no tags found' badge.","triggerScenarios":"Requesting the GitLab tag badge for a repository where the maintainers never ran git push --tags or created any tag; or the project uses releases-only versioning without tags.","commonSituations":"Brand-new repositories; projects that version only via package metadata and never tag; wrong project path in the badge URL pointing to a tagless repo.","solutions":["Create and push a tag (git tag v1.0.0 && git push origin v1.0.0)","Verify the project path in the badge URL refers to the correct repository","If tags are intentionally absent, remove the tag/version badge"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const tags = await (await fetch(`https://gitlab.com/api/v4/projects/${encodeURIComponent(project)}/repository/tags`)).json()\nif (!Array.isArray(tags) || tags.length === 0) console.warn('Repository has no tags')","typeGuard":"const hasTags = (t) => Array.isArray(t) && t.length > 0","tryCatchPattern":"try {\n  const value = GitlabTag.transform({ tags, sort, includePrereleases })\n} catch (e) {\n  if (e.prettyMessage === 'no tags found') {\n    // show 'untagged' or omit badge\n  } else throw e\n}","preventionTips":["Tag releases (git push --tags) so the badge has data","Double-check the project path in the badge URL","Skip tag badges for repos that intentionally do not tag"],"tags":["gitlab","tags","versioning","not-found"],"backgroundTag":"no-tags-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}