Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
5306e6bd
Commit
5306e6bd
authored
5 years ago
by
Michael Kriese
Committed by
Rhys Arkins
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(bitbucket-server): fix race condition (#3592)
parent
30fd1777
No related branches found
Branches containing commit
Tags
32.42.0
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/platform/bitbucket-server/index.js
+4
-0
4 additions, 0 deletions
lib/platform/bitbucket-server/index.js
test/platform/bitbucket-server/index.spec.js
+1
-0
1 addition, 0 deletions
test/platform/bitbucket-server/index.spec.js
with
5 additions
and
0 deletions
lib/platform/bitbucket-server/index.js
+
4
−
0
View file @
5306e6bd
const
url
=
require
(
'
url
'
);
const
url
=
require
(
'
url
'
);
const
delay
=
require
(
'
delay
'
);
const
api
=
require
(
'
./bb-got-wrapper
'
);
const
api
=
require
(
'
./bb-got-wrapper
'
);
const
utils
=
require
(
'
./utils
'
);
const
utils
=
require
(
'
./utils
'
);
...
@@ -240,6 +241,8 @@ async function commitFilesToBranch(
...
@@ -240,6 +241,8 @@ async function commitFilesToBranch(
parentBranch
parentBranch
);
);
// wait for pr change propagation
await
delay
(
1000
);
// refresh cache
// refresh cache
await
getBranchPr
(
branchName
,
true
);
await
getBranchPr
(
branchName
,
true
);
}
}
...
@@ -696,6 +699,7 @@ async function getPr(prNo, refreshCache) {
...
@@ -696,6 +699,7 @@ async function getPr(prNo, refreshCache) {
if
(
!
prNo
)
{
if
(
!
prNo
)
{
return
null
;
return
null
;
}
}
const
res
=
await
api
.
get
(
const
res
=
await
api
.
get
(
`./rest/api/1.0/projects/
${
config
.
projectKey
}
/repos/
${
`./rest/api/1.0/projects/
${
config
.
projectKey
}
/repos/
${
config
.
repositorySlug
config
.
repositorySlug
...
...
This diff is collapsed.
Click to expand it.
test/platform/bitbucket-server/index.spec.js
+
1
−
0
View file @
5306e6bd
...
@@ -13,6 +13,7 @@ describe('platform/bitbucket-server', () => {
...
@@ -13,6 +13,7 @@ describe('platform/bitbucket-server', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
// reset module
// reset module
jest
.
resetModules
();
jest
.
resetModules
();
jest
.
mock
(
'
delay
'
);
jest
.
mock
(
'
got
'
,
()
=>
(
url
,
options
)
=>
{
jest
.
mock
(
'
got
'
,
()
=>
(
url
,
options
)
=>
{
const
{
method
}
=
options
;
const
{
method
}
=
options
;
const
body
=
mockResponses
[
url
]
&&
mockResponses
[
url
][
method
];
const
body
=
mockResponses
[
url
]
&&
mockResponses
[
url
][
method
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment