Allow OAuth-connected repos without installation xid
What does this MR do and why?
Allow OAuth-connected repos without installation xid
Make provider_installation_xid nullable on import_sync_repositories, so a repository connected through GitHub OAuth (with no GitHub App installation) can have a row from the start. Switching that repository to a GitHub App installation later then becomes a plain update that fills in the installation id, instead of a full re-import. The check constraint now allows null or values greater than zero, and the model validation allows nil.
Add three disconnect_reason enum values: token_revoked, insufficient_scope, and user_deauthorized, to cover OAuth token failures. Widen the disconnect_reason check constraint from 0..3 to 0..9 to leave headroom for future values.
References
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.