{"record":{"id":"5644130487582eca","repo":"vectordotdev/vector","slug":"release-generation-requires-full-git-history-to-find-the-prs","errorCode":null,"errorMessage":"Release generation requires full Git history to find the PRs that introduced changelog fragments.","messagePattern":"Release generation requires full Git history to find the PRs that introduced changelog fragments\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/generate_cue.rs","lineNumber":530,"sourceCode":"fn 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\n#[cfg(not(test))]\nfn ensure_full_git_history(repo_root: &Path) -> Result<()> {\n    let is_shallow = run_command(\"git\", &[\"rev-parse\", \"--is-shallow-repository\"], repo_root)?;\n    if is_shallow.trim() == \"true\" {\n        bail!(\n            \"Release generation requires full Git history to find the PRs that introduced changelog fragments.\"\n        );\n    }\n    Ok(())\n}\n\n#[cfg(test)]\nfn lookup_pull_requests(_: &Path, _: &Path, _: PullRequestMetadata) -> Result<Vec<u64>> {\n    // Unit tests exercise local parsing and rendering without requiring a Git repository.\n    Ok(vec![42])\n}\n\nfn run_command(cmd: &str, args: &[&str], cwd: &Path) -> Result<String> {\n    let display = format!(\"{cmd} {}\", args.join(\" \"));\n    let output = Command::new(cmd)\n        .args(args)\n        .current_dir(cwd)\n        .output()","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/generate_cue.rs#L512-L548","documentation":"Release generation depends on complete git history to trace which PRs introduced each changelog fragment. `ensure_full_git_history` checks `git rev-parse --is-shallow-repository` and refuses to run in a shallow clone, since PR attribution would be silently incomplete.","triggerScenarios":"Running `vdev release generate-cue` inside a shallow clone (e.g. created by CI with `actions/checkout` default `fetch-depth: 1`, or a manual `git clone --depth 1`).","commonSituations":"Local checkout created by CI runners with shallow fetch; copying a shallow CI workspace; `git clone --depth` used to save bandwidth/time.","solutions":["Unshallow the repository: `git fetch --unshallow` (or `git fetch -- deepen to full history), then re-run.","In GitHub Actions, set `fetch-depth: 0` on the checkout step before running release generation.","Clone the repository without `--depth`/`--shallow-since` for release work."],"exampleFix":"// before (GitHub Actions)\n- uses: actions/checkout@v4\n// after\n- uses: actions/checkout@v4\n  with:\n    fetch-depth: 0","handlingStrategy":"validation","validationCode":"test \"$(git rev-parse --is-shallow-repository)\" = false || { echo 'run: git fetch --unshallow'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use fetch-depth: 0 in CI checkout steps that run release tooling.","Never clone with --depth for release work.","Check shallowness once in a release-runbook script before generation."],"tags":["cli","git","shallow-clone"],"backgroundTag":"git-command-failed","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"}