Batch Changes OOB migrations can appear stuck when encryption is disabled
Created by: LawnGnome
At present, the Batch Changes credential tables use a field called encryption_key_id to distinguish between encrypted and unencrypted credentials. During development of the OOB migrations that underpin this functionality, unmigrated records were also distinguished by having a credential_enc field set to NULL.
Late in the development process, the separate credential_enc was removed, as I believed the state could be inferred from encryption_key_id. On encrypted instances, this is true. On unencrypted instances, however, this introduced an ambiguity between unencrypted and unmigrated records.
The net effect of this was that, on unencrypted Sourcegraph instances, the user and site credential migrations will always appear to be stuck at 0% progress if there are a non-zero number of records. (As a special case, if there are no records of that type, the migration will complete.) This is mostly harmless, but it does mean that the OOB migrator will be woken up every few seconds to do nothing, successfully, and it means that the migration site admin UI will always indicate that the migration is stuck, despite the lack of errors.