-
Notifications
You must be signed in to change notification settings - Fork 0
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
API Migration #2
Comments
Hi @uraniumanchor, thanks for reaching out! When I initially built the bot, and its library, @daenney/gdq, the V2 API seemed to exist but not really be functional. I popped by on the issue tracker at the time: GamesDoneQuick/donation-tracker#357 If v2 is up and running and is what's expected to be used now, I'm happy to make the changes. It would be great if there was some kind of API documentation, or if there's some way to get Django to output routes and expected message body formats to make this easier. I seem to have managed to get Django routes last time, but I don't exactly recall how I did it 😅. |
I'm finishing up adding the Run model to the API today, and the rest should be following shortly. My current plan is to leave v1 around for a short while in read-only mode since we still have some stuff even on our end that's still using it to display things, but if all goes well v1 will be gone either before or shortly after AGDQ25. As for snapshots and other documentation, I'm hoping to publish some example snapshots soon, generated from the testing framework. I'm also hoping to provide some OpenAPI specifications but automatically generating them has been not as simple as I'd hoped. |
Generating the specs is very hit-and-miss, yeah. I hadn't thought of looking at the tests, but that's a good idea. I imagine I can also peak at some of the frontend code since that should be calling the tracker API too? |
@uraniumanchor I've been doing the migration in the GDQ library, and so far so good. The new v2 API is much nicer, and thanks to The one bit where I've hit a snag is The other thing I noticed on interviews is that |
Oh, one other thing; the old event model used to have a total donation count. I'm not sure how to get to that one now. It was useful so I could have the bot announce things like whenever we crossed a new donation threshold (every 10k for example). |
I do plan on migrating those Interview fields to a list of talent, but that won't be changed until after AGDQ at the earliest. For now they're still just freeform text fields.
As for your last question, if you include |
Good to know! Then I'll leave interviews out for now, so I don't have to change the API my library exposes on people later on. It never used to include interviews in the schedule so that's fine for its current usage.
Makes sense.
Ah awesome, I hadn't realised that. I only ever query it for a specific event. The only time I query |
One thing I was thinking about for the donations; you could store the count and total on the event, and recalculate it in the background from time to time? Once an event is finished, those numbers never update, so including them in |
Internally I'm already storing DonorCache for similar purposes so I could most likely adapt it to store event totals as well. I'll just have to check that the performance is still acceptable for that. Certainly would work for older, locked events, it's just the live events I'm concerned about for that particular method. |
This repo doesn't look terribly active, but while checking server logs I noticed that it's hitting
api/v1/hosts
. V1 as a whole andhosts
in particular are going away in the near future. If there's anything that you need that isn't being provided by V2 please let me know.The text was updated successfully, but these errors were encountered: