Skip to content

Refactor push rules to allow for bulk checks

Patrick Steinhardt requested to merge pks-bulk-push-rules into master

What does this MR do?

The FileSizeCheck push rule loads all new blobs for a given change and checks whether any of these blobs is bigger than a certain threshold. This push rule is quite expensive: loading new blobs requires a revwalk of all preexisting references and thus scales with the number of refs in a repository. This may easily take a few dozen seconds to compute, and repeating this computation for each change doesn't help either.

This merge requests refactors our PushRulesChecks to allow for batched access checks. Basically, it's converted from a BaseSingleChecker to a BaseBulkChecker, where it then creates SingleChangeAccesses on the fly for all of its subchecks.

This allows us to easily change the FileSizeCheck to be a batched check, too. Except for laying the groundworks, this MR doesn't yet do anything and thus shouldn't cause any change in behaviour. I'll have to create a separate MR first to refactor our interfaces to load blobs from Gitaly.

Part of #336761 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Merge request reports