Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ae28a03f
Commit
ae28a03f
authored
Jan 12, 2022
by
mgandres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trigger_job_retry_action feature flag
parent
84156e22
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
7 deletions
+41
-7
app/assets/javascripts/jobs/bridge/components/sidebar.vue
app/assets/javascripts/jobs/bridge/components/sidebar.vue
+6
-1
app/controllers/projects/jobs_controller.rb
app/controllers/projects/jobs_controller.rb
+1
-0
config/feature_flags/development/trigger_job_retry_action.yml
...ig/feature_flags/development/trigger_job_retry_action.yml
+8
-0
spec/frontend/jobs/bridge/components/sidebar_spec.js
spec/frontend/jobs/bridge/components/sidebar_spec.js
+26
-6
No files found.
app/assets/javascripts/jobs/bridge/components/sidebar.vue
View file @
ae28a03f
<
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"
...
...
app/controllers/projects/jobs_controller.rb
View file @
ae28a03f
...
...
@@ -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'
...
...
config/feature_flags/development/trigger_job_retry_action.yml
0 → 100644
View file @
ae28a03f
---
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
spec/frontend/jobs/bridge/components/sidebar_spec.js
View file @
ae28a03f
...
...
@@ -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
);
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment