Prepare separate PolicyBranchesServices for Scan Execution Policies and MR Approval Policies
Origins
The following discussion from !184135 (merged) should be addressed:
-
@mcavoj started a discussion: (+2 comments) thought: this service is used both for scan execution policies and approval policies, but the two new options are only applicable to the SEPs. Should we perhaps add a new class
ScanExecutionPolicyBranchesService < PolicyBranchesServiceto keep the responsibilities separate?
Background
This issue follows up on Prepare separate PolicyBranchesServices for Scan Execution Policies and MR Approval Policies, where we identified the need to separate responsibilities between Scan Execution Policies and MR Approval Policies in the current PolicyBranchesService.
Currently, the PolicyBranchesService is handling both scan execution policies and approval policies, but the new options are only applicable to Scan Execution Policies (SEPs). As discussed in MR !184135 (merged), we need to create a dedicated service for SEPs to maintain proper separation of concerns.
Objectives
- Create a new
ScanExecutionPolicyBranchesServiceclass that inherits fromPolicyBranchesService - Move SEP-specific functionality from the parent class to the new service
- Ensure the parent class maintains only shared functionality
- Update all relevant service calls to use the appropriate service class
- Add comprehensive tests for the new service
Implementation Details
- Create the new service class in the appropriate directory
- Identify and migrate SEP-specific methods and options
- Update any controllers or other services that currently use
PolicyBranchesServicefor SEPs - Ensure backward compatibility where necessary
- Add unit and integration tests for the new service
Acceptance Criteria
-
New ScanExecutionPolicyBranchesServiceclass is created and inherits fromPolicyBranchesService -
SEP-specific functionality is properly moved to the new class -
All existing functionality continues to work as expected -
Test coverage for the new service is comprehensive -
Documentation is updated to reflect the new service structure
Related Links
- Parent issue: #532491 (closed)
- Original discussion: MR !184135