{"record":{"id":"1fb7115da4eabe71","repo":"vectordotdev/vector","slug":"no-changelog-dir-directory-at-run-this-from-the-vector-repo","errorCode":null,"errorMessage":"No {CHANGELOG_DIR}/ directory at {}. Run this from the Vector repo root.","messagePattern":"No (.+?)/ directory at (.+?)\\. Run this from the Vector repo root\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/check/changelog_fragments.rs","lineNumber":36,"sourceCode":"/// Validate changelog fragments added on this branch/PR.\n#[derive(clap::Args, Debug)]\n#[command()]\npub struct Cli {\n    /// Merge base to diff against.\n    #[arg(long, default_value = \"origin/master\")]\n    merge_base: String,\n\n    /// Maximum number of fragments accepted in a single PR.\n    #[arg(long, default_value_t = DEFAULT_MAX_FRAGMENTS)]\n    max_fragments: usize,\n}\n\nimpl Cli {\n    pub fn exec(self) -> Result<()> {\n        let repo_root = paths::find_repo_root()?;\n        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. \\","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/check/changelog_fragments.rs#L18-L54","documentation":"`vdev check changelog-fragments` validates PR changelog fragments against the git diff. It first resolves the repo root and bails when a `changelog.d/` directory does not exist there, since the whole check depends on that directory.","triggerScenarios":"Running the check outside the Vector repository root (or anywhere its find_repo_root result lacks a `changelog.d/` directory), e.g. from a subproject, a bare checkout without changelog.d, or after that directory was deleted/renamed.","commonSituations":"Running vdev from the wrong working directory in CI; checking out only a subdirectory; an old branch from before changelog.d existed; a typo'd repo path.","solutions":["cd to the Vector repository root (the directory containing changelog.d/) and re-run","Verify `ls changelog.d` succeeds in your working context","If the directory is genuinely missing, restore it (`git checkout -- changelog.d`) or add it with a README.md"],"exampleFix":"# before (wrong dir)\n~/some-subdir$ vdev check changelog-fragments\n# after\ncd ~/vector && vdev check changelog-fragments","handlingStrategy":"validation","validationCode":"if (!fs.existsSync(path.join(repoRoot, \"changelog.d\"))) throw new Error(\"run from Vector repo root\");","typeGuard":null,"tryCatchPattern":"try { runCheck(); } catch (e) { if (/No changelog.d\\/ directory/.test(e.message)) process.chdir(findVectorRoot()); runCheck(); }","preventionTips":["Always run vdev checks from the repository root","Pin CI working-directory to the checkout root","Assert changelog.d exists in the CI setup step"],"tags":["git","filesystem","cli"],"backgroundTag":"directory-not-found","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"}