Commit ae28a03f authored by mgandres's avatar mgandres

Add trigger_job_retry_action feature flag

parent 84156e22
<script> <script>
import { GlButton, GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { GlButton, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue';
import { JOB_SIDEBAR } from '../../constants'; import { JOB_SIDEBAR } from '../../constants';
import CommitBlock from '../../components/commit_block.vue'; import CommitBlock from '../../components/commit_block.vue';
...@@ -25,6 +26,7 @@ export default { ...@@ -25,6 +26,7 @@ export default {
GlDropdownItem, GlDropdownItem,
TooltipOnTruncate, TooltipOnTruncate,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
bridgeJob: { bridgeJob: {
type: Object, type: Object,
...@@ -54,7 +56,10 @@ export default { ...@@ -54,7 +56,10 @@ export default {
</h4> </h4>
</tooltip-on-truncate> </tooltip-on-truncate>
<!-- TODO: implement retry actions --> <!-- TODO: implement retry actions -->
<div class="gl-flex-grow-1 gl-flex-shrink-0 gl-text-right"> <div
v-if="glFeatures.triggerJobRetryAction"
class="gl-flex-grow-1 gl-flex-shrink-0 gl-text-right"
>
<gl-dropdown <gl-dropdown
:text="$options.i18n.retryButton" :text="$options.i18n.retryButton"
category="primary" category="primary"
......
...@@ -19,6 +19,7 @@ class Projects::JobsController < Projects::ApplicationController ...@@ -19,6 +19,7 @@ class Projects::JobsController < Projects::ApplicationController
before_action do before_action do
push_frontend_feature_flag(:infinitely_collapsible_sections, @project, default_enabled: :yaml) push_frontend_feature_flag(:infinitely_collapsible_sections, @project, default_enabled: :yaml)
push_frontend_feature_flag(:trigger_job_retry_action, @project, default_enabled: :yaml)
end end
layout 'project' layout 'project'
......
---
name: trigger_job_retry_action
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77951
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/349966
milestone: '14.7'
type: development
group: group::pipeline authoring
default_enabled: false
...@@ -7,12 +7,16 @@ import { mockCommit, mockJob } from '../mock_data'; ...@@ -7,12 +7,16 @@ import { mockCommit, mockJob } from '../mock_data';
describe('Bridge Sidebar', () => { describe('Bridge Sidebar', () => {
let wrapper; let wrapper;
const createComponent = (props) => { const createComponent = ({ featureFlag } = {}) => {
wrapper = shallowMount(BridgeSidebar, { wrapper = shallowMount(BridgeSidebar, {
provide: {
glFeatures: {
triggerJobRetryAction: featureFlag,
},
},
propsData: { propsData: {
bridgeJob: mockJob, bridgeJob: mockJob,
commit: mockCommit, commit: mockCommit,
...props,
}, },
}); });
}; };
...@@ -35,10 +39,6 @@ describe('Bridge Sidebar', () => { ...@@ -35,10 +39,6 @@ describe('Bridge Sidebar', () => {
expect(findJobTitle().text()).toBe(mockJob.name); expect(findJobTitle().text()).toBe(mockJob.name);
}); });
it('renders retry dropdown', () => {
expect(findRetryDropdown().exists()).toBe(true);
});
it('renders commit information', () => { it('renders commit information', () => {
expect(findCommitBlock().exists()).toBe(true); expect(findCommitBlock().exists()).toBe(true);
}); });
...@@ -57,4 +57,24 @@ describe('Bridge Sidebar', () => { ...@@ -57,4 +57,24 @@ describe('Bridge Sidebar', () => {
expect(wrapper.emitted('toggleSidebar')).toHaveLength(1); expect(wrapper.emitted('toggleSidebar')).toHaveLength(1);
}); });
}); });
describe('retry action', () => {
describe('when feature flag is ON', () => {
beforeEach(() => {
createComponent({ featureFlag: true });
});
it('renders retry dropdown', () => {
expect(findRetryDropdown().exists()).toBe(true);
});
});
describe('when feature flag is OFF', () => {
it('does not render retry dropdown', () => {
createComponent({ featureFlag: false });
expect(findRetryDropdown().exists()).toBe(false);
});
});
});
}); });
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