← Back to Pull requests

ci(config): Fail PRs that edit generated config examples or settings snapshot #61562

Open
unknown opened this pull request with 319 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 27, 2026 14:15 UTC
Author

What does this PR do?

Adds two GitLab lint jobs, lint_config_examples_not_edited and lint_generatedsettings_not_edited. They start when a PR touches pkg/config/example/ or pkg/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.example passed CI | lint_config_examples_not_edited fails, lists the files, and explains to edit the schema and revert them |
| A PR editing the generated .go files in pkg/config/setup/generatedsettings/ (e.g. after running schema.codegen-snapshot) passed CI | lint_generatedsettings_not_edited fails, 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.example and the READMEs can still be edited in any PR, as can doc.go, go.mod and go.sum of generatedsettings (Renovate and dda inv tidy update 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, the create-config-field skill and the READMEs say not to edit these files, but PRs still do: #59950 and #60255 changed all_settings.go after 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 need GIT_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.sum bump, #59632 (README) and the last security-agent.yaml.example change pass, and a commit adding a new example and a new .go file fails both. Not run in a real pipeline yet.

Additional Notes

#61572 makes the release automation regenerate the generatedsettings snapshot on the update-release-json branch of every RC and final version, which is why those branches are exempted.

🤖 Generated with Claude Code

Diff: 319 lines (+239 / -80) across 3 files Reviewer: hush-hush Review duration: 5207m
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
0.64
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 63.6% (MEDIUM) · Higher = larger blast radius
63.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 33.9% · Safe to merge
33.9%