-
Couldn't load subscription status.
- Fork 11
Fix Microsoft Git install to use releases API for latest, lts, and current versions #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@markphip 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: markphip <933108+markphip@users.noreply.github.com>
src/microsoft-git/install.sh
Outdated
| set -e | ||
| # For other cases (lts, current, partial versions), use the existing tags logic | ||
| version_list="$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/microsoft/git/tags?per_page=100" | grep -oP '"name":\s*"v\K[0-9]+\.[0-9]+\.[0-9]+\.vfs\.[0-9]+\.[0-9]+"' | tr -d '"' | sort -rV)" | ||
| if [ "${requested_version}" = "lts" ] || [ "${requested_version}" = "current" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot I think we can actually treat the values of lts and current as synonyms for latest and handle them all the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion! I've simplified the logic to treat 'lts', 'current', and 'latest' as synonyms. All three now use the releases API to get the actual latest release, ensuring they all receive properly released versions instead of potentially unreleased development tags. This also reduces the branching complexity in the code.
Changed in commit ba76547.
All three version types (latest, lts, current) now use the GitHub releases API to get the actual latest release, ensuring they all get properly released versions instead of potentially unreleased development tags. Co-authored-by: markphip <933108+markphip@users.noreply.github.com>
The Microsoft Git devcontainer feature was failing in codespace prebuilds when using
VERSION="latest","lts", or"current"because the install script was using GitHub's/tagsAPI to determine versions. This approach would select the highest version number from all tags, including development/pre-release tags likev2.99.0.vfs.0.0that don't have corresponding releases.When the script attempted to download the
.debfile for these unreleased tags, it would fail with:Changes Made
Modified
src/microsoft-git/install.shto use different GitHub API endpoints based on the requested version:"latest","lts", and"current": Now uses/releases/latestAPI to get the actual latest release, ensuring only released versions are selected and treating all three as synonyms/tagsAPI logic for backward compatibilityThe fix simplifies the version resolution logic while ensuring that all common version aliases get properly released versions instead of potentially unreleased development tags.
Example
Before this fix:
After this fix:
Fixes #75.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.