{"record":{"id":"b257f7f9bce5580e","repo":"vectordotdev/vector","slug":"no-changelog-fragments-detected-if-no-changes-necessitate","errorCode":null,"errorMessage":"No changelog fragments detected. If no changes necessitate user-facing explanations, add the 'no-changelog' label. Otherwise, add fragments to {CHANGELOG_DIR}/ (see {CHANGELOG_DIR}/README.md).","messagePattern":"No changelog fragments detected\\. If no changes necessitate user-facing explanations, add the 'no-changelog' label\\. Otherwise, add fragments to (.+?)/ \\(see (.+?)/README\\.md\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/check/changelog_fragments.rs","lineNumber":52,"sourceCode":"        let changelog_dir = repo_root.join(CHANGELOG_DIR);\n        if !changelog_dir.is_dir() {\n            bail!(\n                \"No {CHANGELOG_DIR}/ directory at {}. Run this from the Vector repo root.\",\n                repo_root.display()\n            );\n        }\n\n        // The gate \"did the PR add a new fragment?\" uses A (added) only — modifying an\n        // existing on-master fragment doesn't count toward the required changelog entry.\n        // Schema validation, on the other hand, must see M (modified) fragments too.\n        let is_real_fragment =\n            |p: &PathBuf| p.file_name().and_then(|s| s.to_str()) != Some(\"README.md\");\n        let added_real: Vec<PathBuf> = diff_fragments(&self.merge_base, \"A\")?\n            .into_iter()\n            .filter(is_real_fragment)\n            .collect();\n        if added_real.is_empty() {\n            bail!(\n                \"No changelog fragments detected. \\\n                 If no changes necessitate user-facing explanations, add the 'no-changelog' label. \\\n                 Otherwise, add fragments to {CHANGELOG_DIR}/ (see {CHANGELOG_DIR}/README.md).\"\n            );\n        }\n        if added_real.len() > self.max_fragments {\n            bail!(\n                \"Too many changelog fragments ({} > {}).\",\n                added_real.len(),\n                self.max_fragments\n            );\n        }\n\n        // Every touched fragment (added or modified) must pass the schema check.\n        let modified: Vec<PathBuf> = diff_fragments(&self.merge_base, \"M\")?\n            .into_iter()\n            .filter(is_real_fragment)\n            .collect();","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/check/changelog_fragments.rs#L34-L70","documentation":"The checker's primary gate is 'did this PR add at least one new changelog fragment?'. It diffs against the merge base filtering status 'A', excludes README.md, and bails when the resulting list is empty, pointing PR authors at the 'no-changelog' label or the fragments directory.","triggerScenarios":"Running `vdev check changelog-fragments` on a branch whose diff vs. merge base adds no fragment files under changelog.d/ (or only adds README.md, which is filtered out).","commonSituations":"Opening a PR with user-facing changes but no fragment; fragments only modified (status M), not added; fragments created but never `git add`-ed so they don't appear in `git diff --diff-filter=A`; wrong merge base (e.g. based on an outdated main).","solutions":["If the change needs no user-facing note, ensure the PR has the 'no-changelog' label in CI config/merge requirements","Add a fragment: `vdev changelog new <type> <slug>` (it auto-stages) or create one in changelog.d/ and `git add` it","Verify the fragment is staged and included in the diff: `git diff --name-only --diff-filter=A $(git merge-base HEAD main)`"],"exampleFix":"# before\n$ vdev check changelog-fragments  # fails: no fragments added\n# after\nvdev changelog new enhancement add-retry-logic\nvdev check changelog-fragments","handlingStrategy":"validation","validationCode":"const added = execSync(`git diff --name-only --diff-filter=A ${mergeBase} -- changelog.d`).toString().trim().split(\"\\n\").filter(f => f && path.basename(f) !== \"README.md\");\nif (added.length === 0 && !hasNoChangelogLabel) addFragmentOrLabel();","typeGuard":null,"tryCatchPattern":"try { runCheck(); } catch (e) { if (/No changelog fragments detected/.test(e.message)) { applyNoChangelogLabel(); } else throw e; }","preventionTips":["Create a fragment for every user-facing change before opening a PR","Ensure `vdev changelog new` staging succeeded (check `git status`)","Add the 'no-changelog' label when no fragment is warranted"],"tags":["git","ci","changelog"],"backgroundTag":"empty-result-set","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"}