Refactor pipeline artifacts logic
Ref: #241142 (closed)
This feature is behind a feature flag (coverage_report_view
).
What does this MR do?
This MR refactors some business logic for our Pipeline
class.
It includes the following items:
-
Adds can_generate_coverage_reports?
method toPipeline
-
Modifies has_coverage_reports?
method to check if apipeline_artifact
is attached to a givenpipeline
-
Uses our new methods in CreateArtifactService
andMergeRequest
to simplify our codebase
Why are we doing this?
As pointed out by @dosuken123 in this thread our business logic is becoming confusing and we should be simplify it for better maintainability.
With this refactoring we should understand better when a pipeline has a coverage_report
and if a given pipeline
can generate a coverage_report
artifact.
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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