Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 3, 2025

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 /tags API to determine versions. This approach would select the highest version number from all tags, including development/pre-release tags like v2.99.0.vfs.0.0 that don't have corresponding releases.

When the script attempted to download the .deb file for these unreleased tags, it would fail with:

ERROR: Feature "Microsoft Git for monorepo with GVFS support" (ghcr.io/microsoft/codespace-features/microsoft-git) failed to install!

Changes Made

Modified src/microsoft-git/install.sh to use different GitHub API endpoints based on the requested version:

  • For "latest", "lts", and "current": Now uses /releases/latest API to get the actual latest release, ensuring only released versions are selected and treating all three as synonyms
  • For partial versions: Preserves existing /tags API logic for backward compatibility

The 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:

# Would get highest tag (potentially unreleased) for all aliases
curl /repos/microsoft/git/tags | sort -rV | head -n 1  # → v2.99.0.vfs.0.0 ❌

After this fix:

# Gets actual latest release for latest/lts/current
curl /repos/microsoft/git/releases/latest | jq -r .tag_name  # → v2.43.0.vfs.0.0 ✅

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.

Copy link
Contributor Author

Copilot AI commented Sep 3, 2025

@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>
Copilot AI changed the title [WIP] Microsoft git install from devcontainer broken in codepace prebuilds Fix Microsoft Git install to use releases API for 'latest' version Sep 3, 2025
Copilot AI requested a review from markphip September 3, 2025 14:07
Copilot finished work on behalf of markphip September 3, 2025 14:07
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
Copy link
Contributor

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

Copy link
Contributor Author

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>
@markphip markphip marked this pull request as ready for review September 3, 2025 14:14
Copilot AI changed the title Fix Microsoft Git install to use releases API for 'latest' version Fix Microsoft Git install to use releases API for latest, lts, and current versions Sep 3, 2025
Copilot AI requested a review from markphip September 3, 2025 14:14
Copilot finished work on behalf of markphip September 3, 2025 14:14
@markphip markphip merged commit c84656c into main Sep 3, 2025
6 checks passed
@markphip markphip deleted the copilot/fix-75 branch September 3, 2025 14:26
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.

Microsoft git install from devcontainer broken in codepace prebuilds

2 participants