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

GitHub Sponsors & Friendly Sponsorware Message #159

Merged
merged 16 commits into from
Sep 8, 2020

Conversation

warrenbuckley
Copy link
Owner

@warrenbuckley warrenbuckley commented Sep 7, 2020

Details

This PR uses the in-built authentication providers in VSCode 1.48+ to gain an API token in order to query GitHub GraphQL API

The GraphQL query & logic for checking if a user is a valid sponsor is decoupled from the codebase, this means that the logic could be changed over time, for example if you make a contribution by logging an issue, or starring the repo.

The codebase for this externally hosted GraphQL logic is also open source & available here - https://github.com/warrenbuckley/Is-Github-Sponsor

  • On extension boot-up we randomly choose a number between 5 and 20
  • When IIS Express Start or Restart command is used we increment a counter
  • If the counter is greater or equal to the random number set at extension boot and you are not a valid sponsor (see rules below) then the message will be shown
  • Counter is reset and will be shown when it meets the random number threshold again

Sponsorware Message Rules

If any of the following rules are met then the sponsorware message will not be shown

  • Checks if logged in GitHub user is myself (warrenbuckley)
  • Checks if logged in GitHub user is part of the organisation Umbraco (The company where I work)
  • Checks if logged in GitHub user has made a commit to the codebase from a merged contributed PR
  • Checks if logged in GitHub user is sponsoring me (warrenbuckley) Even if its the lowest tier

What will I see?

Here is a screenshot showing you what you will be shown, this is not too invasive but hopefully a friendly reminder to consider sponsoring a project maintained by a solo developer in his free time.

image
image

@warrenbuckley warrenbuckley changed the title Sponsorware GitHub Sponsors & Friendly Sponsorware Message Sep 8, 2020
@warrenbuckley warrenbuckley marked this pull request as ready for review September 8, 2020 20:10
@warrenbuckley warrenbuckley merged commit e6cb0dc into develop Sep 8, 2020
@warrenbuckley warrenbuckley deleted the feature/webview-sponsor-msg branch September 8, 2020 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant