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

Add Back an Issue feature #310

Merged
merged 19 commits into from
Sep 1, 2024
Merged

Add Back an Issue feature #310

merged 19 commits into from
Sep 1, 2024

Conversation

kzu
Copy link
Member

@kzu kzu commented Aug 30, 2024

One-time sponsorships can now be assigned to specific issues by sponsors.

A new page under the github node allows signing in via the web to the same GitHub OAuth App that the CLI sync uses, for identification and retrieval of available sponsorships and backed issues lists.

@kzu kzu added the enhancement New feature or request label Aug 30, 2024
kzu added 8 commits August 29, 2024 23:30
A new app can be provided that points to an ngrok-forwarded domain. This new code will replicate as closeely as possible the full EasyAuth in production, includig the /me endpoint and its claims.

Combined with the device flow autentication (also used in local dev only), which reads the new `access_token` cookie, and performs the proper authentication for API requests from the browser.
A webhook intercepts sponsorships and forwards one-time to the new sponsored issue management class. Tests cover its behavior, which includes tracking unassigned sponsorships, backing issues and enumerating them.
Fetches the manifest and allows authentication to the sponsorable GitHub OAuth app.

Renders available and backed issues. Implementing assignment still pending.
NOTE: for local development, the `local.settings.json` MUST contain:

```json
  "Host": {
    "CORS": "http://127.0.0.1:4000",
    "CORSCredentials": true
  }
```
Ensures we have hte latest amount right-away for inspection.
- Improve dark mode switching, inspired by upstream JtD
- Add batch updating of issue bodies periodically (to potentially fixup concurrent changes which mey happen)
@devlooped-bot
Copy link
Member

devlooped-bot commented Aug 30, 2024

40 passed 40 passed 1 skipped
40 passed 40 passed 1 skipped
40 passed 40 passed 1 skipped

🧪 Details on macOS Unix 14.6.1

✅ 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.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org,contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org", status: Organization)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,org,contrib", status: User)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user", status: User)
✅ Tests.AnalyzerTests.WhenUnknownAndGrace_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenUnknownAndGraceExpired_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenUnknownAndNoGraceOption_ThenReportsUnknown
✅ Tests.Sample.RenderSponsorables
✅ Tests.Sample.Test(culture: "", kind: Contributor)
✅ Tests.Sample.Test(culture: "", kind: Expired)
✅ Tests.Sample.Test(culture: "", kind: Expiring)
✅ Tests.Sample.Test(culture: "", kind: Unknown)
✅ Tests.Sample.Test(culture: "", kind: User)
✅ Tests.Sample.Test(culture: "en", kind: Contributor)
✅ Tests.Sample.Test(culture: "en", kind: Expired)
✅ Tests.Sample.Test(culture: "en", kind: Expiring)
✅ Tests.Sample.Test(culture: "en", kind: Unknown)
✅ Tests.Sample.Test(culture: "en", kind: User)
✅ Tests.Sample.Test(culture: "es-AR", kind: Contributor)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expired)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expiring)
✅ Tests.Sample.Test(culture: "es-AR", kind: Unknown)
✅ Tests.Sample.Test(culture: "es-AR", kind: User)
✅ Tests.Sample.Test(culture: "es", kind: Contributor)
✅ Tests.Sample.Test(culture: "es", kind: Expired)
✅ Tests.Sample.Test(culture: "es", kind: Expiring)
✅ Tests.Sample.Test(culture: "es", kind: Unknown)
✅ Tests.Sample.Test(culture: "es", kind: User)

🧪 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.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org,contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org", status: Organization)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,org,contrib", status: User)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user", status: User)
✅ Tests.AnalyzerTests.WhenUnknownAndGrace_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenUnknownAndGraceExpired_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenUnknownAndNoGraceOption_ThenReportsUnknown
✅ Tests.Sample.RenderSponsorables
✅ Tests.Sample.Test(culture: "", kind: Contributor)
✅ Tests.Sample.Test(culture: "", kind: Expired)
✅ Tests.Sample.Test(culture: "", kind: Expiring)
✅ Tests.Sample.Test(culture: "", kind: Unknown)
✅ Tests.Sample.Test(culture: "", kind: User)
✅ Tests.Sample.Test(culture: "en", kind: Contributor)
✅ Tests.Sample.Test(culture: "en", kind: Expired)
✅ Tests.Sample.Test(culture: "en", kind: Expiring)
✅ Tests.Sample.Test(culture: "en", kind: Unknown)
✅ Tests.Sample.Test(culture: "en", kind: User)
✅ Tests.Sample.Test(culture: "es-AR", kind: Contributor)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expired)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expiring)
✅ Tests.Sample.Test(culture: "es-AR", kind: Unknown)
✅ Tests.Sample.Test(culture: "es-AR", kind: User)
✅ Tests.Sample.Test(culture: "es", kind: Contributor)
✅ Tests.Sample.Test(culture: "es", kind: Expired)
✅ Tests.Sample.Test(culture: "es", kind: Expiring)
✅ Tests.Sample.Test(culture: "es", kind: Unknown)
✅ Tests.Sample.Test(culture: "es", kind: User)

🧪 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.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org,contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org", status: Organization)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,org,contrib", status: User)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user", status: User)
✅ Tests.AnalyzerTests.WhenUnknownAndGrace_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenUnknownAndGraceExpired_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenUnknownAndNoGraceOption_ThenReportsUnknown
✅ Tests.Sample.RenderSponsorables
✅ Tests.Sample.Test(culture: "", kind: Contributor)
✅ Tests.Sample.Test(culture: "", kind: Expired)
✅ Tests.Sample.Test(culture: "", kind: Expiring)
✅ Tests.Sample.Test(culture: "", kind: Unknown)
✅ Tests.Sample.Test(culture: "", kind: User)
✅ Tests.Sample.Test(culture: "en", kind: Contributor)
✅ Tests.Sample.Test(culture: "en", kind: Expired)
✅ Tests.Sample.Test(culture: "en", kind: Expiring)
✅ Tests.Sample.Test(culture: "en", kind: Unknown)
✅ Tests.Sample.Test(culture: "en", kind: User)
✅ Tests.Sample.Test(culture: "es-AR", kind: Contributor)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expired)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expiring)
✅ Tests.Sample.Test(culture: "es-AR", kind: Unknown)
✅ Tests.Sample.Test(culture: "es-AR", kind: User)
✅ Tests.Sample.Test(culture: "es", kind: Contributor)
✅ Tests.Sample.Test(culture: "es", kind: Expired)
✅ Tests.Sample.Test(culture: "es", kind: Expiring)
✅ Tests.Sample.Test(culture: "es", kind: Unknown)
✅ Tests.Sample.Test(culture: "es", kind: User)

from dotnet-retest v0.6.2 on .NET 8.0.8 with 💜

kzu added 10 commits August 30, 2024 13:56
When doing the periodic body update.
Otherwise over time we can be processing enormous amounts of items with no risk of concurrent editing.
And assign to the first available funds. This should be the most common path.
Important for back issue badge URL
This allows testing the referer header from github
@devlooped-bot
Copy link
Member

40 passed 40 passed 1 skipped

🧪 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.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org,contrib", status: Contributor)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "org", status: Organization)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,contrib,team", status: Team)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user,org,contrib", status: User)
✅ Tests.AnalyzerTests.WhenSponsoringRole_ThenEnsureStatus(roles: "user", status: User)
✅ Tests.AnalyzerTests.WhenUnknownAndGrace_ThenDoesNotReport
✅ Tests.AnalyzerTests.WhenUnknownAndGraceExpired_ThenReportsUnknown
✅ Tests.AnalyzerTests.WhenUnknownAndNoGraceOption_ThenReportsUnknown
✅ Tests.Sample.RenderSponsorables
✅ Tests.Sample.Test(culture: "", kind: Contributor)
✅ Tests.Sample.Test(culture: "", kind: Expired)
✅ Tests.Sample.Test(culture: "", kind: Expiring)
✅ Tests.Sample.Test(culture: "", kind: Unknown)
✅ Tests.Sample.Test(culture: "", kind: User)
✅ Tests.Sample.Test(culture: "en", kind: Contributor)
✅ Tests.Sample.Test(culture: "en", kind: Expired)
✅ Tests.Sample.Test(culture: "en", kind: Expiring)
✅ Tests.Sample.Test(culture: "en", kind: Unknown)
✅ Tests.Sample.Test(culture: "en", kind: User)
✅ Tests.Sample.Test(culture: "es-AR", kind: Contributor)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expired)
✅ Tests.Sample.Test(culture: "es-AR", kind: Expiring)
✅ Tests.Sample.Test(culture: "es-AR", kind: Unknown)
✅ Tests.Sample.Test(culture: "es-AR", kind: User)
✅ Tests.Sample.Test(culture: "es", kind: Contributor)
✅ Tests.Sample.Test(culture: "es", kind: Expired)
✅ Tests.Sample.Test(culture: "es", kind: Expiring)
✅ Tests.Sample.Test(culture: "es", kind: Unknown)
✅ Tests.Sample.Test(culture: "es", kind: User)

from dotnet-retest v0.6.2 on .NET 8.0.8 with 💜

@kzu kzu merged commit 9a41253 into main Sep 1, 2024
15 checks passed
@kzu kzu deleted the dev/back branch September 1, 2024 18:02
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