Skip to content

Follow up refactoring for group-level protected environments [RUN ALL RSPEC] [RUN AS-IF-FOSS]

NOTE: This is a blocker against the critical issue for important prospects, thus the priority is relatively high

What does this MR do?

We're currently working onto shipping Group-level permissions config for Protected Environments. Previously, we refactored the project-level protected environments as a preparation, but still the change size of the feature implementation MR is pretty big. Therefore, we're following up to the refactoring to reduce the change size in order to ease the review pains.

Specifically, this MR introduces the following changes:

  • Use Ci::Build#persisted_environment instead of instantized_environment.
  • Handle N+1 issue related to persisted_environment with BatchLoader. This is already in place.
  • Inherit BaseContainerService in Protected Environment services for supporting both project and group container types.

Please note that there are no behavioral changes on the existing features.

Related #215888 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Shinya Maeda

Merge request reports