Skip to content

feat(update): allow repository override for main updates only#3703

Open
bpinto wants to merge 2 commits intospringfall2008:mainfrom
bpinto:custom-fork
Open

feat(update): allow repository override for main updates only#3703
bpinto wants to merge 2 commits intospringfall2008:mainfrom
bpinto:custom-fork

Conversation

@bpinto
Copy link
Copy Markdown
Contributor

@bpinto bpinto commented Mar 30, 2026

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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_REPOSITORY support for main updates (fork testing).
  • Keep release/tag discovery for select.predbat_update on 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a repository parameter (forwarded to get_github_directory_listing when 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 a repository parameter, 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__)

@bpinto
Copy link
Copy Markdown
Contributor Author

bpinto commented Mar 31, 2026

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 😅

bpinto added 2 commits March 31, 2026 18:02
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.
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.

3 participants