Automate issuing of badges for completion of tour #118
Description
Firstly, the tour is awesome. Great work to all those involved. Thank you!
While we have been manually issuing certificates, this does not scale, and should be automated.
A while back while I was full time on JSON Schema, I looked for a good solution for providing attestable badges. The only good free solution I could find is https://badgr.com.
We created an account and an issuer identity for JSON Schema.
Currently, on completion of the tour, we capture the users name and email.
This goes into a google sheet.
We could automate the issuing of badges in multiple ways.
I was going to suggest using GitHub Actions workflow scheduled events, but there is a limit in that they will not continue to trigger if the repo has no update for 60 days.
My suggestion is to use Cloudflare Workers. We will very likely not hit the free limits.
Investigation work needs to be done to find out if this is feasable or if any limitaitons going to cause issues.
Proposed solution:
- Completion of the tour results in capture of name and email, saved into google sheet. (currently exists and working).
- Scheduled Cloudflare Worker checks daily if any new competions are logged and require badge issuing. If any, take first and issue badge.
Considerations:
- Scheduled task will need to also span another pre-task to remove duplicates. If duplicates are found, remove ones which are not sent first.
- New column for "badge issued" in the spreadsheet.
- Cloudflare has specific considerations for cron triggers.
- Needs error handling. Errors should be reported to Slack channel. Not sure how difficult this will be.
- Secrets should remain secret!
- Everything must be checked into the git repo.
Approach:
- Create your own free account for testing Cloudflare and Badgr.
- Develop solution using documentation, guides, and existing code.
- https://github.com/yajushiSri/Badgr-Create-Badge
- Existing code for accessing and using Badgr can be used
- https://api.badgr.io/docs/v2/
- https://developers.cloudflare.com/workers/
- https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/
- We have existing code for accessing and saving to the Google Spreadsheet.
- https://github.com/yajushiSri/Badgr-Create-Badge
- Deploy scheduled worker from Github git repo to Cloudflare workers (https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler)
Feel free to break these down into smaller Issues.
Please ask questions if anything is unclear (and notify me on Github if I don't reply within 2 days 😅)