{"record":{"id":"f1e80b9218dbde55","repo":"vectordotdev/vector","slug":"run-make-generate-docs-locally-to-update-your-branch-and","errorCode":null,"errorMessage":"Run `make generate-docs` locally to update your branch and commit the changes.","messagePattern":"Run `make generate-docs` locally to update your branch and commit the changes\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/check/component_examples.rs","lineNumber":49,"sourceCode":"        let docs = docs_json::render_docs(&repo_root)?;\n        let docs: Value =\n            serde_json::from_slice(&docs).context(\"CUE did not produce valid JSON\")?;\n\n        validate_examples(&repo_root, &repo_root.join(EXAMPLES_DIR), &docs)\n    }\n}\n\nfn check_generated_examples() -> Result<()> {\n    let changed_examples = component_example_changes(git::get_files_changed_from_head()?);\n    if changed_examples.is_empty() {\n        return Ok(());\n    }\n\n    println!(\"Found out-of-sync component examples in this branch:\");\n    for file in changed_examples {\n        println!(\" - {file}\");\n    }\n    bail!(\"Run `make generate-docs` locally to update your branch and commit the changes.\")\n}\n\nfn component_example_changes(files: Vec<String>) -> Vec<String> {\n    files\n        .into_iter()\n        .filter(|file| file.starts_with(EXAMPLES_DIR))\n        .collect()\n}\n\nstruct ValidationCase {\n    key: String,\n    config: YamlValue,\n}\n\nfn validate_examples(repo_root: &Path, examples_dir: &Path, docs: &Value) -> Result<()> {\n    let (cases, total, skipped) = validation_cases(examples_dir, docs)?;\n    let vector_bin = vector_binary(repo_root)?;\n    let jobs = std::env::var(\"VALIDATE_CONFIG_EXAMPLES_JOBS\")","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/check/component_examples.rs#L31-L67","documentation":"`vdev check generated-docs` (component examples) detects that generated component example files under the examples directory are out of sync with the docs metadata in the current branch. It prints the changed files and bails, instructing the developer to regenerate and commit them.","triggerScenarios":"Running the generated-docs check after editing component docs/metadata without re-running `make generate-docs`, leaving files under the examples dir modified relative to git.","commonSituations":"A contributor adds a config option or edits component documentation comments, then CI fails because the auto-generated example configs were not regenerated.","solutions":["Run `make generate-docs` locally.","Commit the regenerated example files.","Re-run `make check-generated-docs` to confirm it passes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"git status --porcelain | grep '^ M' # must be empty after running make generate-docs","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run `make generate-docs` after editing component docs or metadata.","Add the generated-docs check to a pre-push hook (see AGENTS.md).","Commit generated files in the same PR as the source change."],"tags":["docs","codegen","ci","git"],"backgroundTag":"deprecated-api-usage","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"}