{"record":{"id":"25ccae0402ef4d17","repo":"vectordotdev/vector","slug":"no-valid-semantic-version-tag-found","errorCode":null,"errorMessage":"No valid semantic version tag found","messagePattern":"No valid semantic version tag found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/git.rs","lineNumber":152,"sourceCode":"        .check_output()\n}\n\n/// Returns the latest semver release tag (e.g. `0.55.0`), ignoring `vdev-v…` tags.\npub fn latest_release_version() -> Result<semver::Version> {\n    let output = Command::new(\"git\")\n        .args([\"tag\", \"--list\", \"--sort=-v:refname\"])\n        .check_output()?;\n    let re = regex::Regex::new(r\"^v[0-9]+\\.[0-9]+\\.[0-9]+$\").unwrap();\n    for tag in output.lines() {\n        if tag.starts_with(\"vdev-v\") {\n            continue;\n        }\n        if re.is_match(tag) {\n            return semver::Version::parse(tag.trim_start_matches('v'))\n                .context(\"Failed to parse version from tag\");\n        }\n    }\n    anyhow::bail!(\"No valid semantic version tag found\")\n}\n\n/// Removes a file from the index (and working tree) using `git rm`.\npub fn rm(path: &str) -> Result<String> {\n    Command::new(\"git\").args([\"rm\", path]).check_output()\n}\n\n/// Pushes changes from the current repo\npub fn push() -> Result<String> {\n    Command::new(\"git\").args([\"push\"]).check_output()\n}\n\npub fn push_and_set_upstream(branch_name: &str) -> Result<String> {\n    Command::new(\"git\")\n        .args([\"push\", \"-u\", \"origin\", branch_name])\n        .check_output()\n}\n","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/utils/git.rs#L134-L170","documentation":"latest_release_version lists git tags sorted by version (ignoring `vdev-v…` tags) and parses the first tag matching `^vX.Y.Z$` into a semver Version. If the repository has no release-style tag at all, it bails with \"No valid semantic version tag found\". The tool depends on release tags existing to compute the latest release.","triggerScenarios":"Calling latest_release_version in a repo (often a fresh clone or fork) whose refs contain no tags matching `v<major>.<minor>.<patch>` — or where all tags are `vdev-v…` internal tags or non-semver names.","commonSituations":"Shallow clones (`git clone --depth 1`) or forks that omit tags; running the release/deprecation tooling in a brand-new repo before the first release; tags fetched but not local (no `git fetch --tags`).","solutions":["Fetch all tags: `git fetch --tags --force`, or re-clone without `--depth 1`","Verify a tag like `v0.45.0` exists with `git tag --list 'v*'`; create/push one if this repo should have releases","Run the command from the actual vector repository checkout rather than an empty/forked repo"],"exampleFix":"// before (fresh shallow clone, no tags)\nlet v = latest_release_version()?; // Err: No valid semantic version tag found\n// after\ngit fetch --tags --force\nlet v = latest_release_version()?; // Ok(0.45.0)","handlingStrategy":"validation","validationCode":"let has_tags = std::process::Command::new(\"git\")\n    .args([\"tag\", \"--list\", \"v[0-9]*.[0-9]*.[0-9]*\"])\n    .output()?.stdout.iter().filter(|b| **b == b'\\n').count() > 0;\nif !has_tags { panic!(\"no vX.Y.Z tags; run git fetch --tags first\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clone with full history (avoid --depth 1) and run `git fetch --tags --force`","Check `git tag --list 'v*'` before running release-dependent tooling","In CI, explicitly fetch tags on the checkout step"],"tags":["git","versioning","semver","tags"],"backgroundTag":"empty-result-set","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}