api icon indicating copy to clipboard operation
api copied to clipboard

Deprecate api (was: Upgrade Postgres from 9.6)

Open garyhtou opened this issue 2 years ago • 5 comments

Deadline: March 11th, 2023

image

garyhtou avatar Feb 10 '23 00:02 garyhtou

I tried setting up this project locally and ran into a few issues

  • https://github.com/docker/for-mac/issues/5864
  • Compiling Nokogiri on M1
    • https://nokogiri.org/tutorials/installing_nokogiri.html#how-can-i-avoid-using-a-precompiled-native-gem
    • https://github.com/sparklemotion/nokogiri/discussions/2359
  • Ruby 2.6.6 is EOL
  • The Docker setup is using postgres 11.6, so it's currently out of sync with prod 9.6.24

While I think we can fix all these issues, I discussed with @maxwofford on Feb 14 and we think this project might be unused enough that we can finish https://github.com/hackclub/bank/issues/3442 and deprecate api.

I don't think api has a log collector set up, so I ran heroku logs -n 1500 -a api-hackclub (1500 is the max number of lines requestable with this command) at 3 separate times in the past 2 days and found these routes being hit

should be covered by https://github.com/hackclub/bank/issues/3442

POST "/v1/users/<USER_ID>/exchange_login_code"
POST "/v1/users/auth"

others

GET "/v1/events/<EVENT_ID>/redirect"
GET "/v1/event_email_subscribers/stats"
GET "/v1/ping"
GET "/v1/users/<USER_ID>"
GET "/v1/users/current"

There's also the occasional request for a few event logos, specifically I've seen this one several times https://api.hackclub.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBc2tQIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--a2b2780859b62b5246854dbd29799a2b2f78ca94/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MY21WemFYcGxTU0lKZURFMU1BWTZCa1ZVT2dsMGNtbHRWQT09IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--0a3410a893c16b77303680cd0aaa2ada739a06b7/WayCoolHacks%20Logo.png

I also see the occasional sidekiq job running. Any thoughts on these @maxwofford ?

albertchae avatar Feb 15 '23 20:02 albertchae

For the other endpoints, here's a breakdown:

  • GET “/v1/events/<EVENT_ID>/redirect”
    • (deprecated) use by hackclub/hackathons-v1
  • GET “/v1/event_email_subscribers/stats”
    • used by hackathons.hackclub.com
  • GET “/v1/ping”
    • used by status.hackclub.com
  • GET “/v1/users/<USER_ID>”
    • (deprecated) used by anti.hackclub.com
    • (deprecated) used by hackclub/v2
  • GET “/v1/users/current”
    • used by bank.hackclub.com

maxwofford avatar Feb 21 '23 19:02 maxwofford

I just checked through the scheduled jobs in heroku_scheduler.rake– all of these are connected to the deprecated versions of our clubs and hackathons APIs and are safe to cancel.

Let's go ahead and turn off their scheduling now to front-load any errors.

As a side note, we'll want to make sure we get a dump of the database– quite a few of these were crawling info that we might want to keep around.

maxwofford avatar Feb 21 '23 20:02 maxwofford

I opened https://github.com/hackclub/api/pull/483 to comment out everything in heroku_scheduler.rake and also went through the heroku dashboard to remove everything from the scheduler

image

albertchae avatar Feb 23 '23 17:02 albertchae

Changed title to reflect what we ended up doing instead of upgrading postgres

albertchae avatar Feb 27 '23 19:02 albertchae