Commit 578ab1bb authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'remove-ff-path_to_vulnerable_dependency' into 'master'

Remove flag path_to_vulnerable_dependency

See merge request gitlab-org/gitlab!52576
parents 9b469c20 5446ed10
...@@ -10,7 +10,6 @@ import { ...@@ -10,7 +10,6 @@ import {
GlLink, GlLink,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import DependencyLicenseLinks from './dependency_license_links.vue'; import DependencyLicenseLinks from './dependency_license_links.vue';
import DependencyVulnerabilities from './dependency_vulnerabilities.vue'; import DependencyVulnerabilities from './dependency_vulnerabilities.vue';
import DependencyLocation from './dependency_location.vue'; import DependencyLocation from './dependency_location.vue';
...@@ -45,7 +44,6 @@ export default { ...@@ -45,7 +44,6 @@ export default {
GlPopover, GlPopover,
GlLink, GlLink,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
dependencies: { dependencies: {
type: Array, type: Array,
...@@ -115,25 +113,23 @@ export default { ...@@ -115,25 +113,23 @@ export default {
> >
<template #head(location)="data"> <template #head(location)="data">
{{ data.label }} {{ data.label }}
<template v-if="glFeatures.pathToVulnerableDependency"> <gl-icon id="location-info" name="information" class="gl-text-blue-600" />
<gl-icon id="location-info" name="information" class="gl-text-blue-600" /> <gl-popover
<gl-popover target="location-info"
target="location-info" triggers="hover focus"
triggers="hover focus" placement="top"
placement="top" :title="s__('Dependencies|Location and dependency path')"
:title="s__('Dependencies|Location and dependency path')" >
> {{ $options.i18n.tooltipText }}
{{ $options.i18n.tooltipText }} <div class="gl-mt-4">
<div class="gl-mt-4"> <gl-link
<gl-link :href="$options.DEPENDENCY_PATH_LINK"
:href="$options.DEPENDENCY_PATH_LINK" target="_blank"
target="_blank" class="font-size-inherit"
class="font-size-inherit" >{{ $options.i18n.tooltipMoreText }}</gl-link
>{{ $options.i18n.tooltipMoreText }}</gl-link >
> </div>
</div> </gl-popover>
</gl-popover>
</template>
</template> </template>
<!-- toggleDetails and detailsShowing are scoped slot props provided by <!-- toggleDetails and detailsShowing are scoped slot props provided by
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import { GlIcon, GlLink, GlPopover, GlIntersperse } from '@gitlab/ui'; import { GlIcon, GlLink, GlPopover, GlIntersperse } from '@gitlab/ui';
import { n__ } from '~/locale'; import { n__ } from '~/locale';
import DependencyPathViewer from './dependency_path_viewer.vue'; import DependencyPathViewer from './dependency_path_viewer.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export const VISIBLE_DEPENDENCY_COUNT = 2; export const VISIBLE_DEPENDENCY_COUNT = 2;
...@@ -15,7 +14,6 @@ export default { ...@@ -15,7 +14,6 @@ export default {
GlPopover, GlPopover,
GlIntersperse, GlIntersperse,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
location: { location: {
type: Object, type: Object,
...@@ -27,10 +25,10 @@ export default { ...@@ -27,10 +25,10 @@ export default {
return this.location.ancestors || []; return this.location.ancestors || [];
}, },
hasAncestors() { hasAncestors() {
return this.glFeatures.pathToVulnerableDependency && this.ancestors.length > 0; return this.ancestors.length > 0;
}, },
isTopLevelDependency() { isTopLevelDependency() {
return this.glFeatures.pathToVulnerableDependency && this.location.top_level; return this.location.top_level;
}, },
visibleDependencies() { visibleDependencies() {
return this.ancestors.slice(0, VISIBLE_DEPENDENCY_COUNT); return this.ancestors.slice(0, VISIBLE_DEPENDENCY_COUNT);
...@@ -39,7 +37,7 @@ export default { ...@@ -39,7 +37,7 @@ export default {
return Math.max(0, this.ancestors.length - VISIBLE_DEPENDENCY_COUNT); return Math.max(0, this.ancestors.length - VISIBLE_DEPENDENCY_COUNT);
}, },
showMoreLink() { showMoreLink() {
return this.glFeatures.pathToVulnerableDependency && this.remainingDependenciesCount > 0; return this.remainingDependenciesCount > 0;
}, },
nMoreMessage() { nMoreMessage() {
return n__('Dependencies|%d more', 'Dependencies|%d more', this.remainingDependenciesCount); return n__('Dependencies|%d more', 'Dependencies|%d more', this.remainingDependenciesCount);
......
...@@ -4,10 +4,6 @@ module Projects ...@@ -4,10 +4,6 @@ module Projects
class DependenciesController < Projects::ApplicationController class DependenciesController < Projects::ApplicationController
before_action :authorize_read_dependency_list! before_action :authorize_read_dependency_list!
before_action do
push_frontend_feature_flag(:path_to_vulnerable_dependency, project, default_enabled: true)
end
feature_category :dependency_scanning feature_category :dependency_scanning
def index def index
......
---
name: path_to_vulnerable_dependency
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40627
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/241739
milestone: '13.4'
type: development
group: group::composition analysis
default_enabled: true
...@@ -59,7 +59,6 @@ module Gitlab ...@@ -59,7 +59,6 @@ module Gitlab
path: file_path path: file_path
} }
return base_location if Feature.disabled?(:path_to_vulnerable_dependency, project, default_enabled: true)
return base_location unless dependency['iid'] return base_location unless dependency['iid']
base_location.merge({ base_location.merge({
......
...@@ -95,9 +95,11 @@ describe('DependenciesTable component', () => { ...@@ -95,9 +95,11 @@ describe('DependenciesTable component', () => {
it('renders the table header', () => { it('renders the table header', () => {
const expectedLabels = DependenciesTable.fields.map(({ label }) => label); const expectedLabels = DependenciesTable.fields.map(({ label }) => label);
const headerCells = wrapper.findAll('thead th').wrappers; const headerCells = wrapper.findAll('thead th');
expect(headerCells.map((cell) => cell.text())).toEqual(expectedLabels); expectedLabels.forEach((expectedLabel, i) => {
expect(headerCells.at(i).text()).toContain(expectedLabel);
});
}); });
it('does not render any rows', () => { it('does not render any rows', () => {
......
...@@ -12,11 +12,6 @@ describe('Dependency Location component', () => { ...@@ -12,11 +12,6 @@ describe('Dependency Location component', () => {
wrapper = shallowMount(DependencyLocation, { wrapper = shallowMount(DependencyLocation, {
propsData: { ...propsData }, propsData: { ...propsData },
stubs: { GlLink, DependencyPathViewer, GlIntersperse }, stubs: { GlLink, DependencyPathViewer, GlIntersperse },
provide: {
glFeatures: {
pathToVulnerableDependency: true,
},
},
...options, ...options,
}); });
}; };
...@@ -87,23 +82,4 @@ describe('Dependency Location component', () => { ...@@ -87,23 +82,4 @@ describe('Dependency Location component', () => {
expect(findPopover().exists()).toBe(false); expect(findPopover().exists()).toBe(false);
}); });
}); });
describe('with feature flag off', () => {
it.each`
name | location | path
${'no path'} | ${Paths.noPath} | ${'package.json'}
${'top level path'} | ${Paths.topLevelPath} | ${'package.json'}
${'short path'} | ${Paths.shortPath} | ${'package.json'}
${'long path'} | ${Paths.longPath} | ${'package.json'}
`('do not show dependency path for $name', ({ location, path }) => {
createComponent({
propsData: {
location,
},
provide: { glFeatures: { pathToVulnerableDependency: false } },
});
expect(wrapper.text()).toBe(path);
});
});
}); });
...@@ -67,19 +67,6 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Formatters::DependencyList do ...@@ -67,19 +67,6 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Formatters::DependencyList do
end end
end end
context 'when feature flag for dependency path is off' do
let(:dependency) { parsed_report['dependency_files'][0]['dependencies'][0] }
let(:location) { data[:location] }
before do
stub_feature_flags(path_to_vulnerable_dependency: false)
end
it { expect(location[:top_level]).to be_nil }
it { expect(location[:ancestors]).to be_nil }
it { expect(location[:path]).to eq('file.path') }
end
context 'with vulnerable dependency' do context 'with vulnerable dependency' do
let(:data) { formatter.format(dependency, package_manager, file_path, parsed_report['vulnerabilities'].first) } let(:data) { formatter.format(dependency, package_manager, file_path, parsed_report['vulnerabilities'].first) }
let(:dependency) { parsed_report['dependency_files'][0]['dependencies'][1] } let(:dependency) { parsed_report['dependency_files'][0]['dependencies'][1] }
......
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