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] Milestone M193 #1807

Merged
merged 42 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
299b362
Upgrade `update-winget` action to v1.4
ldennington Sep 17, 2021
2675752
Merge pull request #1753 from ldennington/upgrade-winget
ldennington Sep 21, 2021
ffc90e1
Readme: add new winget install instructions
derrickstolee Oct 5, 2021
c846c9b
Update Readme.md
derrickstolee Oct 5, 2021
b05cf32
Merge pull request #1754: Readme: add new winget install instructions
derrickstolee Oct 6, 2021
2e1dafe
Support spaces in paths when compiling
ldennington Oct 12, 2021
35f2885
Update inno installer metadata
ldennington Oct 12, 2021
68d7d38
Run release-winget on Windows Server
ldennington Oct 12, 2021
8748fc2
Merge pull request #1755 from ldennington/update-metadata
ldennington Oct 13, 2021
80a3812
"winget install microsoft-git" finds entries in msstore
Eschryn Oct 15, 2021
96ea5d4
Update Readme.md
Eschryn Oct 15, 2021
21b52c4
Merge pull request #1756: "winget install microsoft-git" finds entrie…
derrickstolee Oct 17, 2021
91c0292
Update winget link to a reference winget-cli repo.
apegushin Oct 27, 2021
8ca91e7
Merge pull request #1759: Update winget link to reference winget-cli …
derrickstolee Oct 28, 2021
da04504
Update Git to v2.34.0.vfs.0.0
derrickstolee Oct 30, 2021
0a80e96
Move expected path from "GVFS" to "VFS for Git"
derrickstolee Nov 1, 2021
416e3d3
install.bat: specify install dir
derrickstolee Nov 1, 2021
8f529a1
Remove flaky packfile maintenance tests
derrickstolee Nov 1, 2021
56d8fc9
Merge pull request #1760: Update Git to v2.34.0.vfs.0.0
derrickstolee Nov 15, 2021
c97079d
Deploy to winget via wingetcreate
ldennington Nov 8, 2021
e826a17
Merge pull request #1761 from ldennington/deploy-with-wingetcreate
ldennington Nov 15, 2021
e190f16
Add a bespoke index.lock file to protect fastfetch operations
SteveBenz Jan 20, 2022
6a7a142
Refactor to do ref and index changes at the very end
SteveBenz Jan 24, 2022
a94cf0d
Get rid of the unneed 'backup' index idea - it's always working on a …
SteveBenz Jan 24, 2022
8f1cdbe
Make it so that the index.lock file is just a lock file, not attempti…
SteveBenz Jan 24, 2022
2cd3558
Merge pull request #1763: Better index locking in FastFetch
derrickstolee Jan 27, 2022
52b7d44
*.csproj: update MicroBuild package names
derrickstolee Jan 31, 2022
183f196
Merge pull request #1765 from derrickstolee/signing
derrickstolee Jan 31, 2022
7587d28
Revert "Merge pull request #1765 from derrickstolee/signing"
derrickstolee Jan 31, 2022
bc2f4cf
Update Readme
Feb 1, 2022
d7ec528
Microsoft mandatory file
microsoft-github-policy-service[bot] Aug 31, 2022
1afab89
Merge pull request #1786: Adding Microsoft SECURITY.MD
derrickstolee Aug 31, 2022
fdfe4d4
gvfs common: remove reference to Nuget.Commands
Oct 13, 2022
e8ebc5e
dependencies: upgrade newtonsoft.json
Oct 13, 2022
3514124
dependencies: upgrade SharpZipLib
Oct 14, 2022
bc1bf29
Merge pull request #1796 from ldennington/remove-nuget-commands-ref
ldennington Oct 14, 2022
797d7f3
index-parser: Do not use DateTime.UtcNow for controlling logging.
neerajsi-msft2 Feb 17, 2021
3790eb0
Merge pull request #1798 from neerajsi-msft/neerajsi/read-index-tickc…
derrickstolee Feb 13, 2023
cf6b45f
fix: #1802 confirm cached credential before rejecting
tyrielv Jan 26, 2024
90cf37d
Style fixes from pull request feeback
tyrielv Feb 15, 2024
cbd0cef
GVFSVerb: Use OAuth credentials by default
derrickstolee Feb 15, 2024
55ba68d
Merge pull request #1803 from tyrielv/gcm-cache
vdye Mar 12, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Run functional tests
shell: cmd
run: |
SET PATH=C:\Program Files\GVFS;%PATH%
SET PATH=C:\Program Files\VFS for Git;%PATH%
SET GIT_TRACE2_PERF=C:\temp\git-trace2.log
ft\GVFS.FunctionalTests.exe /result:TestResult.xml --ci

Expand Down
45 changes: 14 additions & 31 deletions .github/workflows/release-winget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,18 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- id: update-winget
name: Update winget repository
uses: mjcheetham/update-winget@v1.2.2
with:
id: Microsoft.VFSforGit
token: ${{ secrets.WINGET_TOKEN }}
releaseAsset: SetupGVFS.([0-9.]*)\.exe
manifestText: |
PackageIdentifier: {{id}}
PackageVersion: {{version}}
PackageName: VFS for Git
Publisher: Microsoft Corporation
Moniker: vfs-for-git
PackageUrl: https://aka.ms/vfs-for-git
Tags:
- vfs for git
- vfs-for-git
- vfsforgit
- gvfs
License: Copyright (C) Microsoft Corporation
ShortDescription: Virtual File System for Git - a tool to scale Git for monorepo scenarios.
Installers:
- Architecture: x64
InstallerUrl: {{url}}
InstallerType: inno
InstallerSha256: {{sha256}}
PackageLocale: en-US
ManifestType: singleton
ManifestVersion: 1.0.0
alwaysUsePullRequest: true
- name: Publish manifest with winget-create
run: |
# Get correct release asset
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
$asset = $github.release.assets | Where-Object -Property name -match 'SetupGVFS[\d\.]*.exe'

# Remove 'v' from the version
$version = $github.release.tag_name -replace ".v",""

# Download and run wingetcreate
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update Microsoft.VFSforGit -u $asset.browser_download_url -v $version -o manifests -t "${{ secrets.WINGET_TOKEN }}" -s
shell: powershell
150 changes: 78 additions & 72 deletions GVFS/FastFetch/CheckoutPrefetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,85 +72,99 @@ public override void Prefetch(string branchOrCommit, bool isBranch)
commitToFetch = branchOrCommit;
}

this.DownloadMissingCommit(commitToFetch, this.GitObjects);

// Configure pipeline
// Checkout uses DiffHelper when running checkout.Start(), which we use instead of LsTreeHelper
// Checkout diff output => FindBlobs => BatchDownload => IndexPack => Checkout available blobs
CheckoutStage checkout = new CheckoutStage(this.checkoutThreadCount, this.FolderList, commitToFetch, this.Tracer, this.Enlistment, this.forceCheckout);
FindBlobsStage blobFinder = new FindBlobsStage(this.SearchThreadCount, checkout.RequiredBlobs, checkout.AvailableBlobShas, this.Tracer, this.Enlistment);
BatchObjectDownloadStage downloader = new BatchObjectDownloadStage(this.DownloadThreadCount, this.ChunkSize, blobFinder.MissingBlobs, checkout.AvailableBlobShas, this.Tracer, this.Enlistment, this.ObjectRequestor, this.GitObjects);
IndexPackStage packIndexer = new IndexPackStage(this.IndexThreadCount, downloader.AvailablePacks, checkout.AvailableBlobShas, this.Tracer, this.GitObjects);
using (new IndexLock(this.Enlistment.EnlistmentRoot, this.Tracer))
{
this.DownloadMissingCommit(commitToFetch, this.GitObjects);

// Start pipeline
downloader.Start();
blobFinder.Start();
checkout.Start();
// Configure pipeline
// Checkout uses DiffHelper when running checkout.Start(), which we use instead of LsTreeHelper
// Checkout diff output => FindBlobs => BatchDownload => IndexPack => Checkout available blobs
CheckoutStage checkout = new CheckoutStage(this.checkoutThreadCount, this.FolderList, commitToFetch, this.Tracer, this.Enlistment, this.forceCheckout);
FindBlobsStage blobFinder = new FindBlobsStage(this.SearchThreadCount, checkout.RequiredBlobs, checkout.AvailableBlobShas, this.Tracer, this.Enlistment);
BatchObjectDownloadStage downloader = new BatchObjectDownloadStage(this.DownloadThreadCount, this.ChunkSize, blobFinder.MissingBlobs, checkout.AvailableBlobShas, this.Tracer, this.Enlistment, this.ObjectRequestor, this.GitObjects);
IndexPackStage packIndexer = new IndexPackStage(this.IndexThreadCount, downloader.AvailablePacks, checkout.AvailableBlobShas, this.Tracer, this.GitObjects);

blobFinder.WaitForCompletion();
this.HasFailures |= blobFinder.HasFailures;
// Start pipeline
downloader.Start();
blobFinder.Start();
checkout.Start();

// Delay indexing. It interferes with FindMissingBlobs, and doesn't help Bootstrapping.
packIndexer.Start();
blobFinder.WaitForCompletion();
this.HasFailures |= blobFinder.HasFailures;

downloader.WaitForCompletion();
this.HasFailures |= downloader.HasFailures;
// Delay indexing. It interferes with FindMissingBlobs, and doesn't help Bootstrapping.
packIndexer.Start();

packIndexer.WaitForCompletion();
this.HasFailures |= packIndexer.HasFailures;
downloader.WaitForCompletion();
this.HasFailures |= downloader.HasFailures;

// Since pack indexer is the last to finish before checkout finishes, it should propagate completion.
// This prevents availableObjects from completing before packIndexer can push its objects through this link.
checkout.AvailableBlobShas.CompleteAdding();
checkout.WaitForCompletion();
this.HasFailures |= checkout.HasFailures;
packIndexer.WaitForCompletion();
this.HasFailures |= packIndexer.HasFailures;

if (!this.SkipConfigUpdate && !this.HasFailures)
{
this.UpdateRefs(branchOrCommit, isBranch, refs);
// Since pack indexer is the last to finish before checkout finishes, it should propagate completion.
// This prevents availableObjects from completing before packIndexer can push its objects through this link.
checkout.AvailableBlobShas.CompleteAdding();
checkout.WaitForCompletion();
this.HasFailures |= checkout.HasFailures;

if (isBranch)
if (!this.SkipConfigUpdate && !this.HasFailures)
{
// Update the refspec before setting the upstream or git will complain the remote branch doesn't exist
this.HasFailures |= !this.UpdateRefSpec(this.Tracer, this.Enlistment, branchOrCommit, refs);
bool shouldSignIndex = !this.GetIsIndexSigningOff();

using (ITracer activity = this.Tracer.StartActivity("SetUpstream", EventLevel.Informational))
// Update the index - note that this will take some time
EventMetadata updateIndexMetadata = new EventMetadata();
updateIndexMetadata.Add("IndexSigningIsOff", shouldSignIndex);
using (ITracer activity = this.Tracer.StartActivity("UpdateIndex", EventLevel.Informational, Keywords.Telemetry, updateIndexMetadata))
{
string remoteBranch = refs.GetBranchRefPairs().Single().Key;
GitProcess git = new GitProcess(this.Enlistment);
GitProcess.Result result = git.SetUpstream(branchOrCommit, remoteBranch);
if (result.ExitCodeIsFailure)
Index sourceIndex = this.GetSourceIndex();
GitIndexGenerator indexGen = new GitIndexGenerator(this.Tracer, this.Enlistment, shouldSignIndex);
indexGen.CreateFromRef(commitToFetch, indexVersion: 2, isFinal: false);
this.HasFailures |= indexGen.HasFailures;

if (!indexGen.HasFailures)
{
activity.RelatedError("Could not set upstream for {0} to {1}: {2}", branchOrCommit, remoteBranch, result.Errors);
this.HasFailures = true;
Index newIndex = new Index(
this.Enlistment.EnlistmentRoot,
this.Tracer,
indexGen.TemporaryIndexFilePath,
readOnly: false);

// Update from disk only if the caller says it is ok via command line
// or if we updated the whole tree and know that all files are up to date
bool allowIndexMetadataUpdateFromWorkingTree = this.allowIndexMetadataUpdateFromWorkingTree || checkout.UpdatedWholeTree;
newIndex.UpdateFileSizesAndTimes(checkout.AddedOrEditedLocalFiles, allowIndexMetadataUpdateFromWorkingTree, shouldSignIndex, sourceIndex);

// All the slow stuff is over, so we will now move the final index into .git\index, shortly followed by
// updating the ref files and releasing index.lock.
string indexPath = Path.Combine(this.Enlistment.DotGitRoot, GVFSConstants.DotGit.IndexName);
this.Tracer.RelatedEvent(EventLevel.Informational, "MoveUpdatedIndexToFinalLocation", new EventMetadata() { { "UpdatedIndex", indexGen.TemporaryIndexFilePath }, { "Index", indexPath } });
File.Delete(indexPath);
File.Move(indexGen.TemporaryIndexFilePath, indexPath);
newIndex.WriteFastFetchIndexVersionMarker();
}
}
}

bool shouldSignIndex = !this.GetIsIndexSigningOff();

// Update the index
EventMetadata updateIndexMetadata = new EventMetadata();
updateIndexMetadata.Add("IndexSigningIsOff", shouldSignIndex);
using (ITracer activity = this.Tracer.StartActivity("UpdateIndex", EventLevel.Informational, Keywords.Telemetry, updateIndexMetadata))
{
Index sourceIndex = this.GetSourceIndex();
GitIndexGenerator indexGen = new GitIndexGenerator(this.Tracer, this.Enlistment, shouldSignIndex);
indexGen.CreateFromHeadTree(indexVersion: 2);
this.HasFailures |= indexGen.HasFailures;

if (!indexGen.HasFailures)
if (!this.HasFailures)
{
Index newIndex = new Index(
this.Enlistment.EnlistmentRoot,
this.Tracer,
Path.Combine(this.Enlistment.DotGitRoot, GVFSConstants.DotGit.IndexName),
readOnly: false);

// Update from disk only if the caller says it is ok via command line
// or if we updated the whole tree and know that all files are up to date
bool allowIndexMetadataUpdateFromWorkingTree = this.allowIndexMetadataUpdateFromWorkingTree || checkout.UpdatedWholeTree;
newIndex.UpdateFileSizesAndTimes(checkout.AddedOrEditedLocalFiles, allowIndexMetadataUpdateFromWorkingTree, shouldSignIndex, sourceIndex);
this.UpdateRefs(branchOrCommit, isBranch, refs);

if (isBranch)
{
// Update the refspec before setting the upstream or git will complain the remote branch doesn't exist
this.HasFailures |= !this.UpdateRefSpec(this.Tracer, this.Enlistment, branchOrCommit, refs);

using (ITracer activity = this.Tracer.StartActivity("SetUpstream", EventLevel.Informational))
{
string remoteBranch = refs.GetBranchRefPairs().Single().Key;
GitProcess git = new GitProcess(this.Enlistment);
GitProcess.Result result = git.SetUpstream(branchOrCommit, remoteBranch);
if (result.ExitCodeIsFailure)
{
activity.RelatedError("Could not set upstream for {0} to {1}: {2}", branchOrCommit, remoteBranch, result.Errors);
this.HasFailures = true;
}
}
}
}
}
}
Expand Down Expand Up @@ -183,18 +197,10 @@ protected override void UpdateRefs(string branchOrCommit, bool isBranch, GitRefs
private Index GetSourceIndex()
{
string indexPath = Path.Combine(this.Enlistment.DotGitRoot, GVFSConstants.DotGit.IndexName);
string backupIndexPath = Path.Combine(this.Enlistment.DotGitRoot, GVFSConstants.DotGit.IndexName + ".backup");

if (File.Exists(indexPath))
{
// Note that this moves the current index, leaving nothing behind
// This is intentional as we only need it for the purpose of updating the
// new index and leaving it behind can make updating slower.
this.Tracer.RelatedEvent(EventLevel.Informational, "CreateBackup", new EventMetadata() { { "BackupIndexName", backupIndexPath } });
File.Delete(backupIndexPath);
File.Move(indexPath, backupIndexPath);

Index output = new Index(this.Enlistment.EnlistmentRoot, this.Tracer, backupIndexPath, readOnly: true);
Index output = new Index(this.Enlistment.EnlistmentRoot, this.Tracer, indexPath, readOnly: true);
output.Parse();
return output;
}
Expand Down
Loading
Loading