Skip to content

feat(core): report missing configured GitHub references - #5037

Open
dgibbs64 wants to merge 2 commits into
developfrom
feat/4994-branch-error
Open

dgibbs64 wants to merge 2 commits into
developfrom
feat/4994-branch-error

Conversation

@dgibbs64

Copy link
Copy Markdown
Member

Description

When a configured LinuxGSM reference has been mistyped or deleted, report Branch "<branch>" not found on <user>/<repo> and exit before downloading or replacing files. Do not silently switch branches.

Validate through the GitHub contents API at the repository root, so a missing individual file is not mistaken for a missing reference. Tags, commit SHAs and branch names containing / remain supported. Check lazily before downloads and explicitly in update-lgsm, caching the result for the configured user/repository/reference. Cached commands retain their existing offline behaviour and upstream master downloads remain pinned to the installed version tag.

Only HTTP 404 is fatal. API rate limits, DNS failures, timeouts and server errors retain the existing GitHub/Bitbucket download fallback. Probes have a three-second connection timeout and ten-second total timeout. The GitHub API also returns 404 for unavailable repositories; the diagnostic identifies the configured repository alongside the reference.

New modules remain compatible with older launchers: they skip the helper until update-lgsm replaces the launcher, then validation applies on the next invocation. Failure exits directly because loading an exit module could itself require a download from the missing reference.

Fixes #4994

Type of change

  • New feature (a change which adds functionality).

Testing

  • python3 tests/test_branch_validation.py: 14 tests passed, including bootstrap and core downloads, missing references, once-per-reference probing, cached/forced downloads, 403/429/500/503/DNS/timeout fallback, update selection, upstream version pinning, forks, slash-containing branches, tags/SHAs, unrelated repositories and legacy launchers. HTTP responses are mocked; actual Bash function bodies and update repository selection are exercised.
  • Live temporary-installation smoke tests with the complete launcher and real GitHub requests: list succeeded for develop, master, v26.2.0 and commit 2a494011fb636642b9a5d1332a79e359586c54f8. A nonexistent reference exited 1 with the expected diagnostic and no downloaded server list.
  • bash -n and shellcheck passed for all three modified Bash files.
  • Prettier checks passed for the changed Bash files and workflow; Black, Ruff, Pylint and mypy passed for the regression suite.
  • Added a GitHub Actions workflow to run the regression suite on relevant pushes and pull requests.
  • Environment: WSL distribution Ubuntu-24.04, running Ubuntu 26.04.1 LTS. No game server installation or live service was changed.

Risk and rollback

  • Risk level: low. Adds one bounded API request when remote access is already needed; non-404 API failures do not prevent existing fallback.
  • Rollback plan: revert this PR.

Breaking changes

  • No breaking changes.

Documentation impact

  • No documentation update required.

Checklist

  • This pull request links to an issue.
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have provided a detailed enough description of this PR.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 22:23

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dgibbs64 dgibbs64 added this to the v26.4.0 milestone Oct 14, 2026
@github-actions github-actions Bot added the type: feature New feature or request label Oct 14, 2026
@dgibbs64 dgibbs64 removed this from the v26.4.0 milestone Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(core): report a clear error when the configured branch doesn't exist

2 participants