{"record":{"id":"6cce5b84b59a594f","repo":"vectordotdev/vector","slug":"could-not-find-latest-addition-commit-latest-addition-in-the","errorCode":null,"errorMessage":"Could not find latest addition commit {latest_addition} in the fragment history","messagePattern":"Could not find latest addition commit (.+?) in the fragment history","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/generate_cue.rs","lineNumber":507,"sourceCode":"            .split_once('\\t')\n            .ok_or_else(|| anyhow!(\"Malformed git log entry `{line}`\"))?;\n\n        match parse_pull_request_number(title) {\n            Ok(number) if !numbers.contains(&number) => numbers.push(number),\n            Ok(_) => {}\n            Err(_) if pull_request_metadata == PullRequestMetadata::Optional => {}\n            Err(error) => return Err(error.context(format!(\"Commit {commit}: `{title}`\"))),\n        }\n\n        if commit == latest_addition {\n            return Ok(numbers);\n        }\n    }\n\n    match pull_request_metadata {\n        PullRequestMetadata::Optional => Ok(Vec::new()),\n        PullRequestMetadata::Required => {\n            bail!(\"Could not find latest addition commit {latest_addition} in the fragment history\")\n        }\n    }\n}\n\nfn parse_pull_request_number(commit_title: &str) -> Result<u64> {\n    let number = commit_title\n        .trim()\n        .strip_suffix(')')\n        .and_then(|title| title.rsplit_once(\"(#\"))\n        .map(|(_, number)| number)\n        .filter(|number| !number.is_empty() && number.bytes().all(|byte| byte.is_ascii_digit()))\n        .ok_or_else(|| anyhow!(\"Commit title must end with `(#<PR number>)`\"))?;\n\n    number\n        .parse()\n        .with_context(|| format!(\"Invalid PR number in commit title `{commit_title}`\"))\n}\n","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/generate_cue.rs#L489-L525","documentation":"After identifying the commit that added the fragment, `parse_pull_request_history` walks the commit history looking for that specific commit hash. If the hash never appears in the parsed history and PR metadata is required, the tool aborts with this message.","triggerScenarios":"The addition commit hash (`latest_addition`) is not present in the output of the history command — e.g. the commit was rebased/rewritten after the file was added, or the history enumeration was truncated by the arguments passed to `git log`.","commonSituations":"History rewriting (rebase, filter-branch, force-push) between fragment addition and release; running on a fork with different history; unusual git log formatting arguments causing the commit line to be skipped by the parser.","solutions":["Verify the commit exists with `git show <latest_addition>`; if missing, the history was rewritten — regenerate the fragment by re-saving it in a new commit.","Run from a branch whose history contains the original fragment-adding commit (e.g. main).","If the fragment is old, consider re-adding it so it gains a fresh, reachable addition commit."],"exampleFix":"// before: commit abc1234 lost after rebase\n// after\ngit mv changelog.d/my-change.bug.md /tmp/ && git commit -m drop && git mv back && git commit -m \"Re-add fragment\"\nvdev release generate-cue 0.46.0","handlingStrategy":"validation","validationCode":"git cat-file -e <addition-commit-hash>^{commit} 2>/dev/null || echo 'addition commit not in history; history was rewritten'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid force-pushing/rebasing main after fragments land.","Verify the adding commit is reachable from the release branch.","Re-add stale fragments so they gain a fresh reachable commit."],"tags":["cli","git","release-tooling"],"backgroundTag":"record-not-found","analyzedSha":"0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}