Skip to content

Commit

Permalink
fix some names that were missed
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Jan 27, 2025
1 parent 01609a4 commit d92e15f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/LexBoxApi/Config/FwLiteReleaseConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ namespace LexBoxApi.Config;

public class FwLiteReleaseConfig
{
public Dictionary<FwLiteEdition, FwLitePlatformEdition> Editions { get; set; } = new();
public Dictionary<FwLiteEdition, FwLiteEditionConfig> Editions { get; set; } = new();
}

public class FwLitePlatformEdition
public class FwLiteEditionConfig
{
[Required]
public required string FileNameRegex { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public async ValueTask InvalidateReleaseCache()

private async ValueTask<FwLiteRelease?> FetchLatestReleaseFromGithub(FwLiteEdition edition, CancellationToken token)
{
var platformConfig = config.Value.Editions.GetValueOrDefault(edition);
if (platformConfig is null)
var editionConfig = config.Value.Editions.GetValueOrDefault(edition);
if (editionConfig is null)
{
throw new ArgumentException($"No config for platform {edition}");
throw new ArgumentException($"No config for edition {edition}");
}
using var activity = LexBoxActivitySource.Get().StartActivity();
activity?.AddTag(FwLiteEditionTag, edition.ToString());
Expand Down Expand Up @@ -87,7 +87,7 @@ public async ValueTask InvalidateReleaseCache()
continue;
}

var releaseAsset = release.Assets.FirstOrDefault(a => platformConfig.FileName.IsMatch(a.Name));
var releaseAsset = release.Assets.FirstOrDefault(a => editionConfig.FileName.IsMatch(a.Name));
if (releaseAsset is not null)
{
activity?.AddTag(FwLiteReleaseVersionTag, release.TagName);
Expand Down
4 changes: 2 additions & 2 deletions backend/Testing/LexCore/Services/FwLiteReleaseServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public FwLiteReleaseServiceTests()
.AddHttpClient()
.AddOptions<FwLiteReleaseConfig>().Configure(config =>
{
config.Editions.Add(FwLiteEdition.Windows, new FwLitePlatformEdition() { FileNameRegex = "(?i)\\.msixbundle$" });
config.Editions.Add(FwLiteEdition.Linux, new FwLitePlatformEdition() { FileNameRegex = "(?i)linux\\.zip$" });
config.Editions.Add(FwLiteEdition.Windows, new FwLiteEditionConfig() { FileNameRegex = "(?i)\\.msixbundle$" });
config.Editions.Add(FwLiteEdition.Linux, new FwLiteEditionConfig() { FileNameRegex = "(?i)linux\\.zip$" });
})
.Services
.AddHybridCache()
Expand Down

0 comments on commit d92e15f

Please sign in to comment.