Skip to content

Refactor pipeline artifacts logic

Max Orefice requested to merge mo-refactor-pipeline-artifact-logic into master

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 to Pipeline
  • Modifies has_coverage_reports? method to check if a pipeline_artifact is attached to a given pipeline
  • Uses our new methods in CreateArtifactService and MergeRequest 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

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

Merge request reports