{"record":{"id":"e9b7bee37ea018e4","repo":"vectordotdev/vector","slug":"no-headers-found-in-vrl-changelog-md","errorCode":null,"errorMessage":"No ## headers found in VRL CHANGELOG.md","messagePattern":"No ## headers found in VRL CHANGELOG\\.md","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/prepare.rs","lineNumber":384,"sourceCode":"        String::from_utf8(changelog_output.stdout).context(\"CHANGELOG.md is not valid UTF-8\")?;\n\n    // Extract the first release section (from the first ## to the next ##)\n    let mut section = Vec::new();\n    let mut found_first = false;\n    for line in changelog.lines() {\n        if line.starts_with(\"## \") {\n            if found_first {\n                break;\n            }\n            found_first = true;\n        }\n        if found_first {\n            section.push(line);\n        }\n    }\n\n    if !found_first {\n        bail!(\"No ## headers found in VRL CHANGELOG.md\");\n    }\n\n    Ok(section.join(\"\\n\"))\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::commands::release::prepare::{\n        format_vrl_changelog_block, insert_block_after_changelog, update_vector_package_version,\n        update_vrl_to_version,\n    };\n    use indoc::indoc;\n\n    #[test]\n    fn test_update_vrl_to_version() {\n        let input = indoc! {r#\"\n            [workspace.dependencies]\n            some-other-dep = \"1.0.0\"","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/prepare.rs#L366-L402","documentation":"After fetching the VRL CHANGELOG.md, `get_vrl_changelog` extracts the first release section by scanning lines from the first `## ` heading to the next one. If the document contains no `##` headers at all, it bails because no release section can be extracted. This indicates an unexpected CHANGELOG.md shape upstream.","triggerScenarios":"The VRL CHANGELOG.md fetched via `gh api` during append_vrl_changelog_to_release_cue contains zero lines starting with `## ` — e.g. the file is empty, an error page/JSON body was captured, or the upstream changelog format changed.","commonSituations":"A newly-minted VRL repo whose CHANGELOG.md is a stub without release sections, a gh API call that returned an error payload with exit code 0, or an upstream reformat that switched to `#`/`###` headings.","solutions":["Inspect the fetched CHANGELOG.md content (curl the raw URL or re-run the gh api command) to see what was actually returned.","Verify the VRL repo/tag arguments point at a real release with a populated changelog.","If the upstream format changed, update get_vrl_changelog's heading parsing (`## `) to match the new format.","If the changelog is legitimately empty for the target release, skip the VRL appendix rather than relying on get_vrl_changelog."],"exampleFix":"// before: stub changelog with only a top-level title\n# Changelog\n(empty)\n// after: ensure the upstream file has release sections\n# Changelog\n\n## [0.12.0] - 2026-09-01\n\n- Added ...\n","handlingStrategy":"fallback","validationCode":"# confirm the upstream changelog has release sections before prepare\ncurl -s https://raw.githubusercontent.com/vectordotdev/vrl/master/CHANGELOG.md | grep -m1 '^## ' || echo \"no ## sections found\"","typeGuard":null,"tryCatchPattern":"if let Err(e) = get_vrl_changelog(...) {\n    if e.to_string().contains(\"No ## headers found\") {\n        eprintln!(\"VRL changelog has no release sections; verify upstream content or skip the VRL appendix\");\n    }\n}","preventionTips":["Spot-check the VRL CHANGELOG.md content before each release.","Ensure the fetched document is the raw file, not an API error payload.","Keep parsing tolerant: validate the fetched body looks like markdown before extracting sections."],"tags":["changelog","parsing","vrl","unexpected-content"],"backgroundTag":"empty-result-set","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"}