vectordotdev/vector · error
Release generation requires full Git history to find the…
Error message
Release generation requires full Git history to find the PRs that introduced changelog fragments.
What it means
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.
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.
Example fix
// before (GitHub Actions)
- uses: actions/checkout@v4
// after
- uses: actions/checkout@v4
with:
fetch-depth: 0 Defensive patterns
Strategy: validation
Validate before calling
test "$(git rev-parse --is-shallow-repository)" = false || { echo 'run: git fetch --unshallow'; exit 1; } Prevention
- 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.
When it happens
Trigger: 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`).
Common situations: Local checkout created by CI runners with shallow fetch; copying a shallow CI workspace; `git clone --depth` used to save bandwidth/time.
Understand the failure class
Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.
Related errors
- Could not find latest addition commit
- Could not find the commit that added
- ` ` failed (exit )
- Error running `git describe
- No / directory at . Run this from the Vector repo root.
AI-assisted analysis of vectordotdev/vector@0d4ab78a4f (2026-09-16).
Data as JSON: /api/errors/5644130487582eca.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/commands/release/generate_cue.rs:530
fn parse_pull_request_number(commit_title: &str) -> Result<u64> {
let number = commit_title
.trim()
.strip_suffix(')')
.and_then(|title| title.rsplit_once("(#"))
.map(|(_, number)| number)
.filter(|number| !number.is_empty() && number.bytes().all(|byte| byte.is_ascii_digit()))
.ok_or_else(|| anyhow!("Commit title must end with `(#<PR number>)`"))?;
number
.parse()
.with_context(|| format!("Invalid PR number in commit title `{commit_title}`"))
}
#[cfg(not(test))]
fn ensure_full_git_history(repo_root: &Path) -> Result<()> {
let is_shallow = run_command("git", &["rev-parse", "--is-shallow-repository"], repo_root)?;
if is_shallow.trim() == "true" {
bail!(
"Release generation requires full Git history to find the PRs that introduced changelog fragments."
);
}
Ok(())
}
#[cfg(test)]
fn lookup_pull_requests(_: &Path, _: &Path, _: PullRequestMetadata) -> Result<Vec<u64>> {
// Unit tests exercise local parsing and rendering without requiring a Git repository.
Ok(vec![42])
}
fn run_command(cmd: &str, args: &[&str], cwd: &Path) -> Result<String> {
let display = format!("{cmd} {}", args.join(" "));
let output = Command::new(cmd)
.args(args)
.current_dir(cwd)
.output()View on GitHub (pinned to 0d4ab78a4f)