Implementing Flow tiered rollout in C#

This add support for setting the tiered rollout percentage in vpk
This commit is contained in:
Kevin Bost
2025-02-13 17:30:38 -08:00
committed by Caelan
parent 588d287ae7
commit e51a3505b6
15 changed files with 153 additions and 54 deletions

View File

@@ -1,14 +1,15 @@
using System.Text;
using Velopack.Sources;
namespace Velopack.Tests;
public class FakeDownloader : Sources.IFileDownloader
public class FakeDownloader : IFileDownloader
{
public string LastUrl { get; private set; }
public string LastLocalFile { get; private set; }
public string LastAuthHeader { get; private set; }
public string LastAcceptHeader { get; private set; }
public byte[] MockedResponseBytes { get; set; } = new byte[0];
public byte[] MockedResponseBytes { get; set; } = [];
public bool WriteMockLocalFile { get; set; } = false;
public Task<byte[]> DownloadBytes(string url, string auth, string acc, double timeout = 30)

View File

@@ -7,7 +7,7 @@ using Velopack.Util;
namespace Velopack.Tests.TestHelpers;
internal class FakeFixtureRepository : Sources.IFileDownloader
internal class FakeFixtureRepository : IFileDownloader
{
private readonly string _pkgId;
private readonly IEnumerable<ReleaseEntry> _releases;

View File

@@ -19,29 +19,30 @@
</Choose>
<ItemGroup>
<Compile Include="..\..\src\vpk\Velopack.Core\SimpleJson.cs" Link="SimpleJson.cs"/>
<Compile Include="..\..\src\vpk\Velopack.Core\SimpleJson.cs" Link="SimpleJson.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.IO.Packaging" Version="9.0.2"/>
<PackageReference Include="System.IO.Packaging" Version="9.0.1" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
<Reference Include="System.Web"/>
<Reference Include="System.Net.Http"/>
<Reference Include="System.IO.Compression"/>
<Reference Include="System.IO.Compression.FileSystem"/>
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)' == 'net6.0'">
<ItemGroup>
<ProjectReference Include="..\..\src\lib-csharp\Velopack.csproj" SetTargetFramework="TargetFramework=netstandard2.0"/>
<ProjectReference Include="..\..\src\lib-csharp\Velopack.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<ProjectReference Include="..\..\src\lib-csharp\Velopack.csproj"/>
<ProjectReference Include="..\..\src\lib-csharp\Velopack.csproj" />
</ItemGroup>
</Otherwise>
</Choose>