Skip to content

Commit

Permalink
Integrate more seamlessly with the existing workflows
Browse files Browse the repository at this point in the history
No need for a custom one, we can just add the skip for the SL solution
  • Loading branch information
kzu committed Jun 7, 2024
1 parent 17871a3 commit e732f6a
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 31 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/analyzer.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
url = https://github.com/devlooped/oss/blob/main/.github/workflows/combine-prs.yml
skip

# analyzer.yml is used to build/test the shared analyzer for SponsorLink
[file ".github/workflows/analyzer.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/analyzer.yml
# SponsorLink solution is used to build/test the shared analyzer for SponsorLink
[file "SponsorLink.sln"]
url = https://github.com/devlooped/oss/blob/main/SponsorLink.sln
skip

# strong-naming is less and less relevant nowadays
Expand Down
43 changes: 43 additions & 0 deletions SponsorLink.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.34909.67
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SponsorLink", "src\SponsorLink\SponsorLink\SponsorLink.csproj", "{1E1D01A2-D202-4FAB-B21B-AF21B1C37163}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Analyzer", "src\SponsorLink\Analyzer\Analyzer.csproj", "{87B3A42C-FFA7-49CF-8F3A-656A6D213246}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library", "src\SponsorLink\Library\Library.csproj", "{23371E8B-2401-42A1-9A01-4720D8388105}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "src\SponsorLink\Tests\Tests.csproj", "{A86B253A-340E-4B82-8207-336BF65F36C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1E1D01A2-D202-4FAB-B21B-AF21B1C37163}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E1D01A2-D202-4FAB-B21B-AF21B1C37163}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E1D01A2-D202-4FAB-B21B-AF21B1C37163}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E1D01A2-D202-4FAB-B21B-AF21B1C37163}.Release|Any CPU.Build.0 = Release|Any CPU
{87B3A42C-FFA7-49CF-8F3A-656A6D213246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87B3A42C-FFA7-49CF-8F3A-656A6D213246}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87B3A42C-FFA7-49CF-8F3A-656A6D213246}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87B3A42C-FFA7-49CF-8F3A-656A6D213246}.Release|Any CPU.Build.0 = Release|Any CPU
{23371E8B-2401-42A1-9A01-4720D8388105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23371E8B-2401-42A1-9A01-4720D8388105}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23371E8B-2401-42A1-9A01-4720D8388105}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23371E8B-2401-42A1-9A01-4720D8388105}.Release|Any CPU.Build.0 = Release|Any CPU
{A86B253A-340E-4B82-8207-336BF65F36C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A86B253A-340E-4B82-8207-336BF65F36C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A86B253A-340E-4B82-8207-336BF65F36C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A86B253A-340E-4B82-8207-336BF65F36C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {36BC3C24-D4E3-4EB0-A910-4BE4BD8FE01F}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion src/SponsorLink/SponsorLink/SponsorLinkAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override void Initialize(AnalysisContext context)

SponsorStatus SetStatus(ImmutableArray<AdditionalText> manifests)
{
if (!SponsorLink.TryRead(out var claims, manifests.Select(text =>
if (!SponsorLink.TryRead(out var claims, manifests.Select(text =>
(text.GetText()?.ToString() ?? "", Sponsorables[Path.GetFileNameWithoutExtension(text.Path)]))) ||
claims.GetExpiration() is not DateTime exp)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SponsorLink/Tests/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Sample(ITestOutputHelper output)
[InlineData("", SponsorStatus.Sponsor)]
public void Test(string culture, SponsorStatus kind)
{
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture =
culture == "" ? CultureInfo.InvariantCulture : CultureInfo.GetCultureInfo(culture);

var diag = new DiagnosticsManager().GetDescriptor(["foo"], "bar", "FB", kind);
Expand Down
4 changes: 2 additions & 2 deletions src/SponsorLink/Tests/SponsorLinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public void TryRead()
// Org + personal sponsor
var barSponsor = barSponsorable.Sign([new("sub", "kzu"), new("email", "me@bar.com"), new("roles", "org"), new("roles", "user")], expiration: TimeSpan.FromDays(30));

Assert.True(SponsorLink.TryRead(out var principal,
[(fooSponsor, ToJwk(fooSponsorable.SecurityKey)),
Assert.True(SponsorLink.TryRead(out var principal,
[(fooSponsor, ToJwk(fooSponsorable.SecurityKey)),
(barSponsor, ToJwk(barSponsorable.SecurityKey))]));

// Can check role across both JWTs
Expand Down

0 comments on commit e732f6a

Please sign in to comment.