Match the Lighthouse markers as whole lines #4273
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 250 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4273"
general
weight: 0.35
thc1006
Fixes #4272.
The Lighthouse markers were matched with
strings.Containson every line, so a Corefile whose own comments name#lighthouse-start, or one that lost its end marker to a hand edit, was cut from that line to the end of the file and the new section prepended to what was left. A marker now has to be the first token on its own line, apart from indentation, so a longer word beginning with the same text is not one. The reproducer is in the issue.When they are not one ordered pair the end of the section is unknown, so
removeLighthouseSectionreturns an error and nothing is written:util.MustUpdatecalls the mutate function first. Clusterset DNS then stays unconfigured until the Corefile is repaired by hand, with the error on the reconcile. I preferred that to rewriting a file I cannot delimit. The alternative is to log and skip the Corefile without failing the reconcile.Removal also round-trips the rest of the file exactly now. The old loop appended a newline on every update.
removeLighthouseSectionhas a Ginkgo internal test next to the one forfindCoreDNSListeningPort. The controller spec seedskube-system/corednswith a section whose end marker is missing and asserts that the reconcile fails and the Corefile is unchanged. With the old scan back behind the same signature, 9 of the 10 new specs fail, including the comment case and the controller one; the spec for a Corefile with no section passes either way.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Lighthouse configuration updates now remove generated sections only when their start and end markers are correctly paired.
Marker-like text in other lines is preserved, including when it appears within a longer word. Indented markers are recognized.
Missing, unmatched, or nested markers prevent updates, leaving the existing Corefile unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->