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
1dc36a6c
Commit
1dc36a6c
authored
Jun 15, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add native code intelligence
This merge request enables code_navigation feature flag by default
parent
cb75b51b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
6 deletions
+11
-6
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
app/serializers/diffs_entity.rb
app/serializers/diffs_entity.rb
+2
-2
app/serializers/paginated_diff_entity.rb
app/serializers/paginated_diff_entity.rb
+1
-1
app/services/ci/authorize_job_artifact_service.rb
app/services/ci/authorize_job_artifact_service.rb
+1
-1
changelogs/unreleased/id-code-navigation-enable-feature.yml
changelogs/unreleased/id-code-navigation-enable-feature.yml
+5
-0
lib/gitlab/code_navigation_path.rb
lib/gitlab/code_navigation_path.rb
+1
-1
No files found.
app/helpers/projects_helper.rb
View file @
1dc36a6c
...
@@ -734,7 +734,7 @@ module ProjectsHelper
...
@@ -734,7 +734,7 @@ module ProjectsHelper
end
end
def
native_code_navigation_enabled?
(
project
)
def
native_code_navigation_enabled?
(
project
)
Feature
.
enabled?
(
:code_navigation
,
project
)
Feature
.
enabled?
(
:code_navigation
,
project
,
default_enabled:
true
)
end
end
def
show_visibility_confirm_modal?
(
project
)
def
show_visibility_confirm_modal?
(
project
)
...
...
app/serializers/diffs_entity.rb
View file @
1dc36a6c
...
@@ -78,7 +78,7 @@ class DiffsEntity < Grape::Entity
...
@@ -78,7 +78,7 @@ class DiffsEntity < Grape::Entity
options
[
:merge_request_diffs
]
options
[
:merge_request_diffs
]
end
end
expose
:definition_path_prefix
,
if:
->
(
diff_file
)
{
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
)
}
do
|
diffs
|
expose
:definition_path_prefix
,
if:
->
(
diff_file
)
{
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
,
default_enabled:
true
)
}
do
|
diffs
|
project_blob_path
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
project_blob_path
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
end
end
...
@@ -89,7 +89,7 @@ class DiffsEntity < Grape::Entity
...
@@ -89,7 +89,7 @@ class DiffsEntity < Grape::Entity
private
private
def
code_navigation_path
(
diffs
)
def
code_navigation_path
(
diffs
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
,
default_enabled:
true
)
Gitlab
::
CodeNavigationPath
.
new
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
Gitlab
::
CodeNavigationPath
.
new
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
end
end
...
...
app/serializers/paginated_diff_entity.rb
View file @
1dc36a6c
...
@@ -37,7 +37,7 @@ class PaginatedDiffEntity < Grape::Entity
...
@@ -37,7 +37,7 @@ class PaginatedDiffEntity < Grape::Entity
private
private
def
code_navigation_path
(
diffs
)
def
code_navigation_path
(
diffs
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
,
default_enabled:
true
)
Gitlab
::
CodeNavigationPath
.
new
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
Gitlab
::
CodeNavigationPath
.
new
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
end
end
...
...
app/services/ci/authorize_job_artifact_service.rb
View file @
1dc36a6c
...
@@ -36,7 +36,7 @@ module Ci
...
@@ -36,7 +36,7 @@ module Ci
def
code_navigation_enabled?
def
code_navigation_enabled?
strong_memoize
(
:code_navigation_enabled
)
do
strong_memoize
(
:code_navigation_enabled
)
do
Feature
.
enabled?
(
:code_navigation
,
job
.
project
)
Feature
.
enabled?
(
:code_navigation
,
job
.
project
,
default_enabled:
true
)
end
end
end
end
...
...
changelogs/unreleased/id-code-navigation-enable-feature.yml
0 → 100644
View file @
1dc36a6c
---
title
:
Add native code intelligence
merge_request
:
34542
author
:
type
:
added
lib/gitlab/code_navigation_path.rb
View file @
1dc36a6c
...
@@ -13,7 +13,7 @@ module Gitlab
...
@@ -13,7 +13,7 @@ module Gitlab
end
end
def
full_json_path_for
(
path
)
def
full_json_path_for
(
path
)
return
if
Feature
.
disabled?
(
:code_navigation
,
project
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
project
,
default_enabled:
true
)
return
unless
build
return
unless
build
raw_project_job_artifacts_path
(
project
,
build
,
path:
"lsif/
#{
path
}
.json"
,
file_type: :lsif
)
raw_project_job_artifacts_path
(
project
,
build
,
path:
"lsif/
#{
path
}
.json"
,
file_type: :lsif
)
...
...
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