Skip to content

Conversation

@emontnemery
Copy link
Contributor

@emontnemery emontnemery commented Feb 24, 2025

Proposed change

Add backup helper which contains:

  • A function for wait for the backup manager to be ready and return it
  • A function called by bootstrap which registers basic backup WS API

This allows us to remove backup from after_dependencies of frontend and onboarding

The root issue is that frontend has no way to wait for core integrations to be ready, and we generally work around that by adding integrations which has APIs frontend needs to frontend's after_dependencies or dependencies. However, that has unwanted consequences because frontend is set up very early.

Going forward, we should add a way for frontend to check which integrations will be setup and a way for it to wait for an integration to set up.

The backup helper added by this PR can then be removed.

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

  • 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.

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 link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@arturpragacz
Copy link
Contributor

arturpragacz commented Feb 24, 2025

We still want to load it relatively early. Let's create a new stage for backup and hassio right after recorder. Or maybe after debugger.

@emontnemery
Copy link
Contributor Author

Why do we want to load backup and hassio early?

@arturpragacz
Copy link
Contributor

Because frontend makes that call to the backup WS API, and we probably want that to return as fast as possible.

@arturpragacz
Copy link
Contributor

Unless we don't care about that. If we don't, then we should instead re-add hassio to stage 1, because that is where it was before it all started.

@gjohansson-ST
Copy link
Member

Probably would make sense to "restore" the previous execution order unless we are really sure there are no other dependencies?

@emontnemery
Copy link
Contributor Author

Unless we don't care about that. If we don't, then we should instead re-add hassio to stage 1, because that is where it was before it all started.

Oh, right, it was removed in #137668.
I think someone commented on that PR that we shouldn't remove hassio from stage 1 because it would then be easy to forget adding it back if dependencies change ;)

@zweckj
Copy link
Member

zweckj commented Feb 24, 2025

You'll probably also need to add async_initialize_backup to the tests for webdav & azure_storage

@bdraco bdraco requested a review from jpbede as a code owner February 24, 2025 22:15
@bdraco
Copy link
Member

bdraco commented Feb 24, 2025

Tested on production ✅

@bdraco bdraco added this to the 2025.3.0b0 milestone Feb 24, 2025
@emontnemery emontnemery merged commit bf190a8 into dev Feb 25, 2025
46 checks passed
@emontnemery emontnemery deleted the backup_helper branch February 25, 2025 09:19
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2025
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.

7 participants