Gitlab::CodeOwners::Validator class naming is unintuitive

The naming of this class suggests that it is responsible for validating codeowner files but the logic inside is responsible for validating a git push to a protected branch.

Now we are implementing validation for code owners files we should move this logic.

The logic runs in the Gitlab::Checks::DiffCheck so IMO this logic should be moved under the same namespace.

The PushRuleCheck runs multiple checks which are contained in Gitlab::Checks::PushRules e.g. TagCheck so I think we should follow the same structure:

Proposal

Move logic from CodeOwners::Validator to Gitlab::Checks::Diffs::CodeOwnersCheck (in EE dir) and modify the EE DiffCheck logic to call the new class.

Edited by Joe Woodward