Commit ae28a03f authored by mgandres's avatar mgandres

Add trigger_job_retry_action feature flag

parent 84156e22
<script>
import { GlButton, GlDropdown, GlDropdownItem } from '@gitlab/ui';
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 { JOB_SIDEBAR } from '../../constants';
import CommitBlock from '../../components/commit_block.vue';
......@@ -25,6 +26,7 @@ export default {
GlDropdownItem,
TooltipOnTruncate,
},
mixins: [glFeatureFlagsMixin()],
props: {
bridgeJob: {
type: Object,
......@@ -54,7 +56,10 @@ export default {
</h4>
</tooltip-on-truncate>
<!-- 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
:text="$options.i18n.retryButton"
category="primary"
......
......@@ -19,6 +19,7 @@ class Projects::JobsController < Projects::ApplicationController
before_action do
push_frontend_feature_flag(:infinitely_collapsible_sections, @project, default_enabled: :yaml)
push_frontend_feature_flag(:trigger_job_retry_action, @project, default_enabled: :yaml)
end
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';
describe('Bridge Sidebar', () => {
let wrapper;
const createComponent = (props) => {
const createComponent = ({ featureFlag } = {}) => {
wrapper = shallowMount(BridgeSidebar, {
provide: {
glFeatures: {
triggerJobRetryAction: featureFlag,
},
},
propsData: {
bridgeJob: mockJob,
commit: mockCommit,
...props,
},
});
};
......@@ -35,10 +39,6 @@ describe('Bridge Sidebar', () => {
expect(findJobTitle().text()).toBe(mockJob.name);
});
it('renders retry dropdown', () => {
expect(findRetryDropdown().exists()).toBe(true);
});
it('renders commit information', () => {
expect(findCommitBlock().exists()).toBe(true);
});
......@@ -57,4 +57,24 @@ describe('Bridge Sidebar', () => {
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