feat(update): allow repository override for main updates only#3703
feat(update): allow repository override for main updates only#3703bpinto wants to merge 2 commits intospringfall2008:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a way to override the GitHub repository used when updating to main (useful for fork-based testing in Docker), while keeping release discovery and tagged version selection pinned to the official upstream repository for stable version matching.
Changes:
- Add
predbat_repository/PREDBAT_REPOSITORYsupport formainupdates (fork testing). - Keep release/tag discovery for
select.predbat_updateon the upstream repo. - Document the new override option and update download tests for the new function signatures.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/install.md | Documents predbat_repository / PREDBAT_REPOSITORY and clarifies it only affects main updates. |
| docs/customisation.md | Adds a brief advanced note pointing to the main-only repository override. |
| apps/predbat/tests/test_download.py | Updates mock signatures to match the new optional repository parameter. |
| apps/predbat/predbat.py | Routes main updates through a configurable repository while keeping releases on upstream. |
| apps/predbat/download.py | Introduces DEFAULT_PREDBAT_REPOSITORY and resolve_predbat_repository(), and threads repository through download helpers. |
| apps/predbat/config.py | Adds predbat_repository to config schema validation. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (2)
apps/predbat/download.py:151
check_install()now accepts arepositoryparameter (forwarded toget_github_directory_listingwhen the manifest is missing), but the docstring doesn’t document it. Adding the parameter description will help clarify why startup pins the repository to upstream.
def check_install(version, repository=None):
"""
Check if Predbat is installed correctly
Args:
version (str): The version string (e.g. v8.30.8)
"""
apps/predbat/download.py:233
predbat_update_download()now accepts arepositoryparameter, but the docstring doesn’t mention it. Please document the parameter and how it affects the GitHub API/raw download URLs.
def predbat_update_download(version, repository=None):
"""
Download the defined version of Predbat from GitHub
"""
this_path = os.path.dirname(__file__)
|
Squashed all previously reviewed commits and pushed a new fixup with the fixes for the latest review. I've also addressed the 2 low confidence comments. Let's see what will copilot comment on next 😅 |
Keep release discovery and version dropdown selection on the official upstream repository to preserve stable version matching. Use predbat_repository/PREDBAT_REPOSITORY only when updating to main, so fork testing works without affecting tagged release options.
Since I'm running predbat via docker, it's been a little bit complicated to test changes to predbat, so I was wondering if a change like this would be welcome. If this configuration option is not welcome, I can try modifying the docker addon so that it's easier to run a custom version of predbat.
P.S.: I really don't like opening PRs for code I haven't tested locally, so feel free to close this PR and I will think of an alternative plan to test my changes locally.
Keep release discovery and version dropdown selection on the official upstream repository to preserve stable version matching.
Use predbat_repository/PREDBAT_REPOSITORY only when updating to main, so fork testing works without affecting tagged release options.