fix(sre): generate error_rate SLO entry instead of empty slos: []#48
Merged
fix(sre): generate error_rate SLO entry instead of empty slos: []#48
Conversation
…ifest Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [BUG-2] Fix empty SLOs in manifest generation
fix(sre): generate error_rate SLO entry instead of empty slos: []
Mar 18, 2026
chefgs
approved these changes
Mar 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes BUG-2 in the SRE scaffolder so --slo-type error_rate produces a non-empty Sloth/OpenSLO slo.yaml manifest, and updates regression coverage + changelog accordingly.
Changes:
- Add an
error_rateSLO entry generator branch ingenerate_slo_manifest(). - Un-xfail the comprehensive regression test covering the
error_rateSLO manifest case. - Add a
0.4.2changelog entry describing the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
cli/scaffold_sre.py |
Adds generation of an error_rate SLO manifest entry (events-based SLI + alerting stanza). |
tests/test_comprehensive.py |
Removes the strict xfail marker for the BUG-2 regression test. |
CHANGELOG.md |
Documents the fix under a new 0.4.2 release section. |
Comments suppressed due to low confidence (1)
tests/test_comprehensive.py:862
- This test docstring still claims the function "currently returns an empty slos list" even though the xfail was removed and the bug is being fixed. Please update the docstring to describe the expected behavior (or remove the BUG-2 wording) so the test remains accurate going forward.
"""
BUG-2: When slo_type='error_rate', generate_slo_manifest() should
return at least one SLO entry capturing the error rate objective,
but currently returns an empty slos list.
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CLI version bump
Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
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.
generate_slo_manifest()had no branch forslo_type="error_rate", so the generatedslo.yamlalways containedslos: []— Sloth/OpenSLO tooling received zero objectives for this type.Changes
cli/scaffold_sre.py— Addederror_ratebranch ingenerate_slo_manifest()producing a named SLO entry with HTTP 5xx-based SLI queries and alerting config (mirrors theavailabilityentry, distinct name/description/runbook). The condition includes"all"so that--slo-type allalso generates theerror_rateentry alongsideavailabilityandlatency:tests/test_comprehensive.py— Removed@pytest.mark.xfail(strict=True)fromtest_slo_manifest_error_rate_bug; test now asserts specifically that an entry withname == "error_rate"is present. Updatedtest_slo_manifest_all_type_has_both_slosto also assert"error_rate"is included whenslo_type="all".cli/__version__.py— Bumped package version to0.4.2.CHANGELOG.md— Added[0.4.2]entry documenting the fix.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.