Skip to content

fix(metrics): treat an unreadable objectives file as an unchecked source when retiring a metric - #4645

Merged
vybe merged 1 commit into
Abilityai:devfrom
pcbeingused333:fix/4586-unreadable-objectives-unchecked
Nov 19, 2026
Merged

vybe merged 1 commit into
Abilityai:devfrom
pcbeingused333:fix/4586-unreadable-objectives-unchecked

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #4586

Description

metric_declaration_service._objectives only raised when read_objective_join answered unavailable. When an objective file does not parse, cannot be read, or the read runs out of its time budget, the join answers unavailable: None and puts objective_invalid / objective_unreadable / objectives_read_timeout in findings. _objectives ignored findings, so retiring a metric cited only in such a file reported no objective reference and unchecked: [], and the retire went through without acknowledgement. _widgets already treats its equivalent case (a dashboard.yaml that does not parse) as unchecked (#2196).

_objectives now raises when findings carries one of those three codes, so the source is listed in unchecked and the retire needs the same acknowledgement a real reference would. objective_file_skipped (files the reader refuses because of their name) is left out to keep this to the parse/read failures the issue describes; happy to add it if you want those counted as unchecked too.

Related Issue

Fixes #4586

Journey Impact

Journey Impact: none: only the retire-metric reference check changes, from silently "no objective uses it" to "objectives could not be checked" when an objective file is unreadable

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

  • I have tested this locally
  • New tests added (if applicable)
  • All existing tests pass

New tests in tests/unit/test_ent1006_metric_declaration_service.py run the real _objectives against a faked read_objective_join: each of the three finding codes (parametrized) yields unchecked == ["objectives"], the same with a broken dashboard gives ["objectives", "dashboard"], and a clean read carrying only objective_file_skipped stays not unchecked. Against dev the 6 failure cases fail; with the fix all pass, as do the 32 existing tests in the file and the editor tests.

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation (if applicable)
  • I have not committed any sensitive data (API keys, credentials, etc.)
  • My commits are signed off (git commit -s) — required for contributors outside the core team
  • I have added appropriate logging for new functionality

This PR was prepared with AI assistance (Claude Code); disclosed here as CONTRIBUTING asks.

🤖 Generated with Claude Code

…rce when retiring a metric

Fixes Abilityai#4586

Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
@vybe vybe closed this Nov 19, 2026
@vybe vybe reopened this Nov 19, 2026

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge-train (2026-11-19): validated at bf4c5bb; the backend test job, which had never run on this head, is green after a re-trigger.

@vybe
vybe merged commit c5ba9d3 into Abilityai:dev Nov 19, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants