Skip to content

Extract project push rule to service class

Tan Le requested to merge 271274-extract-project-push-rule-update-service into master

What does this MR do?

Extract project push rule updating and creating logics to a services class.

This change enables us to consolidate the introduction of auditing and logging in future iterations.

As part of this MR, I have also added some spec improvements

Before: 48.16 s, 160 inserts
Finished in 48.16 seconds (files took 11.96 seconds to load)
35 examples, 0 failures

Randomized with seed 10762

[TEST PROF INFO] Factories usage

 Total: 160
 Total top-level: 160
 Total time: 15.5096s
 Total uniq factories: 5

   total   top-level     total time      time per call      top-level time               name

      70          70        6.2513s            0.0893s             6.2513s               user
      35          35        8.4689s            0.2420s             8.4689s            project
      35          35        0.5973s            0.0171s             0.5973s personal_access_token
      19          19        0.1567s            0.0082s             0.1567s          push_rule
       1           1        0.0354s            0.0354s             0.0354s            license
After: 34.28 s, 49 inserts
Finished in 34.28 seconds (files took 5.88 seconds to load)
35 examples, 0 failures

Randomized with seed 10762

[TEST PROF INFO] Factories usage

 Total: 49
 Total top-level: 49
 Total time: 1.7006s
 Total uniq factories: 5

   total   top-level     total time      time per call      top-level time               name

      35          35        0.7757s            0.0222s             0.7757s personal_access_token
      10          10        0.0956s            0.0096s             0.0956s          push_rule
       2           2        0.2309s            0.1154s             0.2309s               user
       1           1        0.0249s            0.0249s             0.0249s            license
       1           1        0.5735s            0.5735s             0.5735s            project

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #271274 (closed)

Edited by Tan Le

Merge request reports