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
23d60ad9
Commit
23d60ad9
authored
Mar 15, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
3a3e0375
66eec660
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
6 deletions
+33
-6
app/assets/javascripts/lib/utils/simple_poll.js
app/assets/javascripts/lib/utils/simple_poll.js
+2
-2
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
...merge_request_widget/components/states/ready_to_merge.vue
+7
-3
changelogs/unreleased/56970-fix-mr-stuck-loading-on-error.yml
...gelogs/unreleased/56970-fix-mr-stuck-loading-on-error.yml
+5
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
...widget/components/states/mr_widget_ready_to_merge_spec.js
+19
-1
No files found.
app/assets/javascripts/lib/utils/simple_poll.js
View file @
23d60ad9
export
default
(
fn
,
interval
=
2000
,
timeout
=
60000
)
=>
{
export
default
(
fn
,
{
interval
=
2000
,
timeout
=
60000
}
=
{}
)
=>
{
const
startTime
=
Date
.
now
();
return
new
Promise
((
resolve
,
reject
)
=>
{
const
stop
=
arg
=>
(
arg
instanceof
Error
?
reject
(
arg
)
:
resolve
(
arg
));
const
next
=
()
=>
{
if
(
Date
.
now
()
-
startTime
<
timeout
)
{
if
(
timeout
===
0
||
Date
.
now
()
-
startTime
<
timeout
)
{
setTimeout
(
fn
.
bind
(
null
,
next
,
stop
),
interval
);
}
else
{
reject
(
new
Error
(
'
SIMPLE_POLL_TIMEOUT
'
));
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
View file @
23d60ad9
...
...
@@ -169,9 +169,12 @@ export default {
});
},
initiateMergePolling
()
{
simplePoll
((
continuePolling
,
stopPolling
)
=>
{
this
.
handleMergePolling
(
continuePolling
,
stopPolling
);
});
simplePoll
(
(
continuePolling
,
stopPolling
)
=>
{
this
.
handleMergePolling
(
continuePolling
,
stopPolling
);
},
{
timeout
:
0
},
);
},
handleMergePolling
(
continuePolling
,
stopPolling
)
{
this
.
service
...
...
@@ -202,6 +205,7 @@ export default {
})
.
catch
(()
=>
{
new
Flash
(
__
(
'
Something went wrong while merging this merge request. Please try again.
'
));
// eslint-disable-line
stopPolling
();
});
},
initiateRemoveSourceBranchPolling
()
{
...
...
changelogs/unreleased/56970-fix-mr-stuck-loading-on-error.yml
0 → 100644
View file @
23d60ad9
---
title
:
Disable timeout on merge request merging poll
merge_request
:
25988
author
:
type
:
fixed
spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
View file @
23d60ad9
...
...
@@ -377,11 +377,29 @@ describe('ReadyToMerge', () => {
});
describe
(
'
initiateMergePolling
'
,
()
=>
{
beforeEach
(()
=>
{
jasmine
.
clock
().
install
();
});
afterEach
(()
=>
{
jasmine
.
clock
().
uninstall
();
});
it
(
'
should call simplePoll
'
,
()
=>
{
const
simplePoll
=
spyOnDependency
(
ReadyToMerge
,
'
simplePoll
'
);
vm
.
initiateMergePolling
();
expect
(
simplePoll
).
toHaveBeenCalled
();
expect
(
simplePoll
).
toHaveBeenCalledWith
(
jasmine
.
any
(
Function
),
{
timeout
:
0
});
});
it
(
'
should call handleMergePolling
'
,
()
=>
{
spyOn
(
vm
,
'
handleMergePolling
'
);
vm
.
initiateMergePolling
();
jasmine
.
clock
().
tick
(
2000
);
expect
(
vm
.
handleMergePolling
).
toHaveBeenCalled
();
});
});
...
...
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