diff --git a/.netconfig b/.netconfig index 581ada5c..5671863f 100644 --- a/.netconfig +++ b/.netconfig @@ -191,8 +191,8 @@ weak [file "src/SponsorLink/SponsorLink/DiagnosticsManager.cs"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/DiagnosticsManager.cs - sha = 040db4d1600367813d37d5e802e7efbb2de839f7 - etag = 16abe935147080f29e81331fbe7ea384ddcf931b3e81eb07ac8983ecd574850e + sha = 29921560c73bb91c2a21a21800daf0b250773598 + etag = a5d79dbc0ed9fac4fb1879fb3790b9ebab18e47c14c454554ce9f53f21487bb5 weak [file "src/SponsorLink/SponsorLink/ManifestStatus.cs"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/ManifestStatus.cs @@ -201,13 +201,13 @@ weak [file "src/SponsorLink/SponsorLink/Resources.es.resx"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.es.resx - sha = 586398c3e650495f36601ecc8983a14ed745e058 - etag = afa80a038b6752b4e5221273fe3609a8ae2f96d96eee928632f50029dad0d2ed + sha = 29921560c73bb91c2a21a21800daf0b250773598 + etag = feb9dc86e4d9c0c4a294cd6e03c5b914943e8d206b88a125abd1b0f882ddb247 weak [file "src/SponsorLink/SponsorLink/Resources.resx"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.resx - sha = d868eee9cc6231fd9b66122f908a3d16b40d9174 - etag = a10bf29ed591bb9b21bf937e9c1d07ce5d1e5bcf4c3e0c7088292725c0e952ab + sha = 29921560c73bb91c2a21a21800daf0b250773598 + etag = 7665a3be17cd224b1c413ade6a9c1c5a822dace1e7f9daae33a2e52d8bca15bb weak [file "src/SponsorLink/SponsorLink/SponsorLink.cs"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.cs @@ -226,8 +226,8 @@ weak [file "src/SponsorLink/SponsorLink/SponsorStatus.cs"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorStatus.cs - sha = ca82a9d6298a933192c5dfd2c5881ebadb85d0fe - etag = cd51bb4f18ee3770aefc97312721f4787aa9161561a0125be71db4f3d8325f56 + sha = 29921560c73bb91c2a21a21800daf0b250773598 + etag = 419a823edb42d9175ae96d66a8b0191d8fc91921268c2a5340cf8d34519d4535 weak [file "src/SponsorLink/SponsorLink/SponsorableLib.targets"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorableLib.targets @@ -261,8 +261,8 @@ weak [file "src/SponsorLink/Tests/AnalyzerTests.cs"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/AnalyzerTests.cs - sha = ca82a9d6298a933192c5dfd2c5881ebadb85d0fe - etag = f6a457be2066ea997e23380628b9dd75a207c8992604ad997521c6bbe99fe07a + sha = 29921560c73bb91c2a21a21800daf0b250773598 + etag = 219df696a47a58d9de377166c87fbb199c84c33d3b7a0f7ae349543df050a583 weak [file "src/SponsorLink/Tests/Attributes.cs"] url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/Attributes.cs diff --git a/readme.md b/readme.md index 2e110740..1fa491b4 100644 --- a/readme.md +++ b/readme.md @@ -538,7 +538,6 @@ The versioning scheme for packages is: [![ChilliCream](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/ChilliCream.png "ChilliCream")](https://github.com/ChilliCream) [![4OTC](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/4OTC.png "4OTC")](https://github.com/4OTC) [![Vincent Limo](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/v-limo.png "Vincent Limo")](https://github.com/v-limo) -[![Brooke Hamilton](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/brooke-hamilton.png "Brooke Hamilton")](https://github.com/brooke-hamilton) diff --git a/src/SponsorLink/SponsorLink/DiagnosticsManager.cs b/src/SponsorLink/SponsorLink/DiagnosticsManager.cs index a73b96c0..b2d56f80 100644 --- a/src/SponsorLink/SponsorLink/DiagnosticsManager.cs +++ b/src/SponsorLink/SponsorLink/DiagnosticsManager.cs @@ -30,7 +30,9 @@ class DiagnosticsManager { SponsorStatus.Unknown, CreateUnknown([.. Sponsorables.Keys], Funding.Product, Funding.Prefix) }, { SponsorStatus.Grace, CreateGrace([.. Sponsorables.Keys], Funding.Product, Funding.Prefix) }, { SponsorStatus.User, CreateSponsor([.. Sponsorables.Keys], Funding.Prefix) }, - { SponsorStatus.Contributor, CreateContributor([.. Sponsorables.Keys], Funding.Prefix) }, + { SponsorStatus.Contributor, CreateContributor([.. Sponsorables.Keys], Funding.Prefix, hidden: true) }, + // NOTE: similar to contributor, we don't show OSS author membership in the IDE. + { SponsorStatus.OpenSource, CreateOpenSource([.. Sponsorables.Keys], Funding.Prefix) }, // NOTE: organization is a special case of sponsor, but we report it as hidden since the user isn't directly involved. { SponsorStatus.Organization, CreateSponsor([.. Sponsorables.Keys], Funding.Prefix, hidden: true) }, // NOTE: similar to organization, we don't show team membership in the IDE. @@ -192,6 +194,8 @@ SponsorStatus GetOrSetStatus(Func> getAdditionalF SponsorStatus.Contributor : claims.IsInRole("org") ? SponsorStatus.Organization : + claims.IsInRole("oss") ? + SponsorStatus.OpenSource : SponsorStatus.Unknown; if (KnownDescriptors.TryGetValue(status, out var descriptor)) @@ -284,4 +288,15 @@ SponsorStatus GetOrSetStatus(Func> getAdditionalF description: Resources.Contributor_Description, helpLinkUri: Funding.HelpUrl, "DoesNotSupportF1Help", "CompilationEnd"); + + internal static DiagnosticDescriptor CreateOpenSource(string[] sponsorable, string prefix, bool hidden = false) => new( + $"{prefix}112", + Resources.OpenSource_Title, + Resources.OpenSource_Message, + "SponsorLink", + hidden ? DiagnosticSeverity.Hidden : DiagnosticSeverity.Info, + isEnabledByDefault: true, + description: Resources.OpenSource_Description, + helpLinkUri: Funding.HelpUrl, + "DoesNotSupportF1Help", "CompilationEnd"); } diff --git a/src/SponsorLink/SponsorLink/Resources.es.resx b/src/SponsorLink/SponsorLink/Resources.es.resx index 1390c748..b9ff562d 100644 --- a/src/SponsorLink/SponsorLink/Resources.es.resx +++ b/src/SponsorLink/SponsorLink/Resources.es.resx @@ -212,4 +212,13 @@ Por favor considera apoyar el proyecto patrocinando en {0} y ejecutando posterio /// ¡Gracias! 🙏 /// </remarks> + + Gracias por ser parte de la comunidad de código abierto con tus contribuciones 🙏. + + + Gracias por ser autor de código abierto 💟! + + + Sos un autor de código abierto, eres lo máximo 💟! + \ No newline at end of file diff --git a/src/SponsorLink/SponsorLink/Resources.resx b/src/SponsorLink/SponsorLink/Resources.resx index 37126cbe..7b1dfa98 100644 --- a/src/SponsorLink/SponsorLink/Resources.resx +++ b/src/SponsorLink/SponsorLink/Resources.resx @@ -216,4 +216,13 @@ Please consider supporting the project by sponsoring at {0} and running 'sponsor /// Thanks! 🙏 /// </remarks> + + Thanks for being part of the open source community with your contributions 🙏. + + + Thank you for being an open source author 💟! + + + You are a an open source author, you rock 💟! + \ No newline at end of file diff --git a/src/SponsorLink/SponsorLink/SponsorStatus.cs b/src/SponsorLink/SponsorLink/SponsorStatus.cs index b78734ce..d0fe8000 100644 --- a/src/SponsorLink/SponsorLink/SponsorStatus.cs +++ b/src/SponsorLink/SponsorLink/SponsorStatus.cs @@ -49,5 +49,9 @@ public enum SponsorStatus /// /// The user is a member of a contributing organization. /// - Organization + Organization, + /// + /// The user is a OSS author. + /// + OpenSource, } diff --git a/src/SponsorLink/Tests/AnalyzerTests.cs b/src/SponsorLink/Tests/AnalyzerTests.cs index 7d0d7b12..4424b145 100644 --- a/src/SponsorLink/Tests/AnalyzerTests.cs +++ b/src/SponsorLink/Tests/AnalyzerTests.cs @@ -160,6 +160,10 @@ public async Task WhenUnknownAndGraceExpired_ThenReportsUnknown() [InlineData("org,contrib", SponsorStatus.Contributor)] // team trumps contrib (since team members will typically also be contributors [InlineData("contrib,team", SponsorStatus.Team)] + [InlineData("contrib,oss", SponsorStatus.Contributor)] + [InlineData("user,oss", SponsorStatus.User)] + [InlineData("org,oss", SponsorStatus.Organization)] + [InlineData("oss", SponsorStatus.OpenSource)] public async Task WhenSponsoringRole_ThenEnsureStatus(string roles, SponsorStatus status) { var sponsor = sponsorable.Sign(roles.Split(',').Select(x => new Claim("roles", x)), expiration: TimeSpan.FromMinutes(5)); @@ -202,6 +206,7 @@ public async Task WhenMultipleAnalyzers_ThenReportsOnce() // Simulate directly referenced package { "build_property.SponsorableLib", "1.0.0" }, { "build_property.SponsorLink", "1.0.0" }, + { "build_metadata.SponsorManifest.ItemType", "SponsorManifest" } })); var diagnostics = (await compilation.GetAnalyzerDiagnosticsAsync())