{"record":{"id":"aa6b48e51e12105a","repo":"vectordotdev/vector","slug":"invalid-fragment-filename-filename-fragment-type-must-be-one","errorCode":null,"errorMessage":"invalid fragment filename '{filename}': fragment type must be one of ({}).","messagePattern":"invalid fragment filename '(.+?)': fragment type must be one of \\((.+?)\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/check/changelog_fragments.rs","lineNumber":175,"sourceCode":"        CHANGELOG_DIR,\n    ])?;\n    Ok(out\n        .lines()\n        .filter(|l| !l.trim().is_empty())\n        .map(PathBuf::from)\n        .collect())\n}\n\nfn validate_filename(filename: &str) -> Result<&'static FragmentType> {\n    let parts: Vec<&str> = filename.split('.').collect();\n    if parts.len() != 3 {\n        bail!(\n            \"invalid fragment filename '{filename}': expected '<unique_name>.<fragment_type>.md'\"\n        );\n    }\n    let fragment_type = parts[1];\n    let Some(known) = FRAGMENT_TYPES.iter().find(|t| t.name == fragment_type) else {\n        bail!(\n            \"invalid fragment filename '{filename}': fragment type must be one of ({}).\",\n            FRAGMENT_TYPES\n                .iter()\n                .map(|t| t.name)\n                .collect::<Vec<_>>()\n                .join(\"|\")\n        );\n    };\n    if parts[2] != \"md\" {\n        bail!(\"invalid fragment filename '{filename}': extension must be markdown (.md).\");\n    }\n    Ok(known)\n}\n\nfn validate_contents(\n    path: &std::path::Path,\n    filename: &str,\n    fragment_type: &FragmentType,","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/check/changelog_fragments.rs#L157-L193","documentation":"The fragment filename has the right shape but its middle segment is not one of the known fragment types (the FRAGMENT_TYPES registry, e.g. enhailement/new-feature/enhancement/bugfix/breaking, joined by '|'). The checker needs a known type to apply type-specific validation.","triggerScenarios":"Running `vdev check changelog-fragments` with a file like `jdoe.typo-fix.md` or `jdoe.feature.md` where `typo-fix`/`feature` is not in FRAGMENT_TYPES.","commonSituations":"Guessing the fragment type name instead of using the scaffolder's options; copying a convention from another project; a type name that was renamed in a newer Vector version.","solutions":["Rename the file using a supported type: pick one from the list printed in the error message.","Run the fragment scaffolder to create a correctly typed file.","If the type seems legitimately missing, check whether this Vector version renamed the fragment types."],"exampleFix":"// before\nchangelog.d/jdoe.feature.md\n// after\nchangelog.d/jdoe.new-feature.md","handlingStrategy":"validation","validationCode":"const FRAGMENT_TYPES: [&str; 5] = [\"new-feature\", \"enhancement\", \"bugfix\", \"breaking\", \"deprecation\"];\nlet name = \"jdoe.feature.md\";\nlet ty = name.split('.').nth(1).unwrap();\nassert!(FRAGMENT_TYPES.contains(&ty), \"unknown fragment type: {ty}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick the fragment type from the scaffolder's menu rather than guessing.","Memorize or alias the valid types printed in the error message.","Check changelog.d/README.md for the current type list after version bumps."],"tags":["rust","changelog","naming","ci"],"backgroundTag":"invalid-enum-value","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"}