Hacker News new | ask | show | jobs
by hinkley 1425 days ago
That doesn't work because that repo needs to expose an API that accesses that table, now you have to prove the API is never called, and you're back to searching the entire code base for that function call (hopefully you've used meaningful function names instead of DRY ones...)
1 comments

Add: log.info("get_user_by_user_id has been deprecated, please use the alternative API.")

Into the repo method, push up the change, redeploy the projects that depend on the library and wait a while and grep the logs to see if it ever gets used.

Monorepo is easier though.

Dude, that just tells you if the table is used on the happy path. It does not tell you if it's only used by a customer whose godson is the CEO's favorite kid. Or if customers only use it right before a federal deadline for filing forms, or at the end of the quarter when it's time to generate reports. Which you didn't collect for 2 months.

  > Or if customers only use it right before a federal deadline for filing
  > forms, or at the end of the quarter when it's time to generate reports.
You're right. How would you suggest to defend against these situations?

I personally like to version my APIs, but that is robust insofar as code changes, not for database changes.

The other responder liked monorepos for this. It’s not perfect, but it does help with making sure you had all of the code to search from, and once in a while the commit history adds additional clues.