Add GPM integration
Abstract
GPM stands for Git Package Manager. This PR adds new GPM integration, which offers a native UI for managing custom_components and Lovelace resources.
A user can install a custom_component or Lovelace resource using the HTTP address of a public GIT repository. The address is pasted into a config flow, and GPM handles downloading the latest version and creating the appropriate symlinks. GPM also publishes an update entity to facilitate easy updates of custom_components or Lovelace resources.
GPM is similar to HACS in the following ways:
- GPM also manages
custom_componentsand Lovelace resources. - GPM requires the same repository structure as HACS for GIT repositories of
custom_components(i.e., HACS packages are installable using GPM). - GPM assumes that a new tag or commit must be published to release a new version of a
custom_componentor Lovelace resource.
Compared to HACS:
- GPM allows installation from all remotes, i.e., all GIT repositories that can be referenced using an HTTP address.
- GPM doesn't require a GitHub account.
- GPM intentionally avoids using any 3rd-party APIs (e.g., not showing release notes, not using pre-built release bundles for Lovelace resources).
- GPM is built into the Home Assistant core 🤞.
Overall: GPM is a lightweight and more flexible alternative to HACS for advanced users.
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] 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
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/34784
Checklist
- [x] The code change is tested and works locally.
- [x] Local tests pass. Your PR cannot be merged unless tests pass
- [x] There is no commented out code in this PR.
- [x] I have followed the development checklist
- [x] I have followed the perfect PR recommendations
- [x] The code has been formatted using Ruff (
ruff format homeassistant tests) - [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated for www.home-assistant.io
If the code communicates with devices, web services, or third-party tools:
- [x] The manifest file has all fields filled out correctly.
Updated and included derived files by running:python3 -m script.hassfest. - [x] New or updated dependencies have been added to
requirements_all.txt.
Updated by runningpython3 -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:
- [x] I have reviewed two other open pull requests in this repository.
@tomasbedrich Please fill in the PR description
The CI is failing, can you take a look?
I have updated tests to pass when executed in parallel. There are still some minor issues with code-coverage, I'm going to resolve that later. Would you mind performing a full review, until then?
Hi there @tomasbedrich 👋
We have discussed this integration with the core team and decided not to merge it into Home Assistant Core. There are multiple reasons for this. For example, HACS is also an external third-party integration, as it aims to aid with custom integrations, and the Home Assistant project doesn't support custom integrations. Additionally, this integration directly interacts with GitHub for handling updates and pull data from. This is something HACS also used to do (and still partially does when the repository isn't in their index); which adds quite the load on GitHub that we don't want to give them from the Core perspective.
I think the above covers the most important concerns. Nevertheless, thanks for being willing to contribute! You are free to publish this as a custom integration of course 👍
../Frenck
Hi @frenck,
Thanks for bringing this up within the core team. 🙏🏻
Just trying to understand the rationale: so the official position is "Home Assistant project won't support custom integrations". That would justify why HACS is still kept as 3rd party project, which in turn applies to GPM as well. Is that right?
Additionally, this integration directly interacts with GitHub for handling updates and pull data from.
To clarify this: GPM only uses plain git fetch to interact with GitHub (or any other GIT remote). My perception is that GIT remotes are specifically designed for this type of load, compared to GitHub API calls performed by HACS.
Nevertheless, I respect the decision and thank you for all the time invested into the community! Have a nice Christmas time 🎄