chore: log DB repository migration status for manifest uploads and downloads
Problem
We don't have an idea of how many API requests are targeting repositories that were successfully migrated during Phase 2.
Solution
This MR adds an info
log message per manifest upload and download where we add a special db_migration_status
field set to whatever is the value of the repository migration_status
on the database. We use db_migration_status
as the key name to avoid a clash with the existing migration_status
log key (used to identify the code path that a request has followed).
Note that we already have manifest uploaded
and manifest downloaded
log entries. We could add the db_migration_status
key/value there, but the DB repository is not accessible in those places. So the easiest way (while avoiding doing another query just to get the repository at that level) is to temporarily emit a new log message at a lower level, where we have access to the repository model. This is not ideal but seems to be the best approach. I'm proposing we do this just for manifest uploads and downloads as that should be enough to have a rough idea of the percentage of requests targeting migrated repositories.
Finally, unless there is a better/simpler option, we should open a followup issue to revert this change later on.