Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inupdate-lgsm, caching the result for the configured user/repository/reference. Cached commands retain their existing offline behaviour and upstreammasterdownloads 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-lgsmreplaces 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
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.listsucceeded fordevelop,master,v26.2.0and commit2a494011fb636642b9a5d1332a79e359586c54f8. A nonexistent reference exited 1 with the expected diagnostic and no downloaded server list.bash -nandshellcheckpassed for all three modified Bash files.Risk and rollback
Breaking changes
Documentation impact
Checklist