Closed adamengst closed 1 year ago
I'll need to dig into the Discourse API docs to know for sure, but my initial guess is that this is pretty pie in the sky. I'd hope at the very least we can get a list of unmatched individuals, so there's no manual reconciliation necessary every time you're trying to mentally sync the lists.
Happy to brainstorm other solutions to the problem. As it stands, I have to keep downloading the reg list from Webscorer, trying to remember where I last stopped, and then manually add the people to both @Challengers and their age-group group. And if they're not in Discourse at all, I have to invite their email address to @Challengers and remember to go back and add them to the age-group group once (if) they accept the invite.
OK, this should be mostly doable now that I've actually taken a look at what's possible, though I'll need an admin API key to be able to get the list of all Discourse users:
Woo, that's great!
The groups do exist, and all that needs to be done is to clear out last year's people.
A list of people without name matches should be good enough—it won't be hard to invite them once. And after several years of this, there shouldn't be too many. But tempting to DoS them with invitations. 😈
Getting started on this before Challenge registrations get too far underway -- @adamengst, could you create an admin API key for either your forum user or a new "API only" admin user, and send via some semi-secure method?
@adamengst Also it looks like the forum's age group team groups for last year got deleted. Will the new ones have the same names?
"CommunityTeams": {
"2": "Terrific-20s-Teens",
"3": "Thundering-30s",
"4": "Fantastic-40s",
"5": "Fabulous-50s",
"6": "Super-60s-70s"
}
FYI, looks like you had an API key from last year. I've created a new one with these settings:
Here's a single-use link to it:
Those groups are still present, but I suspect you can't see them because you're not an admin, so I've made you one. If nothing else, best to have another highly technical person with permissions. I think you have the names right, but copying and pasting to be sure:
Terrific-20s-Teens Thundering-30s Fantastic-40s Fabulous-50s Super-60s-70s
Thanks for the API key / admin access, this is coming along nicely but I'm hitting the wall so hoping to finish it up this weekend.
Screenshot of work-in-progress using real 2022 data:
Very cool! Do you need me to clear out those groups from last year too?
If you could leave them for now, I'm doing some manual testing and debugging with myself -- thanks!
Heads up @scottpdawson, I'm using us as guinea pigs for testing this batch functionality -- can't use @adamengst since he's an owner...apologies if you get any forum notifications about being added/removed from the Challenge groups!
Implemented as of 23d82ba, waiting until tonight to deploy given the high traffic of opening morning
@adamengst Could you clear all the Challenge forum groups at some point this evening (or earlier is fine if you don't mind them being empty for a bit) so I can run through the first round of sync'ing as a load/stress test? And then once I deploy I can hand it over to you to sync away at your leisure.
OK, all the groups are now empty. If only I'd found the bulk delete UI before deleting them one at a time. ;-)
That was way faster and easier than I expected it to go first time -- at least one of the new features went that way!
As the race director, I spend a stupid amount of time adding people to the @Challengers group in Discourse and to the @Fabulous-50s and other age-group-based groups. It would be a huge win if the leaderboard code could populate those groups automatically based on the participant's age and email. No idea what the DIscourse API allows here.
If it can match to an existing user's email address, that's a partial win, and if it could invite people who aren't on Discourse yet, that would be a complete win.
Thanks!