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
a2c02c7a
Commit
a2c02c7a
authored
Apr 17, 2020
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate /plugins directory
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d505787c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
0 deletions
+35
-0
app/views/shared/file_hooks/_index.html.haml
app/views/shared/file_hooks/_index.html.haml
+4
-0
changelogs/unreleased/dz-deprecate-plugins-dir.yml
changelogs/unreleased/dz-deprecate-plugins-dir.yml
+5
-0
lib/tasks/file_hooks.rake
lib/tasks/file_hooks.rake
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/admin/admin_hooks_spec.rb
spec/features/admin/admin_hooks_spec.rb
+18
-0
No files found.
app/views/shared/file_hooks/_index.html.haml
View file @
a2c02c7a
...
...
@@ -19,6 +19,10 @@
%li
.monospace
=
File
.
basename
(
file
)
-
if
File
.
dirname
(
file
).
ends_with?
(
'plugins'
)
.text-warning
=
_
(
'Plugins directory is deprecated and will be removed in 14.0. Please move this file into /file_hooks directory.'
)
-
else
.card.bg-light.text-center
.nothing-here-block
=
_
(
'No file hooks found.'
)
changelogs/unreleased/dz-deprecate-plugins-dir.yml
0 → 100644
View file @
a2c02c7a
---
title
:
Deprecate /plugins directory
merge_request
:
29678
author
:
type
:
deprecated
lib/tasks/file_hooks.rake
View file @
a2c02c7a
...
...
@@ -4,6 +4,11 @@ namespace :file_hooks do
puts
'Validating file hooks from /file_hooks and /plugins directories'
Gitlab
::
FileHook
.
files
.
each
do
|
file
|
if
File
.
dirname
(
file
).
ends_with?
(
'plugins'
)
puts
'DEPRECATED: /plugins directory is deprecated and will be removed in 14.0. '
\
'Please move your files into /file_hooks directory.'
end
success
,
message
=
Gitlab
::
FileHook
.
execute
(
file
,
Gitlab
::
DataBuilder
::
Push
::
SAMPLE_DATA
)
if
success
...
...
locale/gitlab.pot
View file @
a2c02c7a
...
...
@@ -15091,6 +15091,9 @@ msgstr ""
msgid "Please wait while we import the repository for you. Refresh at will."
msgstr ""
msgid "Plugins directory is deprecated and will be removed in 14.0. Please move this file into /file_hooks directory."
msgstr ""
msgid "Pod does not exist"
msgstr ""
...
...
spec/features/admin/admin_hooks_spec.rb
View file @
a2c02c7a
...
...
@@ -36,6 +36,24 @@ describe 'Admin::Hooks' do
expect
(
page
).
to
have_content
(
'foo.rb'
)
expect
(
page
).
to
have_content
(
'bar.clj'
)
end
context
'deprecation warning'
do
it
'shows warning for plugins directory'
do
allow
(
Gitlab
::
FileHook
).
to
receive
(
:files
).
and_return
([
'plugins/foo.rb'
])
visit
admin_hooks_path
expect
(
page
).
to
have_content
(
'Plugins directory is deprecated and will be removed in 14.0'
)
end
it
'does not show warning for file_hooks directory'
do
allow
(
Gitlab
::
FileHook
).
to
receive
(
:files
).
and_return
([
'file_hooks/foo.rb'
])
visit
admin_hooks_path
expect
(
page
).
not_to
have_content
(
'Plugins directory is deprecated and will be removed in 14.0'
)
end
end
end
describe
'New Hook'
do
...
...
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