Commit b68039ed authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'dc-remove-artifact-fields-feature-flag' into 'master'

Remove paths from BuildArtifactEntity [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!58818
parents a4467bc2 2d3232b8
......@@ -21,20 +21,8 @@ class BuildArtifactEntity < Grape::Entity
)
end
expose :keep_path, if: -> (*) { artifact.expiring? && show_duplicated_paths?(project) } do |artifact|
fast_keep_project_job_artifacts_path(project, artifact.job)
end
expose :browse_path, if: -> (*) { show_duplicated_paths?(project) } do |artifact|
fast_browse_project_job_artifacts_path(project, artifact.job)
end
private
def show_duplicated_paths?(project)
!Gitlab::Ci::Features.remove_duplicate_artifact_exposure_paths?(project)
end
def project
options[:project] || artifact.project
end
......
---
title: Remove paths from BuildArtifactEntity
merge_request: 58818
author:
type: performance
---
name: remove_duplicate_artifact_exposure_paths
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54611
rollout_issue_url:
milestone: '13.10'
type: development
group: group::testing
default_enabled: false
......@@ -63,10 +63,6 @@ module Gitlab
def self.multiple_cache_per_job?
::Feature.enabled?(:multiple_cache_per_job, default_enabled: :yaml)
end
def self.remove_duplicate_artifact_exposure_paths?(project)
::Feature.enabled?(:remove_duplicate_artifact_exposure_paths, project, default_enabled: :yaml)
end
end
end
end
......@@ -27,28 +27,6 @@ RSpec.describe BuildArtifactEntity do
expect(subject[:path]).to include "jobs/#{job.id}/artifacts/download?file_type=codequality"
end
context 'with remove_duplicate_artifact_exposure_paths enabled' do
before do
stub_feature_flags(remove_duplicate_artifact_exposure_paths: true)
end
it 'has no keep or browse path' do
expect(subject).not_to include(:keep_path)
expect(subject).not_to include(:browse_path)
end
end
context 'with remove_duplicate_artifact_exposure_paths disabled' do
before do
stub_feature_flags(remove_duplicate_artifact_exposure_paths: false)
end
it 'has keep and browse paths' do
expect(subject[:keep_path]).to be_present
expect(subject[:browse_path]).to be_present
end
end
context 'when project is specified in options' do
let(:options) { super().merge(project: job.project) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment