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
c84dc339
Commit
c84dc339
authored
May 31, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
30768b3b
9a8955d3
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
9 additions
and
156 deletions
+9
-156
GITALY_SERVER_VERSION
GITALY_SERVER_VERSION
+1
-1
changelogs/unreleased/gitaly-version-v1.43.0.yml
changelogs/unreleased/gitaly-version-v1.43.0.yml
+5
-0
doc/administration/raketasks/maintenance.md
doc/administration/raketasks/maintenance.md
+0
-19
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+0
-28
lib/tasks/gitlab/shell.rake
lib/tasks/gitlab/shell.rake
+0
-12
spec/features/projects/import_export/import_file_spec.rb
spec/features/projects/import_export/import_file_spec.rb
+0
-1
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+0
-52
spec/lib/gitlab/import_export/repo_restorer_spec.rb
spec/lib/gitlab/import_export/repo_restorer_spec.rb
+0
-6
spec/lib/gitlab/shell_spec.rb
spec/lib/gitlab/shell_spec.rb
+0
-10
spec/support/helpers/git_helpers.rb
spec/support/helpers/git_helpers.rb
+0
-8
spec/tasks/gitlab/shell_rake_spec.rb
spec/tasks/gitlab/shell_rake_spec.rb
+1
-17
spec/tasks/tokens_spec.rb
spec/tasks/tokens_spec.rb
+2
-2
No files found.
GITALY_SERVER_VERSION
View file @
c84dc339
1.4
2.1
1.4
3.0
changelogs/unreleased/gitaly-version-v1.43.0.yml
0 → 100644
View file @
c84dc339
---
title
:
Upgrade to Gitaly v1.43.0
merge_request
:
28867
author
:
type
:
changed
doc/administration/raketasks/maintenance.md
View file @
c84dc339
...
...
@@ -205,25 +205,6 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:track_deployment RAILS_ENV=production
```
## Create or repair repository hooks symlink
If the GitLab shell hooks directory location changes or another circumstance
leads to the hooks symlink becoming missing or invalid, run this Rake task
to create or repair the symlinks.
**Omnibus Installation**
```
sudo gitlab-rake gitlab:shell:create_hooks
```
**Source Installation**
```
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:shell:create_hooks RAILS_ENV=production
```
## Check TCP connectivity to a remote site
Sometimes you need to know if your GitLab installation can connect to a TCP
...
...
lib/gitlab/git/repository.rb
View file @
c84dc339
...
...
@@ -34,34 +34,6 @@ module Gitlab
TagExistsError
=
Class
.
new
(
StandardError
)
ChecksumError
=
Class
.
new
(
StandardError
)
class
<<
self
def
create_hooks
(
repo_path
,
global_hooks_path
)
local_hooks_path
=
File
.
join
(
repo_path
,
'hooks'
)
real_local_hooks_path
=
:not_found
begin
real_local_hooks_path
=
File
.
realpath
(
local_hooks_path
)
rescue
Errno
::
ENOENT
# real_local_hooks_path == :not_found
end
# Do nothing if hooks already exist
unless
real_local_hooks_path
==
File
.
realpath
(
global_hooks_path
)
if
File
.
exist?
(
local_hooks_path
)
# Move the existing hooks somewhere safe
FileUtils
.
mv
(
local_hooks_path
,
"
#{
local_hooks_path
}
.old.
#{
Time
.
now
.
to_i
}
"
)
end
# Create the hooks symlink
FileUtils
.
ln_sf
(
global_hooks_path
,
local_hooks_path
)
end
true
end
end
# Directory name of repo
attr_reader
:name
...
...
lib/tasks/gitlab/shell.rake
View file @
c84dc339
...
...
@@ -51,9 +51,6 @@ namespace :gitlab do
end
end
# (Re)create hooks
Rake
::
Task
[
'gitlab:shell:create_hooks'
].
invoke
Gitlab
::
Shell
.
ensure_secret_token!
end
...
...
@@ -78,15 +75,6 @@ namespace :gitlab do
end
end
end
desc
'Create or repair repository hooks symlink'
task
create_hooks: :gitlab_environment
do
warn_user_is_not_gitlab
puts
'Creating/Repairing hooks symlinks for all repositories'
system
(
*
%W(
#{
Gitlab
.
config
.
gitlab_shell
.
path
}
/bin/create-hooks)
+
repository_storage_paths_args
)
puts
'done'
.
color
(
:green
)
end
end
def
setup
...
...
spec/features/projects/import_export/import_file_spec.rb
View file @
c84dc339
...
...
@@ -47,7 +47,6 @@ describe 'Import/Export - project import integration test', :js do
expect
(
project
.
description
).
to
eq
(
"Foo Bar"
)
expect
(
project
.
issues
).
not_to
be_empty
expect
(
project
.
merge_requests
).
not_to
be_empty
expect
(
project_hook_exists?
(
project
)).
to
be
true
expect
(
wiki_exists?
(
project
)).
to
be
true
expect
(
project
.
import_state
.
status
).
to
eq
(
'finished'
)
end
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
c84dc339
...
...
@@ -29,51 +29,6 @@ describe Gitlab::Git::Repository, :seed_helper do
let
(
:storage_path
)
{
TestEnv
.
repos_path
}
let
(
:user
)
{
build
(
:user
)
}
describe
'.create_hooks'
do
let
(
:repo_path
)
{
File
.
join
(
storage_path
,
'hook-test.git'
)
}
let
(
:hooks_dir
)
{
File
.
join
(
repo_path
,
'hooks'
)
}
let
(
:target_hooks_dir
)
{
Gitlab
::
Shell
.
new
.
hooks_path
}
let
(
:existing_target
)
{
File
.
join
(
repo_path
,
'foobar'
)
}
before
do
FileUtils
.
rm_rf
(
repo_path
)
FileUtils
.
mkdir_p
(
repo_path
)
end
context
'hooks is a directory'
do
let
(
:existing_file
)
{
File
.
join
(
hooks_dir
,
'my-file'
)
}
before
do
FileUtils
.
mkdir_p
(
hooks_dir
)
FileUtils
.
touch
(
existing_file
)
described_class
.
create_hooks
(
repo_path
,
target_hooks_dir
)
end
it
{
expect
(
File
.
readlink
(
hooks_dir
)).
to
eq
(
target_hooks_dir
)
}
it
{
expect
(
Dir
[
File
.
join
(
repo_path
,
"hooks.old.*/my-file"
)].
count
).
to
eq
(
1
)
}
end
context
'hooks is a valid symlink'
do
before
do
FileUtils
.
mkdir_p
existing_target
File
.
symlink
(
existing_target
,
hooks_dir
)
described_class
.
create_hooks
(
repo_path
,
target_hooks_dir
)
end
it
{
expect
(
File
.
readlink
(
hooks_dir
)).
to
eq
(
target_hooks_dir
)
}
end
context
'hooks is a broken symlink'
do
before
do
FileUtils
.
rm_f
(
existing_target
)
File
.
symlink
(
existing_target
,
hooks_dir
)
described_class
.
create_hooks
(
repo_path
,
target_hooks_dir
)
end
it
{
expect
(
File
.
readlink
(
hooks_dir
)).
to
eq
(
target_hooks_dir
)
}
end
end
describe
"Respond to"
do
subject
{
repository
}
...
...
@@ -1959,13 +1914,6 @@ describe Gitlab::Git::Repository, :seed_helper do
expect
{
imported_repo
.
fsck
}.
not_to
raise_exception
end
it
'creates a symlink to the global hooks dir'
do
imported_repo
.
create_from_bundle
(
valid_bundle_path
)
hooks_path
=
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
{
File
.
join
(
imported_repo
.
path
,
'hooks'
)
}
expect
(
File
.
readlink
(
hooks_path
)).
to
eq
(
Gitlab
::
Shell
.
new
.
hooks_path
)
end
it
'raises an error if the bundle is an attempted malicious payload'
do
expect
do
imported_repo
.
create_from_bundle
(
malicious_bundle_path
)
...
...
spec/lib/gitlab/import_export/repo_restorer_spec.rb
View file @
c84dc339
...
...
@@ -34,11 +34,5 @@ describe Gitlab::ImportExport::RepoRestorer do
it
'restores the repo successfully'
do
expect
(
restorer
.
restore
).
to
be_truthy
end
it
'has the webhooks'
do
restorer
.
restore
expect
(
project_hook_exists?
(
project
)).
to
be
true
end
end
end
spec/lib/gitlab/shell_spec.rb
View file @
c84dc339
...
...
@@ -612,16 +612,6 @@ describe Gitlab::Shell do
FileUtils
.
rm_rf
(
created_path
)
end
it
'creates a repository'
do
expect
(
gitlab_shell
.
create_repository
(
repository_storage
,
repo_name
,
repo_name
)).
to
be_truthy
expect
(
File
.
stat
(
created_path
).
mode
&
0
o777
).
to
eq
(
0
o770
)
hooks_path
=
File
.
join
(
created_path
,
'hooks'
)
expect
(
File
.
lstat
(
hooks_path
)).
to
be_symlink
expect
(
File
.
realpath
(
hooks_path
)).
to
eq
(
gitlab_shell_hooks_path
)
end
it
'returns false when the command fails'
do
FileUtils
.
mkdir_p
(
File
.
dirname
(
created_path
))
# This file will block the creation of the repo's .git directory. That
...
...
spec/support/helpers/git_helpers.rb
View file @
c84dc339
...
...
@@ -6,12 +6,4 @@ module GitHelpers
Rugged
::
Repository
.
new
(
path
)
end
def
project_hook_exists?
(
project
)
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
project_path
=
project
.
repository
.
raw_repository
.
path
File
.
exist?
(
File
.
join
(
project_path
,
'hooks'
,
'post-receive'
))
end
end
end
spec/tasks/gitlab/shell_rake_spec.rb
View file @
c84dc339
...
...
@@ -7,14 +7,8 @@ describe 'gitlab:shell rake tasks' do
stub_warn_user_is_not_gitlab
end
after
do
TestEnv
.
sabotage_gitlab_shell_hooks
end
describe
'install task'
do
it
'invokes create_hooks task'
do
expect
(
Rake
::
Task
[
'gitlab:shell:create_hooks'
]).
to
receive
(
:invoke
)
it
'installs and compiles gitlab-shell'
do
storages
=
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
Gitlab
.
config
.
repositories
.
storages
.
values
.
map
(
&
:legacy_disk_path
)
end
...
...
@@ -24,14 +18,4 @@ describe 'gitlab:shell rake tasks' do
run_rake_task
(
'gitlab:shell:install'
)
end
end
describe
'create_hooks task'
do
it
'calls gitlab-shell bin/create_hooks'
do
expect_any_instance_of
(
Object
).
to
receive
(
:system
)
.
with
(
"
#{
Gitlab
.
config
.
gitlab_shell
.
path
}
/bin/create-hooks"
,
*
Gitlab
::
TaskHelpers
.
repository_storage_paths_args
)
run_rake_task
(
'gitlab:shell:create_hooks'
)
end
end
end
spec/tasks/tokens_spec.rb
View file @
c84dc339
...
...
@@ -8,13 +8,13 @@ describe 'tokens rake tasks' do
end
describe
'reset_all_email task'
do
it
'
invokes create_hooks task
'
do
it
'
changes the incoming email token
'
do
expect
{
run_rake_task
(
'tokens:reset_all_email'
)
}.
to
change
{
user
.
reload
.
incoming_email_token
}
end
end
describe
'reset_all_feed task'
do
it
'
invokes create_hooks task
'
do
it
'
changes the feed token for the user
'
do
expect
{
run_rake_task
(
'tokens:reset_all_feed'
)
}.
to
change
{
user
.
reload
.
feed_token
}
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