ci(config): Fail PRs that edit generated config examples or settings snapshot #61562
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.64) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 319 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.064
Real PR Conversation Timeline
1 comments
"Review active on #61562"
general
weight: 0.35
hush-hush
What does this PR do?
Adds two GitLab lint jobs,
lint_config_examples_not_editedandlint_generatedsettings_not_edited. They start when a PR touchespkg/config/example/orpkg/config/setup/generatedsettings/, list the changed files since the merge base with$COMPARE_TO_BRANCH, drop the files maintained by hand, and fail with an explanation if anything is left.<details>
<summary>Functional changes</summary>
| Before | After |
| --- | --- |
| A PR editing a generated
pkg/config/example/<build-type>_<os>.yaml.examplepassed CI |lint_config_examples_not_editedfails, lists the files, and explains to edit the schema and revert them || A PR editing the generated
.gofiles inpkg/config/setup/generatedsettings/(e.g. after runningschema.codegen-snapshot) passed CI |lint_generatedsettings_not_editedfails, lists the files, and explains why the snapshot isn't edited in PRs || — | A new file added to either folder fails the job too, since only the files maintained by hand are excluded |
Unchanged:
security-agent.yaml.example,application_monitoring.yaml.exampleand the READMEs can still be edited in any PR, as candoc.go,go.modandgo.sumofgeneratedsettings(Renovate anddda inv tidyupdate the last two). The release bot's<x.y.z>/refresh-config-templates-<uuid>and<x.y.z>[-rc.N]/update-release-json-<id>PRs, main, release branches and the merge queue don't run the jobs.</details>
Motivation
Since #59632,
AGENTS.md, thecreate-config-fieldskill and the READMEs say not to edit these files, but PRs still do: #59950 and #60255 changedall_settings.goafter that, and many earlier PRs changed the examples. These files are only refreshed by release automation.Tradeoff:
changes:rules can't exclude paths, so the jobs diff in their script and needGIT_DEPTH: 0. They only run on the PRs touching these two folders.Describe how you validated your changes
Ran the job's script and pathspecs in bash against past commits: #59456 fails both jobs, #60255 fails the generatedsettings job, a Renovate
go.sumbump, #59632 (README) and the lastsecurity-agent.yaml.examplechange pass, and a commit adding a new example and a new.gofile fails both. Not run in a real pipeline yet.Additional Notes
#61572 makes the release automation regenerate the
generatedsettingssnapshot on theupdate-release-jsonbranch of every RC and final version, which is why those branches are exempted.🤖 Generated with Claude Code