Skip to content
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

feat: add git clone with thinpack option to support self hosted azure devops #446

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CH-Chang
Copy link

@CH-Chang CH-Chang commented Jan 11, 2025

The program uses only the hostname to address the issue of requiring thin pack to perform a git clone operation on Azure DevOps, as shown in the code snippet below.

envbuilder/git/git.go

Lines 56 to 78 in d045c1c

if parsed.Hostname() == "dev.azure.com" {
// Azure DevOps requires capabilities multi_ack / multi_ack_detailed,
// which are not fully implemented and by default are included in
// transport.UnsupportedCapabilities.
//
// The initial clone operations require a full download of the repository,
// and therefore those unsupported capabilities are not as crucial, so
// by removing them from that list allows for the first clone to work
// successfully.
//
// Additional fetches will yield issues, therefore work always from a clean
// clone until those capabilities are fully supported.
//
// New commits and pushes against a remote worked without any issues.
// See: https://github.com/go-git/go-git/issues/64
//
// This is knowingly not safe to call in parallel, but it seemed
// like the least-janky place to add a super janky hack.
transport.UnsupportedCapabilities = []capability.Capability{
capability.ThinPack,
}
logf("Workaround for Azure DevOps: marking thin-pack as unsupported")
}

However, since Azure DevOps supports self-hosted servers, the hostname may not necessarily be dev.azure.com. Therefore, it is desired to add a command-line option to enable this functionality.

@CH-Chang CH-Chang changed the title feat: add git clone with thinkpack option to support self hosted azure devops feat: add git clone with thinpack option to support self hosted azure devops Jan 11, 2025
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.

1 participant