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

Simplify JWK download by using curl directly from backend #281

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Simplify JWK download by using curl directly from backend #281

merged 2 commits into from
Jul 22, 2024

Conversation

kzu
Copy link
Member

@kzu kzu commented Jul 22, 2024

Simplify JWK download by using curl directly from backend

@kzu kzu added the enhancement New feature or request label Jul 22, 2024
@devlooped-bot
Copy link
Member

devlooped-bot commented Jul 22, 2024

25 passed 25 passed 1 skipped
25 passed 25 passed 1 skipped
25 passed 25 passed 1 skipped

🧪 Details on macOS Unix 14.5.0

✅ Devlooped.Tests.SponsorLinkTests.TryRead
❔ Devlooped.Tests.SponsorLinkTests.ValidateCachedManifest => Non-CI test
✅ Devlooped.Tests.SponsorLinkTests.ValidateExpiredSponsor
✅ Devlooped.Tests.SponsorLinkTests.ValidateSponsorable
✅ Devlooped.Tests.SponsorLinkTests.ValidateUnknownFormat
✅ Devlooped.Tests.SponsorLinkTests.ValidateWrongKey
✅ Tests.AnalyzerTests.WhenAnalyzerNotDirectlyReferenced_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenMultipleAnalyzers_ThenReportsOnce
✅ Tests.AnalyzerTests.WhenNoAdditionalFiles_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenSponsoring_ThenReportsSponsor
✅ Tests.AnalyzerTests.WhenUnknownAndGrace_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenUnknownAndGraceExpired_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenUnknownAndNoGraceOption_ThenReportsUnknown
✅ Tests.Sample.RenderSponsorables
✅ Tests.Sample.Test(culture: "", kind: Expired)
✅ Tests.Sample.Test(culture: "", kind: Expiring)
✅ Tests.Sample.Test(culture: "", kind: Sponsor)
✅ Tests.Sample.Test(culture: "", kind: Unknown)
✅ Tests.Sample.Test(culture: "en", kind: Expired)
✅ Tests.Sample.Test(culture: "en", kind: Expiring)
✅ Tests.Sample.Test(culture: "en", kind: Sponsor)
✅ Tests.Sample.Test(culture: "en", kind: Unknown)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expired)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expiring)
✅ Tests.Sample.Test(culture: "es-AR", kind: Sponsor)
✅ Tests.Sample.Test(culture: "es-AR", kind: Unknown)

🧪 Details on Ubuntu 22.04.4 LTS

✅ Devlooped.Tests.SponsorLinkTests.TryRead
❔ Devlooped.Tests.SponsorLinkTests.ValidateCachedManifest => Non-CI test
✅ Devlooped.Tests.SponsorLinkTests.ValidateExpiredSponsor
✅ Devlooped.Tests.SponsorLinkTests.ValidateSponsorable
✅ Devlooped.Tests.SponsorLinkTests.ValidateUnknownFormat
✅ Devlooped.Tests.SponsorLinkTests.ValidateWrongKey
✅ Tests.AnalyzerTests.WhenAnalyzerNotDirectlyReferenced_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenMultipleAnalyzers_ThenReportsOnce
✅ Tests.AnalyzerTests.WhenNoAdditionalFiles_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenSponsoring_ThenReportsSponsor
✅ Tests.AnalyzerTests.WhenUnknownAndGrace_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenUnknownAndGraceExpired_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenUnknownAndNoGraceOption_ThenReportsUnknown
✅ Tests.Sample.RenderSponsorables
✅ Tests.Sample.Test(culture: "", kind: Expired)
✅ Tests.Sample.Test(culture: "", kind: Expiring)
✅ Tests.Sample.Test(culture: "", kind: Sponsor)
✅ Tests.Sample.Test(culture: "", kind: Unknown)
✅ Tests.Sample.Test(culture: "en", kind: Expired)
✅ Tests.Sample.Test(culture: "en", kind: Expiring)
✅ Tests.Sample.Test(culture: "en", kind: Sponsor)
✅ Tests.Sample.Test(culture: "en", kind: Unknown)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expired)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expiring)
✅ Tests.Sample.Test(culture: "es-AR", kind: Sponsor)
✅ Tests.Sample.Test(culture: "es-AR", kind: Unknown)

🧪 Details on Microsoft Windows 10.0.20348

✅ Devlooped.Tests.SponsorLinkTests.TryRead
❔ Devlooped.Tests.SponsorLinkTests.ValidateCachedManifest => Non-CI test
✅ Devlooped.Tests.SponsorLinkTests.ValidateExpiredSponsor
✅ Devlooped.Tests.SponsorLinkTests.ValidateSponsorable
✅ Devlooped.Tests.SponsorLinkTests.ValidateUnknownFormat
✅ Devlooped.Tests.SponsorLinkTests.ValidateWrongKey
✅ Tests.AnalyzerTests.WhenAnalyzerNotDirectlyReferenced_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenMultipleAnalyzers_ThenReportsOnce
✅ Tests.AnalyzerTests.WhenNoAdditionalFiles_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenSponsoring_ThenReportsSponsor
✅ Tests.AnalyzerTests.WhenUnknownAndGrace_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenUnknownAndGraceExpired_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenUnknownAndNoGraceOption_ThenReportsUnknown
✅ Tests.Sample.RenderSponsorables
✅ Tests.Sample.Test(culture: "", kind: Expired)
✅ Tests.Sample.Test(culture: "", kind: Expiring)
✅ Tests.Sample.Test(culture: "", kind: Sponsor)
✅ Tests.Sample.Test(culture: "", kind: Unknown)
✅ Tests.Sample.Test(culture: "en", kind: Expired)
✅ Tests.Sample.Test(culture: "en", kind: Expiring)
✅ Tests.Sample.Test(culture: "en", kind: Sponsor)
✅ Tests.Sample.Test(culture: "en", kind: Unknown)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expired)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expiring)
✅ Tests.Sample.Test(culture: "es-AR", kind: Sponsor)
✅ Tests.Sample.Test(culture: "es-AR", kind: Unknown)

from dotnet-retest on .NET 8.0.7 with 💜

@kzu kzu force-pushed the dev/ps branch 3 times, most recently from 173de0e to 531cb12 Compare July 22, 2024 23:14
@kzu kzu changed the title Use built-in windows powershell if available Improve error messages when pwsh or jq are missing Jul 22, 2024
NOTES:
1. `pwsh` cannot be replaced with `powershell` because the output of `curl` is different and breaks `jq`
2. `jq` would still be needed even if replacing `pwsh`
3. Downloading the `jwk` directly from sponsorlink.devlooped.com is done via curl.
   This is suboptimal and slower (typically) than downloading from github, hence it's used as a fallback only.
4. If no curl is available (legacy windows?), use built-in powershell.

This guarantees we can always download the JWK.
Our backend at https://sponsorlink.devlooped.com/jwk basically does the same we were doing in MSBuild before: download from GH the JWT and extract the JWK info. Since the backend needs to be up anyway, just simplify the build and use it.
@kzu kzu changed the title Improve error messages when pwsh or jq are missing Simplify JWK download by using curl directly from backend Jul 22, 2024
@kzu kzu enabled auto-merge (rebase) July 22, 2024 23:38
@kzu kzu merged commit de1b927 into main Jul 22, 2024
19 checks passed
@kzu kzu deleted the dev/ps branch July 22, 2024 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants