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

[Release] Milestones M195 #1821

Merged
merged 16 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
# especially
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot#enabling-dependabot-version-updates-for-actions

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
24 changes: 12 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: src

- name: Install .NET SDK
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 5.0.201

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2.0.0

- name: Build VFS for Git
shell: cmd
Expand All @@ -42,25 +42,25 @@ jobs:
run: src\scripts\CreateBuildArtifacts.bat ${{ matrix.configuration }} artifacts

- name: Upload functional tests drop
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: FunctionalTests_${{ matrix.configuration }}
path: artifacts\GVFS.FunctionalTests

- name: Upload FastFetch drop
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: FastFetch_${{ matrix.configuration }}
path: artifacts\FastFetch

- name: Upload installers
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Installers_${{ matrix.configuration }}
path: artifacts\GVFS.Installers

- name: Upload NuGet packages
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: NuGetPackages_${{ matrix.configuration }}
path: artifacts\NuGetPackages
Expand All @@ -76,13 +76,13 @@ jobs:

steps:
- name: Download installers
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: Installers_${{ matrix.configuration }}
path: install

- name: Download functional tests drop
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: FunctionalTests_${{ matrix.configuration }}
path: ft
Expand All @@ -101,7 +101,7 @@ jobs:

- name: Upload installation logs
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: InstallationLogs_${{ matrix.configuration }}
path: install\logs
Expand All @@ -115,14 +115,14 @@ jobs:

- name: Upload functional test results
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: FunctionalTests_Results_${{ matrix.configuration }}
path: TestResult.xml

- name: Upload Git trace2 output
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: GitTrace2_${{ matrix.configuration }}
path: C:\temp\git-trace2.log
Expand Down
2 changes: 1 addition & 1 deletion GVFS/FastFetch/FastFetch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="MicroBuild.Core" Version="0.2.0" ExcludeAssets="none" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Common/GVFS.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="2.0.278" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="2.0.322" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
Expand Down
51 changes: 51 additions & 0 deletions GVFS/GVFS.Common/Http/HttpRequestor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ protected GitEndPointResponseData SendRequest(
{
response = this.client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).GetAwaiter().GetResult();
}
catch (HttpRequestException httpRequestException) when (TryGetResponseMessageFromHttpRequestException(httpRequestException, request, out response))
{
/* HttpClientHandler will automatically resubmit in certain circumstances, such as a 401 unauthorized response when UseDefaultCredentials
* is true but another credential was provided. This resubmit can throw (instead of returning a proper status code) in some case cases, such
* as when there is an exception loading the default credentials.
* If we can extract the original response message from the exception, we can continue and process the original failed status code. */
Tracer.RelatedWarning(responseMetadata, $"An exception occurred while resubmitting the request, but the original response is available.");
}
finally
{
responseWaitTime = requestStopwatch.Elapsed;
Expand Down Expand Up @@ -278,5 +286,48 @@ private static string GetSingleHeaderOrEmpty(HttpHeaders headers, string headerN

return string.Empty;
}

/// <summary>
/// This method is based on a private method System.Net.Http.HttpClientHandler.CreateResponseMessage
/// </summary>
private static bool TryGetResponseMessageFromHttpRequestException(HttpRequestException httpRequestException, HttpRequestMessage request, out HttpResponseMessage httpResponseMessage)
{
var webResponse = (httpRequestException?.InnerException as WebException)?.Response as HttpWebResponse;
if (webResponse == null)
{
httpResponseMessage = null;
return false;
}

httpResponseMessage = new HttpResponseMessage(webResponse.StatusCode);
httpResponseMessage.ReasonPhrase = webResponse.StatusDescription;
httpResponseMessage.Version = webResponse.ProtocolVersion;
httpResponseMessage.RequestMessage = request;
httpResponseMessage.Content = new StreamContent(webResponse.GetResponseStream());
request.RequestUri = webResponse.ResponseUri;
WebHeaderCollection rawHeaders = webResponse.Headers;
HttpContentHeaders responseContentHeaders = httpResponseMessage.Content.Headers;
HttpResponseHeaders responseHeaders = httpResponseMessage.Headers;
if (webResponse.ContentLength >= 0)
{
responseContentHeaders.ContentLength = webResponse.ContentLength;
}

for (int i = 0; i < rawHeaders.Count; i++)
{
string key = rawHeaders.GetKey(i);
if (string.Compare(key, "Content-Length", StringComparison.OrdinalIgnoreCase) != 0)
{
string[] values = rawHeaders.GetValues(i);
if (!responseHeaders.TryAddWithoutValidation(key, values))
{
bool flag = responseContentHeaders.TryAddWithoutValidation(key, values);
}
}
}

return true;

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="CommandLineParser" Version="2.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Installers/GVFS.Installers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemDefinitionGroup>

<ItemGroup>
<PackageReference Include="Tools.InnoSetup" Version="5.5.9" />
<PackageReference Include="Tools.InnoSetup" Version="6.2.1" />
<PackageReference Include="GitForWindows.GVFS.Installer" Version="$(GitPackageVersion)" />
<PackageReference Include="GitForWindows.GVFS.Portable" Version="$(GitPackageVersion)" />
<PackageReference Include="MicroBuild.Core" Version="0.2.0" ExcludeAssets="none" />
Expand Down
6 changes: 5 additions & 1 deletion GVFS/GVFS.Installers/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,12 @@ begin
WizardForm.StatusLabel.Caption := 'Installing GVFS.Service.';
WizardForm.ProgressGauge.Style := npbstMarquee;

// Spaces after the equal signs are REQUIRED.
// https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create#remarks
try
if Exec(ExpandConstant('{sys}\SC.EXE'), ExpandConstant('create GVFS.Service binPath="{app}\GVFS.Service.exe" start=auto'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and (ResultCode = 0) then
// We must add additional quotes to the binPath to ensure that they survive argument parsing.
// Without quotes, sc.exe will try to start a file located at C:\Program if it exists.
if Exec(ExpandConstant('{sys}\SC.EXE'), ExpandConstant('create GVFS.Service binPath= "\"{app}\GVFS.Service.exe\"" start= auto'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and (ResultCode = 0) then
begin
if Exec(ExpandConstant('{sys}\SC.EXE'), 'failure GVFS.Service reset= 30 actions= restart/10/restart/5000//1', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Mount/GVFS.Mount.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="CommandLineParser" Version="2.6.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion GVFS/GVFS/GVFS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="CommandLineParser" Version="2.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
including taking version numbers 2.X.Y from upstream and updating .W if we have any
hotfixes to microsoft/git.
-->
<GitPackageVersion>2.20211115.1</GitPackageVersion>
<GitPackageVersion>2.20220414.4</GitPackageVersion>
<MinimumGitVersion>v2.31.0.vfs.0.1</MinimumGitVersion>
</PropertyGroup>

Expand Down