Add AvoidDefaultOrganization cop to prevent .default_organization usage

What does this MR do and why?

Adding a new rubocop to prevent usages of Organizations::Organization.default_organization.
Using this method makes our migration to cells harder as there is no default organization on a new cell.
Instead, organizations should be derived from another model (i.e project, group etc), or looked up with Organization.find.

Once this is merged, I'll complete steps 3-4 from our documentation:
image

References

Relates to Add Rubocop to prevent new usages of Default Or... (#582629)

Screenshots or screen recordings

Before After

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.

Edited by tim mccarthy

Merge request reports

Loading