{"record":{"id":"5c74babd61aa3969","repo":"vectordotdev/vector","slug":"deprecation-fragment-what-field-must-not-be-empty","errorCode":null,"errorMessage":"Deprecation fragment {}: `what` field must not be empty","messagePattern":"Deprecation fragment (.+?): `what` field must not be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/deprecation.rs","lineNumber":181,"sourceCode":"}\n\nfn parse_deprecation_fragment(path: &Path) -> Result<DeprecationEntry> {\n    let filename = path\n        .file_name()\n        .and_then(|n| n.to_str())\n        .unwrap_or(\"\")\n        .to_string();\n\n    let raw =\n        fs::read_to_string(path).with_context(|| format!(\"Failed to read {}\", path.display()))?;\n\n    let (frontmatter_str, body) = split_frontmatter(&raw, path)?;\n\n    let fm: Frontmatter = serde_yaml::from_str(frontmatter_str)\n        .with_context(|| format!(\"Failed to parse YAML frontmatter in {}\", path.display()))?;\n\n    if fm.what.trim().is_empty() {\n        bail!(\n            \"Deprecation fragment {}: `what` field must not be empty\",\n            path.display()\n        );\n    }\n\n    Ok(DeprecationEntry {\n        filename,\n        what: fm.what.trim().to_string(),\n        deprecated_since: fm.deprecated_since,\n        description: body.trim().to_string(),\n    })\n}\n\n/// Split the raw file contents into the frontmatter string and the body.\n/// The file must begin with `---`, and have a closing `---` on its own line.\nfn split_frontmatter<'a>(content: &'a str, path: &Path) -> Result<(&'a str, &'a str)> {\n    let content = content.trim_start();\n    // Advance past the opening `---` (and optional trailing whitespace on that line)","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/utils/deprecation.rs#L163-L199","documentation":"Each deprecation fragment must carry a non-empty `what` field identifying the deprecated feature. After parsing frontmatter, `parse_deprecation_fragment` trims the value and bails if it is empty, since an unnamed deprecation cannot be tracked or published.","triggerScenarios":"Adding a fragment file in changelog.d with `what:` empty, whitespace-only, or omitted, then running the deprecation tooling that parses fragments.","commonSituations":"Creating a fragment from a template and forgetting to fill in `what`; accidentally deleting the line during an edit; YAML frontmatter with `what: \"\"` from scripted generation.","solutions":["Open the file named in the error and set a descriptive `what` value naming the deprecated item","Ensure there is no leading/trailing whitespace making it appear empty after trim","Validate the fragment against existing examples in changelog.d","Re-run the deprecation check after fixing"],"exampleFix":"// before\n---\nwhat: \"\"\nremoved_in: 0.48.0\n---\n// after\n---\nwhat: \"kafka source `encoding` option\"\nremoved_in: 0.48.0\n---","handlingStrategy":"validation","validationCode":"fn valid_frontmatter(raw: &str) -> bool {\n    let fm = raw.trim_start_matches(\"---\")\n        .split(\"---\").next().unwrap_or(\"\");\n    fm.lines().any(|l| l.starts_with(\"what:\") && !l.trim_start_matches(\"what:\").trim().is_empty())\n}\nassert!(valid_frontmatter(fragment_text));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never leave template placeholders empty; fill `what` when creating the fragment","Review fragment diffs for deleted or emptied frontmatter lines","Run the deprecation check locally before pushing"],"tags":["rust","deprecation","yaml","validation"],"backgroundTag":"empty-required-field","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"}