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
46c67eb7
Commit
46c67eb7
authored
Sep 28, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove code_navigation feature flag
It has been enabled for a while without major issues, we can rm it
parent
21dd0ed7
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
18 additions
and
116 deletions
+18
-116
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob/viewer/index.js
+1
-3
app/assets/javascripts/diffs/components/diff_content.vue
app/assets/javascripts/diffs/components/diff_content.vue
+3
-5
app/assets/javascripts/diffs/store/actions.js
app/assets/javascripts/diffs/store/actions.js
+12
-14
app/assets/javascripts/pages/projects/blob/show/index.js
app/assets/javascripts/pages/projects/blob/show/index.js
+1
-1
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+0
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-4
app/serializers/diffs_entity.rb
app/serializers/diffs_entity.rb
+1
-3
app/serializers/paginated_diff_entity.rb
app/serializers/paginated_diff_entity.rb
+0
-2
app/services/ci/create_job_artifacts_service.rb
app/services/ci/create_job_artifacts_service.rb
+0
-9
app/views/projects/merge_requests/show.html.haml
app/views/projects/merge_requests/show.html.haml
+0
-1
config/feature_flags/development/code_navigation.yml
config/feature_flags/development/code_navigation.yml
+0
-7
lib/gitlab/code_navigation_path.rb
lib/gitlab/code_navigation_path.rb
+0
-1
spec/lib/gitlab/code_navigation_path_spec.rb
spec/lib/gitlab/code_navigation_path_spec.rb
+0
-14
spec/requests/api/ci/runner/jobs_artifacts_spec.rb
spec/requests/api/ci/runner/jobs_artifacts_spec.rb
+0
-30
spec/serializers/diffs_entity_spec.rb
spec/serializers/diffs_entity_spec.rb
+0
-10
spec/serializers/paginated_diff_entity_spec.rb
spec/serializers/paginated_diff_entity_spec.rb
+0
-10
No files found.
app/assets/javascripts/blob/viewer/index.js
View file @
46c67eb7
...
...
@@ -179,9 +179,7 @@ export default class BlobViewer {
viewer
.
innerHTML
=
data
.
html
;
viewer
.
setAttribute
(
'
data-loaded
'
,
'
true
'
);
if
(
window
.
gon
?.
features
?.
codeNavigation
)
{
eventHub
.
$emit
(
'
showBlobInteractionZones
'
,
viewer
.
dataset
.
path
);
}
eventHub
.
$emit
(
'
showBlobInteractionZones
'
,
viewer
.
dataset
.
path
);
return
viewer
;
});
...
...
app/assets/javascripts/diffs/components/diff_content.vue
View file @
46c67eb7
...
...
@@ -85,11 +85,9 @@ export default {
},
},
updated
()
{
if
(
window
.
gon
?.
features
?.
codeNavigation
)
{
this
.
$nextTick
(()
=>
{
eventHub
.
$emit
(
'
showBlobInteractionZones
'
,
this
.
diffFile
.
new_path
);
});
}
this
.
$nextTick
(()
=>
{
eventHub
.
$emit
(
'
showBlobInteractionZones
'
,
this
.
diffFile
.
new_path
);
});
},
methods
:
{
...
mapActions
(
'
diffs
'
,
[
'
saveDiffDiscussion
'
,
'
closeDiffFileCommentForm
'
]),
...
...
app/assets/javascripts/diffs/store/actions.js
View file @
46c67eb7
...
...
@@ -103,20 +103,18 @@ export const fetchDiffFilesBatch = ({ commit, state, dispatch }) => {
commit
(
types
.
VIEW_DIFF_FILE
,
state
.
diffFiles
[
0
].
file_hash
);
}
if
(
gon
.
features
?.
codeNavigation
)
{
// eslint-disable-next-line promise/catch-or-return,promise/no-nesting
import
(
'
~/code_navigation
'
).
then
(
m
=>
m
.
default
({
blobs
:
state
.
diffFiles
.
filter
(
f
=>
f
.
code_navigation_path
)
.
map
(
f
=>
({
path
:
f
.
new_path
,
codeNavigationPath
:
f
.
code_navigation_path
,
})),
definitionPathPrefix
:
state
.
definitionPathPrefix
,
}),
);
}
// eslint-disable-next-line promise/catch-or-return,promise/no-nesting
import
(
'
~/code_navigation
'
).
then
(
m
=>
m
.
default
({
blobs
:
state
.
diffFiles
.
filter
(
f
=>
f
.
code_navigation_path
)
.
map
(
f
=>
({
path
:
f
.
new_path
,
codeNavigationPath
:
f
.
code_navigation_path
,
})),
definitionPathPrefix
:
state
.
definitionPathPrefix
,
}),
);
}
return
pagination
.
next_page
;
...
...
app/assets/javascripts/pages/projects/blob/show/index.js
View file @
46c67eb7
...
...
@@ -58,7 +58,7 @@ document.addEventListener('DOMContentLoaded', () => {
const
codeNavEl
=
document
.
getElementById
(
'
js-code-navigation
'
);
if
(
gon
.
features
?.
codeNavigation
&&
codeNavEl
)
{
if
(
codeNavEl
)
{
const
{
codeNavigationPath
,
blobPath
,
definitionPathPrefix
}
=
codeNavEl
.
dataset
;
// eslint-disable-next-line promise/catch-or-return
...
...
app/controllers/projects/blob_controller.rb
View file @
46c67eb7
...
...
@@ -33,7 +33,6 @@ class Projects::BlobController < Projects::ApplicationController
before_action
:set_last_commit_sha
,
only:
[
:edit
,
:update
]
before_action
only: :show
do
push_frontend_feature_flag
(
:code_navigation
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:suggest_pipeline
)
if
experiment_enabled?
(
:suggest_pipeline
)
push_frontend_feature_flag
(
:gitlab_ci_yml_preview
,
@project
,
default_enabled:
false
)
end
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
46c67eb7
...
...
@@ -29,7 +29,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:deploy_from_footer
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:suggest_pipeline
)
if
experiment_enabled?
(
:suggest_pipeline
)
push_frontend_feature_flag
(
:code_navigation
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:widget_visibility_polling
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:merge_ref_head_comments
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:mr_commit_neighbor_nav
,
@project
,
default_enabled:
true
)
...
...
app/helpers/projects_helper.rb
View file @
46c67eb7
...
...
@@ -758,10 +758,6 @@ module ProjectsHelper
!
project
.
repository
.
gitlab_ci_yml
end
def
native_code_navigation_enabled?
(
project
)
Feature
.
enabled?
(
:code_navigation
,
project
,
default_enabled:
true
)
end
def
show_visibility_confirm_modal?
(
project
)
project
.
unlink_forks_upon_visibility_decrease_enabled?
&&
project
.
visibility_level
>
Gitlab
::
VisibilityLevel
::
PRIVATE
&&
project
.
forks_count
>
0
end
...
...
app/serializers/diffs_entity.rb
View file @
46c67eb7
...
...
@@ -78,7 +78,7 @@ class DiffsEntity < Grape::Entity
options
[
:merge_request_diffs
]
end
expose
:definition_path_prefix
,
if:
->
(
diff_file
)
{
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
,
default_enabled:
true
)
}
do
|
diffs
|
expose
:definition_path_prefix
do
|
diffs
|
project_blob_path
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
end
...
...
@@ -89,8 +89,6 @@ class DiffsEntity < Grape::Entity
private
def
code_navigation_path
(
diffs
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
,
default_enabled:
true
)
Gitlab
::
CodeNavigationPath
.
new
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
end
...
...
app/serializers/paginated_diff_entity.rb
View file @
46c67eb7
...
...
@@ -37,8 +37,6 @@ class PaginatedDiffEntity < Grape::Entity
private
def
code_navigation_path
(
diffs
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
merge_request
.
project
,
default_enabled:
true
)
Gitlab
::
CodeNavigationPath
.
new
(
merge_request
.
project
,
diffs
.
diff_refs
&
.
head_sha
)
end
...
...
app/services/ci/create_job_artifacts_service.rb
View file @
46c67eb7
...
...
@@ -52,24 +52,15 @@ module Ci
attr_reader
:job
,
:project
def
validate_requirements
(
artifact_type
:,
filesize
:)
return
forbidden_type_error
(
artifact_type
)
if
forbidden_type?
(
artifact_type
)
return
too_large_error
if
too_large?
(
artifact_type
,
filesize
)
success
end
def
forbidden_type?
(
type
)
lsif?
(
type
)
&&
!
code_navigation_enabled?
end
def
too_large?
(
type
,
size
)
size
>
max_size
(
type
)
if
size
end
def
code_navigation_enabled?
Feature
.
enabled?
(
:code_navigation
,
project
,
default_enabled:
true
)
end
def
lsif?
(
type
)
type
==
LSIF_ARTIFACT_TYPE
end
...
...
app/views/projects/merge_requests/show.html.haml
View file @
46c67eb7
...
...
@@ -43,7 +43,6 @@
.tab-content
#diff-notes-app
#js-diff-file-finder
-
if
native_code_navigation_enabled?
(
@project
)
#js-code-navigation
=
render
"projects/merge_requests/tabs/pane"
,
id:
"notes"
,
class:
"notes voting_notes"
do
.row
...
...
config/feature_flags/development/code_navigation.yml
deleted
100644 → 0
View file @
21dd0ed7
---
name
:
code_navigation
introduced_by_url
:
rollout_issue_url
:
group
:
type
:
development
default_enabled
:
true
lib/gitlab/code_navigation_path.rb
View file @
46c67eb7
...
...
@@ -13,7 +13,6 @@ module Gitlab
end
def
full_json_path_for
(
path
)
return
unless
Feature
.
enabled?
(
:code_navigation
,
project
,
default_enabled:
true
)
return
unless
build
raw_project_job_artifacts_path
(
project
,
build
,
path:
"lsif/
#{
path
}
.json"
,
file_type: :lsif
)
...
...
spec/lib/gitlab/code_navigation_path_spec.rb
View file @
46c67eb7
...
...
@@ -16,10 +16,6 @@ RSpec.describe Gitlab::CodeNavigationPath do
subject
{
described_class
.
new
(
project
,
commit_sha
).
full_json_path_for
(
path
)
}
before
do
stub_feature_flags
(
code_navigation:
project
)
end
context
'when a pipeline exist for a sha'
do
it
'returns path to a file in the artifact'
do
expect
(
subject
).
to
eq
(
lsif_path
)
...
...
@@ -41,15 +37,5 @@ RSpec.describe Gitlab::CodeNavigationPath do
expect
(
subject
).
to
eq
(
lsif_path
)
end
end
context
'when code_navigation feature is disabled'
do
before
do
stub_feature_flags
(
code_navigation:
false
)
end
it
'returns nil'
do
expect
(
subject
).
to
be_nil
end
end
end
end
spec/requests/api/ci/runner/jobs_artifacts_spec.rb
View file @
46c67eb7
...
...
@@ -227,10 +227,6 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
end
context
'authorize uploading of an lsif artifact'
do
before
do
stub_feature_flags
(
code_navigation:
job
.
project
)
end
it
'adds ProcessLsif header'
do
authorize_artifacts_with_token_in_headers
(
artifact_type: :lsif
)
...
...
@@ -249,32 +245,6 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
.
to
change
{
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events
(
tracking_params
)
}
.
by
(
1
)
end
context
'code_navigation feature flag is disabled'
do
before
do
stub_feature_flags
(
code_navigation:
false
)
end
it
'responds with a forbidden error'
do
authorize_artifacts_with_token_in_headers
(
artifact_type: :lsif
)
aggregate_failures
do
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
expect
(
json_response
[
'ProcessLsif'
]).
to
be_falsy
end
end
it
'does not track code_intelligence usage ping'
do
tracking_params
=
{
event_names:
'i_source_code_code_intelligence'
,
start_date:
Date
.
yesterday
,
end_date:
Date
.
today
}
expect
{
authorize_artifacts_with_token_in_headers
(
artifact_type: :lsif
)
}
.
not_to
change
{
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events
(
tracking_params
)
}
end
end
end
def
authorize_artifacts
(
params
=
{},
request_headers
=
headers
)
...
...
spec/serializers/diffs_entity_spec.rb
View file @
46c67eb7
...
...
@@ -68,15 +68,5 @@ RSpec.describe DiffsEntity do
end
end
end
context
'when code_navigation feature flag is disabled'
do
it
'does not include code navigation properties'
do
stub_feature_flags
(
code_navigation:
false
)
expect
(
Gitlab
::
CodeNavigationPath
).
not_to
receive
(
:new
)
expect
(
subject
).
not_to
include
(
:definition_path_prefix
)
end
end
end
end
spec/serializers/paginated_diff_entity_spec.rb
View file @
46c67eb7
...
...
@@ -31,14 +31,4 @@ RSpec.describe PaginatedDiffEntity do
total_pages:
7
)
end
context
'when code_navigation feature flag is disabled'
do
it
'does not execute Gitlab::CodeNavigationPath'
do
stub_feature_flags
(
code_navigation:
false
)
expect
(
Gitlab
::
CodeNavigationPath
).
not_to
receive
(
:new
)
subject
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