Skip to content

Add issue and repair for NTP sync failure#165463

Merged
sairon merged 4 commits into
devfrom
hassio-ntp-sync-fail-repair
Mar 18, 2026
Merged

Add issue and repair for NTP sync failure#165463
sairon merged 4 commits into
devfrom
hassio-ntp-sync-fail-repair

Conversation

@sairon

@sairon sairon commented Mar 13, 2026

Copy link
Copy Markdown
Member

Proposed change

Notify user about NTP sync failures and create repair for issue/suggestion added in home-assistant/supervisor#6625.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant

Copy link
Copy Markdown
Contributor

Hey there @home-assistant/supervisor, mind taking a look at this pull request as it has been labeled with an integration (hassio) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of hassio can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign hassio Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

@sairon

sairon commented Mar 13, 2026

Copy link
Copy Markdown
Member Author

Keeping in draft until client library with home-assistant-libs/python-supervisor-client#282 is released for the new constants used in tests.

@sairon

sairon commented Mar 14, 2026

Copy link
Copy Markdown
Member Author

Can be made ready for merge after this is merged:

Notify user about NTP sync failures and create repair for issue/suggestion
added in home-assistant/supervisor#6625.
@sairon sairon force-pushed the hassio-ntp-sync-fail-repair branch from 351ac66 to 6365a0f Compare March 16, 2026 12:15
@sairon sairon marked this pull request as ready for review March 16, 2026 12:15
Copilot AI review requested due to automatic review settings March 16, 2026 12:15

Copilot AI 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.

Pull request overview

Adds a repair flow for NTP sync failure issues reported by the Supervisor, notifying users when NTP time servers are unreachable and the system clock was corrected.

Changes:

  • Added NTP sync failed issue key to the set of known supervisor issues
  • Added user-facing strings for the NTP repair flow (title, description, abort message)
  • Added tests for the NTP repair flow (success, error, and issue creation paths)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
homeassistant/components/hassio/issues.py Registers issue_system_ntp_sync_failed as a known issue key
homeassistant/components/hassio/strings.json Adds repair flow strings (title, step description, abort message)
tests/components/hassio/test_repairs.py Tests for NTP repair flow success and error paths
tests/components/hassio/test_issues.py Test for NTP sync failed issue creation via supervisor event

You can also share your feedback on Copilot code review. Take the survey.

Comment thread homeassistant/components/hassio/strings.json Outdated
Comment thread homeassistant/components/hassio/strings.json Outdated
@home-assistant home-assistant Bot marked this pull request as draft March 16, 2026 14:48
@home-assistant

Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Co-authored-by: Stefan Agner <stefan@agner.ch>
Copilot AI review requested due to automatic review settings March 18, 2026 15:45
Co-authored-by: Stefan Agner <stefan@agner.ch>

Copilot AI 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.

Pull request overview

Adds Home Assistant (Hass.io/Supervisor) Repairs support for the Supervisor’s ntp_sync_failed issue so users are notified and can apply the enable_ntp suggestion via a guided fix flow.

Changes:

  • Register issue_system_ntp_sync_failed as a Supervisor issue that should create a Repairs entry.
  • Add user-facing translations for the new issue and its fix-flow step (system_enable_ntp).
  • Add tests covering issue creation/listing and the successful/failed repair flow behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
homeassistant/components/hassio/issues.py Adds the NTP sync failure issue key to the set of Supervisor issues that should surface as Repairs.
homeassistant/components/hassio/strings.json Adds title + fix-flow text (step + abort reason) for the new issue key.
tests/components/hassio/test_issues.py Verifies the Supervisor event produces a fixable Repairs issue for ntp_sync_failed.
tests/components/hassio/test_repairs.py Verifies the repair flow applies the enable_ntp suggestion and handles apply failures via abort.

You can also share your feedback on Copilot code review. Take the survey.

@sairon sairon marked this pull request as ready for review March 18, 2026 15:56
Copilot AI review requested due to automatic review settings March 18, 2026 15:56
@home-assistant home-assistant Bot requested a review from agners March 18, 2026 15:56

Copilot AI 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.

Pull request overview

Adds Home Assistant-side handling for a new Supervisor resolution issue (ntp_sync_failed) by surfacing it as a Repairs issue and providing a corresponding fix flow translation, plus tests to validate both the issue creation and repair flow behavior.

Changes:

  • Register issue_system_ntp_sync_failed as a Supervisor issue that should create a Repairs entry.
  • Add user-facing Repair flow translations (step + abort reason) for re-enabling NTP.
  • Add tests covering issue creation via Supervisor events and the fix-flow success/error paths.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
homeassistant/components/hassio/issues.py Includes the new NTP sync failure issue key in the set of Supervisor issues that are exposed as Repairs.
homeassistant/components/hassio/strings.json Adds translations for the new issue title and its fix flow step/abort messaging.
tests/components/hassio/test_issues.py Verifies the ntp_sync_failed Supervisor event results in a fixable Repairs issue.
tests/components/hassio/test_repairs.py Verifies the NTP repair flow step id, success completion, and abort-on-failure behavior.

You can also share your feedback on Copilot code review. Take the survey.

@agners

agners commented Mar 18, 2026

Copy link
Copy Markdown
Member

Test failures are unrelated.

@sairon sairon merged commit 412e852 into dev Mar 18, 2026
46 of 47 checks passed
@sairon sairon deleted the hassio-ntp-sync-fail-repair branch March 18, 2026 19:16
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants