Skip to content

HGP-68: Report refresh failures and shorten the first refresh - #69

Merged
JtheGunner merged 2 commits into
mainfrom
feat/HGP-68-report-refresh-failures
Nov 27, 2026
Merged

JtheGunner merged 2 commits into
mainfrom
feat/HGP-68-report-refresh-failures

Conversation

@JtheGunner

@JtheGunner JtheGunner commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

YouTrack: https://youtrack.xn--wrm-hoa.li/issue/HGP-68

Summary

A refresh that fails because the GitHub rate limit is used up, the token is refused or GitHub keeps failing now raises a Repairs notice. Repository data also survives the failure of a single batch, and the first refresh is shorter.

  • Repairs issue per data group on rate-limit and forbidden failures, with the reset time when known. A repeated outage (network error or GitHub 5xx on two refreshes in a row) raises one too. Issues clear after the next successful refresh of that group and when the entry unloads.
  • BATCH_SIZE for repository snapshots lowered from 50 to 10.
  • A failing batch of repositories (for example a 502) no longer fails the whole overview group: the other batches are kept and the failed ones fall back to their previous snapshot. Auth, permission and rate-limit errors still abort the fetch, and so does a failure of every batch.
  • A failed first refresh already ends in SETUP_RETRY (Home Assistant turns UpdateFailed into ConfigEntryNotReady); a regression test now covers the repositories module.
  • English and German texts, README note and changelog entry.

Commits

  • feat: report rate-limit and permission failures as repair issues
  • fix: keep repository data when a single batch fails

Test plan

  • pytest -q, ruff check ., ruff format --check . and mypy custom_components pass.
  • Reviewer: make a refresh fail with a rate limit or repeated 502 (for example via the test fakes) and check that the Repairs notice appears and clears after a successful refresh.

A refresh that fails because the GitHub rate limit is used up or the token is
refused now raises a Repairs notice for the affected data group and clears it
on the next successful refresh. Repository snapshots are requested in batches
of 10 instead of 50 so the first refresh of a long list stays short.
A failing batch of repositories (for example a GitHub 502) used to fail the
whole overview group, leaving every repository sensor unavailable after a
restart. The other batches are now kept, the failed ones fall back to their
previous snapshot, and a repeated outage raises a Repairs notice.
@JtheGunner
JtheGunner merged commit f573ff6 into main Nov 27, 2026
4 checks passed
@JtheGunner
JtheGunner deleted the feat/HGP-68-report-refresh-failures branch November 27, 2026 08:01
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.

1 participant