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
1eb21ca8
Commit
1eb21ca8
authored
Sep 28, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
916c85d7
4cc57b8c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
10 deletions
+29
-10
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
...equest_widget/components/mr_widget_pipeline_container.vue
+4
-1
lib/gitlab/database/load_balancing/active_record_proxy.rb
lib/gitlab/database/load_balancing/active_record_proxy.rb
+1
-1
spec/frontend/vue_mr_widget/components/mr_widget_pipeline_container_spec.js
...mr_widget/components/mr_widget_pipeline_container_spec.js
+17
-8
spec/lib/gitlab/database/load_balancing/active_record_proxy_spec.rb
...itlab/database/load_balancing/active_record_proxy_spec.rb
+7
-0
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
View file @
1eb21ca8
...
...
@@ -88,6 +88,9 @@ export default {
return
this
.
mr
.
preferredAutoMergeStrategy
;
},
ciStatus
()
{
return
this
.
isPostMerge
?
this
.
mr
?.
mergePipeline
?.
details
?.
status
?.
text
:
this
.
mr
.
ciStatus
;
},
},
};
</
script
>
...
...
@@ -97,7 +100,7 @@ export default {
:pipeline=
"pipeline"
:pipeline-coverage-delta=
"mr.pipelineCoverageDelta"
:builds-with-coverage=
"mr.buildsWithCoverage"
:ci-status=
"
mr.
ciStatus"
:ci-status=
"ciStatus"
:has-ci=
"mr.hasCI"
:pipeline-must-succeed=
"mr.onlyAllowMergeIfPipelineSucceeds"
:source-branch=
"branch"
...
...
lib/gitlab/database/load_balancing/active_record_proxy.rb
View file @
1eb21ca8
...
...
@@ -7,7 +7,7 @@ module Gitlab
# "connection" method.
module
ActiveRecordProxy
def
connection
::
Gitlab
::
Database
::
LoadBalancing
.
proxy
::
Gitlab
::
Database
::
LoadBalancing
.
proxy
||
super
end
end
end
...
...
spec/frontend/vue_mr_widget/components/mr_widget_pipeline_container_spec.js
View file @
1eb21ca8
import
{
mount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
ArtifactsApp
from
'
~/vue_merge_request_widget/components/artifacts_list_app.vue
'
;
import
DeploymentList
from
'
~/vue_merge_request_widget/components/deployment/deployment_list.vue
'
;
...
...
@@ -12,12 +13,14 @@ describe('MrWidgetPipelineContainer', () => {
let
mock
;
const
factory
=
(
props
=
{})
=>
{
wrapper
=
mount
(
MrWidgetPipelineContainer
,
{
propsData
:
{
mr
:
{
...
mockStore
},
...
props
,
},
});
wrapper
=
extendedWrapper
(
mount
(
MrWidgetPipelineContainer
,
{
propsData
:
{
mr
:
{
...
mockStore
},
...
props
,
},
}),
);
};
beforeEach
(()
=>
{
...
...
@@ -30,6 +33,7 @@ describe('MrWidgetPipelineContainer', () => {
});
const
findDeploymentList
=
()
=>
wrapper
.
findComponent
(
DeploymentList
);
const
findCIErrorMessage
=
()
=>
wrapper
.
findByTestId
(
'
ci-error-message
'
);
describe
(
'
when pre merge
'
,
()
=>
{
beforeEach
(()
=>
{
...
...
@@ -69,15 +73,21 @@ describe('MrWidgetPipelineContainer', () => {
beforeEach
(()
=>
{
factory
({
isPostMerge
:
true
,
mr
:
{
...
mockStore
,
pipeline
:
{},
ciStatus
:
undefined
,
},
});
});
it
(
'
renders pipeline
'
,
()
=>
{
expect
(
wrapper
.
find
(
MrWidgetPipeline
).
exists
()).
toBe
(
true
);
expect
(
findCIErrorMessage
().
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
MrWidgetPipeline
).
props
()).
toMatchObject
({
pipeline
:
mockStore
.
mergePipeline
,
pipelineCoverageDelta
:
mockStore
.
pipelineCoverageDelta
,
ciStatus
:
mockStore
.
ciStatus
,
ciStatus
:
mockStore
.
mergePipeline
.
details
.
status
.
text
,
hasCi
:
mockStore
.
hasCI
,
sourceBranch
:
mockStore
.
targetBranch
,
sourceBranchLink
:
mockStore
.
targetBranch
,
...
...
@@ -92,7 +102,6 @@ describe('MrWidgetPipelineContainer', () => {
targetBranch
:
'
Foo<script>alert("XSS")</script>
'
,
},
});
expect
(
wrapper
.
find
(
MrWidgetPipeline
).
props
().
sourceBranchLink
).
toBe
(
'
Foo
'
);
});
...
...
spec/lib/gitlab/database/load_balancing/active_record_proxy_spec.rb
View file @
1eb21ca8
...
...
@@ -16,5 +16,12 @@ RSpec.describe Gitlab::Database::LoadBalancing::ActiveRecordProxy do
expect
(
dummy
.
new
.
connection
).
to
eq
(
proxy
)
end
it
'returns a connection when no proxy is present'
do
allow
(
Gitlab
::
Database
::
LoadBalancing
).
to
receive
(
:proxy
).
and_return
(
nil
)
expect
(
ActiveRecord
::
Base
.
connection
)
.
to
eq
(
ActiveRecord
::
Base
.
retrieve_connection
)
end
end
end
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