fix: parse pre-evaluation rules from Kubernetes specs - #5
Open
ralph-bitgo[bot] wants to merge 1 commit into
Open
fix: parse pre-evaluation rules from Kubernetes specs#5ralph-bitgo[bot] wants to merge 1 commit into
ralph-bitgo[bot] wants to merge 1 commit into
Conversation
ralph-bitgo
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
from
August 27, 2026 04:59
a46e8ae to
9bf5d14
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
from
August 27, 2026 04:59
9bf5d14 to
c2e4137
Compare
ralph-bitgo
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
2 times, most recently
from
August 27, 2026 06:35
24cb64b to
f308c73
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
from
August 27, 2026 06:35
f308c73 to
8c70d10
Compare
ralph-bitgo
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
from
August 27, 2026 06:35
8c70d10 to
fb50275
Compare
Add serialization tags and correct the parser regression fixture so spec.preEvaluationRules is decoded into the internal SLO model. This keeps the PR focused on the unit-test failure that blocks PR4 CI while leaving image and generated-artifact changes out of this branch. Ticket: INF-2854 Session-Id: ef40df3f-0ac9-4787-ae8b-6ecd266e0dc2 Task-Id: 76fd5b3c-13e2-4b4a-bd25-1e4a161bb329
ralph-bitgo
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
from
August 27, 2026 08:06
fb50275 to
f43b0ff
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
from
August 27, 2026 08:06
f43b0ff to
f3a7c69
Compare
ralph-bitgo
Bot
force-pushed
the
fix-pre-evaluation-rule-test
branch
from
August 27, 2026 08:06
f3a7c69 to
3e9ba2d
Compare
There was a problem hiding this comment.
Pull request overview
Fixes Kubernetes YAML decoding and the associated unit test so spec.preEvaluationRules is parsed into the internal Prometheus SLO model as intended.
Changes:
- Added JSON/YAML serialization tags for
PrometheusServiceLevelSpec.PreEvaluationRules. - Updated
TestPreEvaluationRuleParseYAML fixture to use the supported top-levelspec.preEvaluationRulesshape. - Adjusted expected model strings/metadata to match the decoded YAML block-scalar formatting and defaulted alert meta maps.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/kubernetes/api/sloth/v1/types.go | Adds struct tags so Kubernetes decoding maps preEvaluationRules onto the API type field. |
| internal/k8sprometheus/spec_test.go | Fixes the test fixture to the correct CRD shape and updates expectations to match decoded values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
srvk2642
marked this pull request as ready for review
August 27, 2026 09:32
srvk2642
enabled auto-merge
August 27, 2026 09:32
srvk2642
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TestPreEvaluationRuleParsefixture to use the supportedtop-level
spec.preEvaluationRulesmap shape.map
preEvaluationRulesintoPrometheusServiceLevelSpec.Why
blocked by the pre-existing
TestPreEvaluationRuleParsefailure. Thisminimal fix makes the test exercise the actual Kubernetes API shape and
restores parsing of the pre-evaluation rule field, allowing PR4's image-only
change to be validated without adding unrelated generated-artifact changes
to either PR.
Test plan
go test ./internal/k8sprometheus -run TestPreEvaluationRuleParse -count=1go test ./... -count=1git diff --checkRelationship to PR#4
PR#4 remains the sole PR containing
Sloth image replacement changes. PR#5 contains only the minimal parser/test
fix needed to unblock PR#4's unit-test CI. Merge PR#5 first, then validate and
merge PR#4 independently.
Ticket: INF-2854