insights: Fix for deleted users/orgs in oob settings migration
Created by: CristinaBirkel
Fixes https://github.com/sourcegraph/sourcegraph/issues/29487
Description
Currently, the oob settings migration will get stuck on jobs for deleted users/orgs. This fix checks for those specific errors and marks the job completed in those cases.
I was a bit concerned about checking for hardcoded strings, but that code hasn't been modified in 3 years so it feels like it should be pretty stable. Plus this migration will be deprecated in the near future anyway, but let me know if you see a more robust way of checking for those!
Testing Steps
I tested this by:
- Add a couple of new job rows to
insights_settings_migration_jobs
: one with auser_id
that doesn't exist, and one with anorg_id
that doesn't exist. - Verify that without this fix, those rows get stuck on a
not found
error. - Verify that with the fix, everything gets marked completed.