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
75f9ccc3
Commit
75f9ccc3
authored
Oct 30, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add minimal backend changes to expose blob_path [ci skip]
parent
43371992
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
app/serializers/merge_request_entity.rb
app/serializers/merge_request_entity.rb
+8
-0
ee/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_code_quality.vue
...erge_request_widget/components/mr_widget_code_quality.vue
+1
-1
ee/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
...cripts/vue_merge_request_widget/stores/mr_widget_store.js
+3
-0
ee/app/models/ee/merge_request.rb
ee/app/models/ee/merge_request.rb
+2
-0
No files found.
app/serializers/merge_request_entity.rb
View file @
75f9ccc3
...
...
@@ -195,11 +195,19 @@ class MergeRequestEntity < IssuableEntity
path:
'codeclimate.json'
)
end
expose
:head_blob_path
,
if:
->
(
mr
,
_
)
{
mr
.
head_pipeline_sha
}
do
|
merge_request
|
project_blob_path
(
merge_request
.
project
,
merge_request
.
head_pipeline_sha
)
end
expose
:base_path
,
if:
->
(
mr
,
_
)
{
can?
(
current_user
,
:read_build
,
mr
.
base_codeclimate_artifact
)
}
do
|
merge_request
|
raw_project_build_artifacts_url
(
merge_request
.
target_project
,
merge_request
.
base_codeclimate_artifact
,
path:
'codeclimate.json'
)
end
expose
:base_blob_path
,
if:
->
(
mr
,
_
)
{
mr
.
base_pipeline_sha
}
do
|
merge_request
|
project_blob_path
(
merge_request
.
project
,
merge_request
.
base_pipeline_sha
)
end
end
private
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_code_quality.vue
View file @
75f9ccc3
...
...
@@ -107,7 +107,7 @@ export default {
},
created
()
{
const
{
head_path
,
base
_path
}
=
this
.
mr
.
codeclimate
;
const
{
head_path
,
head_blob_path
,
base_path
,
base_blob
_path
}
=
this
.
mr
.
codeclimate
;
this
.
isLoading
=
true
;
...
...
ee/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
View file @
75f9ccc3
...
...
@@ -57,7 +57,10 @@ export default class MergeRequestStore extends CEMergeRequestStore {
}
compareCodeclimateMetrics
(
headIssues
,
baseIssues
)
{
// newIssues link to head_blob_path+"/"+filename+"#L"+begin
this
.
codeclimateMetrics
.
newIssues
=
this
.
filterByFingerprint
(
headIssues
,
baseIssues
);
// resolvedIssues link to base_blob_path+"/"+filename+"#L"+begin
this
.
codeclimateMetrics
.
resolvedIssues
=
this
.
filterByFingerprint
(
baseIssues
,
headIssues
);
}
...
...
ee/app/models/ee/merge_request.rb
View file @
75f9ccc3
...
...
@@ -11,6 +11,8 @@ module EE
delegate
:codeclimate_artifact
,
to: :head_pipeline
,
prefix: :head
,
allow_nil:
true
delegate
:codeclimate_artifact
,
to: :base_pipeline
,
prefix: :base
,
allow_nil:
true
delegate
:sha
,
to: :head_pipeline
,
prefix: :head_pipeline
,
allow_nil:
true
delegate
:sha
,
to: :base_pipeline
,
prefix: :base_pipeline
,
allow_nil:
true
end
def
rebase_dir_path
...
...
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