Page MenuHomePhabricator

Fix authorizations with no authorizer
Closed, ResolvedPublic

Description

We have a number of authorizations with no authorizer data. This data is necessary for is_valid to consider an authorization valid. After we've fixed the cause of this (T233508) we need to go through and fill this data in.

We'll evaluate manual or automated when we know how many authorizations are affected once the outstanding bug is fixed.

Event Timeline

based on the work I did on T233508 , I think this issue will best be addressed by looping through sent applications and setting sent_by to the latest reviewer (the step that was missing on affected applications), then I can loop through applications with no authorizer and fill it in with the sent_by data as appropriate. That should catch many affected applications and authorizations.

I'll also set a fallback on the auth backfill script to set a default authorizer so that we can have usable auths for imported apps that didn't have a known coordinator in the import data. It would be easiest to just set it to the current coordinator, but let me know if I should do something different.

There are about 2500 imported sent apps for which the partner has no coordinator. Should I just set sent_by to @Nikkimaria in that case? Or I could create a system/statistical user for these historical cases where we can't know

so, we decided on slack to add a system user.
The steps to resolve this will look like:

  • create system user (with no editor)
  • run one-off django shell command that fills in the sent_by fields of apps with
    • the coordinator who sent the app, if available, else
    • the current coordinator for the related partner, else
    • the new system user
  • run the authorization backfill script, which will now have an authorizer for all generated auths

This is complete. The total number of applications without a populated sent_by was 5389.