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
431540fb
Commit
431540fb
authored
Aug 24, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
9395be32
812a57a4
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
43 additions
and
37 deletions
+43
-37
app/models/repository.rb
app/models/repository.rb
+5
-1
db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb
...ve_allow_editing_commit_messages_from_project_settings.rb
+0
-17
db/schema_migrations/20210823193234
db/schema_migrations/20210823193234
+0
-1
db/structure.sql
db/structure.sql
+1
-0
doc/ci/yaml/index.md
doc/ci/yaml/index.md
+3
-3
ee/app/services/geo/framework_repository_sync_service.rb
ee/app/services/geo/framework_repository_sync_service.rb
+2
-1
ee/app/services/geo/repository_base_sync_service.rb
ee/app/services/geo/repository_base_sync_service.rb
+10
-0
ee/app/services/geo/repository_sync_service.rb
ee/app/services/geo/repository_sync_service.rb
+0
-9
ee/spec/services/geo/design_repository_sync_service_spec.rb
ee/spec/services/geo/design_repository_sync_service_spec.rb
+3
-4
ee/spec/services/geo/repository_sync_service_spec.rb
ee/spec/services/geo/repository_sync_service_spec.rb
+1
-1
ee/spec/services/geo/wiki_sync_service_spec.rb
ee/spec/services/geo/wiki_sync_service_spec.rb
+11
-0
ee/spec/support/shared_examples/services/base_sync_service_shared_examples.rb
...ed_examples/services/base_sync_service_shared_examples.rb
+7
-0
No files found.
app/models/repository.rb
View file @
431540fb
...
@@ -1125,7 +1125,11 @@ class Repository
...
@@ -1125,7 +1125,11 @@ class Repository
copy_gitattributes
(
branch
)
copy_gitattributes
(
branch
)
after_change_head
after_change_head
else
else
# For example, `Wiki` does not have `errors` because it is not an `ActiveModel`
if
container
.
respond_to?
(
:errors
)
container
.
errors
.
add
(
:base
,
_
(
"Could not change HEAD: branch '%{branch}' does not exist"
)
%
{
branch:
branch
})
container
.
errors
.
add
(
:base
,
_
(
"Could not change HEAD: branch '%{branch}' does not exist"
)
%
{
branch:
branch
})
end
false
false
end
end
end
end
...
...
db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb
deleted
100644 → 0
View file @
9395be32
# frozen_string_literal: true
class
RemoveAllowEditingCommitMessagesFromProjectSettings
<
ActiveRecord
::
Migration
[
6.1
]
include
Gitlab
::
Database
::
MigrationHelpers
def
up
with_lock_retries
do
remove_column
:project_settings
,
:allow_editing_commit_messages
end
end
def
down
with_lock_retries
do
add_column
:project_settings
,
:allow_editing_commit_messages
,
:boolean
,
default:
false
,
null:
false
end
end
end
db/schema_migrations/20210823193234
deleted
100644 → 0
View file @
9395be32
b85ef326056bb152d527e34b49caa3c40ee8685c3b14654992246c6adf082f8c
\ No newline at end of file
db/structure.sql
View file @
431540fb
...
@@ -17343,6 +17343,7 @@ CREATE TABLE project_settings (
...
@@ -17343,6 +17343,7 @@ CREATE TABLE project_settings (
squash_option smallint DEFAULT 3,
squash_option smallint DEFAULT 3,
has_confluence boolean DEFAULT false NOT NULL,
has_confluence boolean DEFAULT false NOT NULL,
has_vulnerabilities boolean DEFAULT false NOT NULL,
has_vulnerabilities boolean DEFAULT false NOT NULL,
allow_editing_commit_messages boolean DEFAULT false NOT NULL,
prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL,
prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL,
cve_id_request_enabled boolean DEFAULT true NOT NULL,
cve_id_request_enabled boolean DEFAULT true NOT NULL,
mr_default_target_self boolean DEFAULT false NOT NULL,
mr_default_target_self boolean DEFAULT false NOT NULL,
doc/ci/yaml/index.md
View file @
431540fb
...
@@ -1595,7 +1595,9 @@ production:
...
@@ -1595,7 +1595,9 @@ production:
can refer to jobs in the same stage as the job you are configuring. This feature is
can refer to jobs in the same stage as the job you are configuring. This feature is
enabled on GitLab.com and ready for production use. On self-managed
[
GitLab 14.2 and later
](
https://gitlab.com/gitlab-org/gitlab/-/issues/30632
)
enabled on GitLab.com and ready for production use. On self-managed
[
GitLab 14.2 and later
](
https://gitlab.com/gitlab-org/gitlab/-/issues/30632
)
this feature is available by default.
this feature is available by default.
-
In GitLab 14.0 and older, you can only refer to jobs in earlier stages.
-
In GitLab 14.0 and older, you can only refer to jobs in earlier stages. Stages must be
explicitly defined for all jobs that use the
`needs:`
keyword, or are referenced
in a job's
`needs:`
section.
-
In GitLab 13.9 and older, if
`needs:`
refers to a job that might not be added to
-
In GitLab 13.9 and older, if
`needs:`
refers to a job that might not be added to
a pipeline because of
`only`
,
`except`
, or
`rules`
, the pipeline might fail to create.
a pipeline because of
`only`
,
`except`
, or
`rules`
, the pipeline might fail to create.
-
The maximum number of jobs that a single job can need in the
`needs:`
array is limited:
-
The maximum number of jobs that a single job can need in the
`needs:`
array is limited:
...
@@ -1609,8 +1611,6 @@ production:
...
@@ -1609,8 +1611,6 @@ production:
-
`needs:`
is similar to
`dependencies:`
in that it must use jobs from prior stages,
-
`needs:`
is similar to
`dependencies:`
in that it must use jobs from prior stages,
meaning it's impossible to create circular dependencies. Depending on jobs in the
meaning it's impossible to create circular dependencies. Depending on jobs in the
current stage is not possible either, but
[
an issue exists
](
https://gitlab.com/gitlab-org/gitlab/-/issues/30632
)
.
current stage is not possible either, but
[
an issue exists
](
https://gitlab.com/gitlab-org/gitlab/-/issues/30632
)
.
-
Stages must be explicitly defined for all jobs
that have the keyword
`needs:`
or are referred to by one.
##### Changing the `needs:` job limit **(FREE SELF)**
##### Changing the `needs:` job limit **(FREE SELF)**
...
...
ee/app/services/geo/framework_repository_sync_service.rb
View file @
431540fb
...
@@ -37,7 +37,6 @@ module Geo
...
@@ -37,7 +37,6 @@ module Geo
def
sync_repository
def
sync_repository
start_registry_sync!
start_registry_sync!
fetch_repository
fetch_repository
update_root_ref
mark_sync_as_successful
mark_sync_as_successful
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
log_info
(
'Marking the repository for a forced re-download'
)
log_info
(
'Marking the repository for a forced re-download'
)
...
@@ -83,6 +82,8 @@ module Geo
...
@@ -83,6 +82,8 @@ module Geo
fetch_geo_mirror
(
repository
)
fetch_geo_mirror
(
repository
)
@new_repository
=
true
@new_repository
=
true
end
end
update_root_ref
end
end
def
redownload_repository
def
redownload_repository
...
...
ee/app/services/geo/repository_base_sync_service.rb
View file @
431540fb
...
@@ -63,6 +63,8 @@ module Geo
...
@@ -63,6 +63,8 @@ module Geo
fetch_geo_mirror
(
repository
)
fetch_geo_mirror
(
repository
)
@new_repository
=
true
@new_repository
=
true
end
end
update_root_ref
end
end
def
redownload?
def
redownload?
...
@@ -270,5 +272,13 @@ module Geo
...
@@ -270,5 +272,13 @@ module Geo
checksum
=
project
.
repository_state
.
public_send
(
"
#{
type
}
_verification_checksum"
)
# rubocop:disable GitlabSecurity/PublicSend
checksum
=
project
.
repository_state
.
public_send
(
"
#{
type
}
_verification_checksum"
)
# rubocop:disable GitlabSecurity/PublicSend
checksum
&&
checksum
!=
Gitlab
::
Git
::
Repository
::
EMPTY_REPOSITORY_CHECKSUM
checksum
&&
checksum
!=
Gitlab
::
Git
::
Repository
::
EMPTY_REPOSITORY_CHECKSUM
end
end
def
update_root_ref
authorization
=
::
Gitlab
::
Geo
::
RepoSyncRequest
.
new
(
scope:
repository
.
full_path
).
authorization
repository
.
update_root_ref
(
remote_url
,
authorization
)
end
end
end
end
end
ee/app/services/geo/repository_sync_service.rb
View file @
431540fb
...
@@ -9,7 +9,6 @@ module Geo
...
@@ -9,7 +9,6 @@ module Geo
def
sync_repository
def
sync_repository
start_registry_sync!
start_registry_sync!
fetch_repository
fetch_repository
update_root_ref
mark_sync_as_successful
mark_sync_as_successful
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
log_info
(
'Setting force_to_redownload flag'
)
log_info
(
'Setting force_to_redownload flag'
)
...
@@ -49,14 +48,6 @@ module Geo
...
@@ -49,14 +48,6 @@ module Geo
project
.
ensure_repository
project
.
ensure_repository
end
end
def
update_root_ref
authorization
=
::
Gitlab
::
Geo
::
RepoSyncRequest
.
new
(
scope:
repository
.
full_path
).
authorization
repository
.
update_root_ref
(
remote_url
,
authorization
)
end
def
execute_housekeeping
def
execute_housekeeping
Geo
::
ProjectHousekeepingService
.
new
(
project
,
new_repository:
new_repository?
).
execute
Geo
::
ProjectHousekeepingService
.
new
(
project
,
new_repository:
new_repository?
).
execute
end
end
...
...
ee/spec/services/geo/design_repository_sync_service_spec.rb
View file @
431540fb
...
@@ -35,12 +35,11 @@ RSpec.describe Geo::DesignRepositorySyncService do
...
@@ -35,12 +35,11 @@ RSpec.describe Geo::DesignRepositorySyncService do
stub_exclusive_lease
(
lease_key
,
lease_uuid
)
stub_exclusive_lease
(
lease_key
,
lease_uuid
)
stub_exclusive_lease
(
"geo_project_housekeeping:
#{
project
.
id
}
"
)
stub_exclusive_lease
(
"geo_project_housekeeping:
#{
project
.
id
}
"
)
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_as_mirror
)
allow
(
repository
).
to
receive
(
:fetch_as_mirror
).
and_return
(
true
)
.
and_return
(
true
)
allow
_any_instance_of
(
R
epository
)
allow
(
r
epository
)
.
to
receive
(
:find_remote_root_ref
)
.
to
receive
(
:find_remote_root_ref
)
.
with
(
url_to_repo
)
.
with
(
url_to_repo
,
anything
)
.
and_return
(
'master'
)
.
and_return
(
'master'
)
allow_any_instance_of
(
Geo
::
ProjectHousekeepingService
).
to
receive
(
:execute
)
allow_any_instance_of
(
Geo
::
ProjectHousekeepingService
).
to
receive
(
:execute
)
...
...
ee/spec/services/geo/repository_sync_service_spec.rb
View file @
431540fb
...
@@ -34,7 +34,7 @@ RSpec.describe Geo::RepositorySyncService, :geo do
...
@@ -34,7 +34,7 @@ RSpec.describe Geo::RepositorySyncService, :geo do
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_as_mirror
)
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_as_mirror
)
.
and_return
(
true
)
.
and_return
(
true
)
allow
_any_instance_of
(
R
epository
)
allow
(
r
epository
)
.
to
receive
(
:find_remote_root_ref
)
.
to
receive
(
:find_remote_root_ref
)
.
with
(
url_to_repo
,
anything
)
.
with
(
url_to_repo
,
anything
)
.
and_return
(
'master'
)
.
and_return
(
'master'
)
...
...
ee/spec/services/geo/wiki_sync_service_spec.rb
View file @
431540fb
...
@@ -45,6 +45,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
...
@@ -45,6 +45,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
end
end
it
'voids the failure message when it succeeds after an error'
do
it
'voids the failure message when it succeeds after an error'
do
allow
(
repository
).
to
receive
(
:update_root_ref
)
registry
=
create
(
:geo_project_registry
,
project:
project
,
last_wiki_sync_failure:
'error'
)
registry
=
create
(
:geo_project_registry
,
project:
project
,
last_wiki_sync_failure:
'error'
)
expect
{
subject
.
execute
}.
to
change
{
registry
.
reload
.
last_wiki_sync_failure
}.
to
(
nil
)
expect
{
subject
.
execute
}.
to
change
{
registry
.
reload
.
last_wiki_sync_failure
}.
to
(
nil
)
...
@@ -126,6 +128,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
...
@@ -126,6 +128,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
end
end
it
'marks primary_wiki_checksummed as true when wiki has been verified on primary'
do
it
'marks primary_wiki_checksummed as true when wiki has been verified on primary'
do
allow
(
repository
).
to
receive
(
:update_root_ref
)
create
(
:repository_state
,
:wiki_verified
,
project:
project
)
create
(
:repository_state
,
:wiki_verified
,
project:
project
)
registry
=
create
(
:geo_project_registry
,
project:
project
,
primary_wiki_checksummed:
false
)
registry
=
create
(
:geo_project_registry
,
project:
project
,
primary_wiki_checksummed:
false
)
...
@@ -133,6 +137,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
...
@@ -133,6 +137,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
end
end
it
'marks primary_wiki_checksummed as false when wiki has not been verified on primary'
do
it
'marks primary_wiki_checksummed as false when wiki has not been verified on primary'
do
allow
(
repository
).
to
receive
(
:update_root_ref
)
create
(
:repository_state
,
:wiki_failed
,
project:
project
)
create
(
:repository_state
,
:wiki_failed
,
project:
project
)
registry
=
create
(
:geo_project_registry
,
project:
project
,
primary_wiki_checksummed:
true
)
registry
=
create
(
:geo_project_registry
,
project:
project
,
primary_wiki_checksummed:
true
)
...
@@ -166,6 +172,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
...
@@ -166,6 +172,8 @@ RSpec.describe Geo::WikiSyncService, :geo do
end
end
it
'sets last_wiki_successful_sync_at'
do
it
'sets last_wiki_successful_sync_at'
do
allow
(
repository
).
to
receive
(
:update_root_ref
)
subject
.
execute
subject
.
execute
expect
(
registry
.
last_wiki_successful_sync_at
).
not_to
be_nil
expect
(
registry
.
last_wiki_successful_sync_at
).
not_to
be_nil
...
@@ -190,7 +198,9 @@ RSpec.describe Geo::WikiSyncService, :geo do
...
@@ -190,7 +198,9 @@ RSpec.describe Geo::WikiSyncService, :geo do
end
end
it
'logs success with timings'
do
it
'logs success with timings'
do
allow
(
repository
).
to
receive
(
:update_root_ref
)
allow
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
and_call_original
allow
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
and_call_original
expect
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
with
(
hash_including
(
:message
,
:update_delay_s
,
:download_time_s
)).
and_call_original
expect
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
with
(
hash_including
(
:message
,
:update_delay_s
,
:download_time_s
)).
and_call_original
subject
.
execute
subject
.
execute
...
@@ -232,6 +242,7 @@ RSpec.describe Geo::WikiSyncService, :geo do
...
@@ -232,6 +242,7 @@ RSpec.describe Geo::WikiSyncService, :geo do
force_to_redownload_wiki:
true
force_to_redownload_wiki:
true
)
)
allow
(
project
.
wiki
.
repository
).
to
receive
(
:update_root_ref
)
expect
(
project
.
wiki
.
repository
).
to
receive
(
:expire_exists_cache
).
exactly
(
3
).
times
.
and_call_original
expect
(
project
.
wiki
.
repository
).
to
receive
(
:expire_exists_cache
).
exactly
(
3
).
times
.
and_call_original
expect
(
subject
).
not_to
receive
(
:fail_registry_sync!
)
expect
(
subject
).
not_to
receive
(
:fail_registry_sync!
)
...
...
ee/spec/support/shared_examples/services/base_sync_service_shared_examples.rb
View file @
431540fb
...
@@ -65,6 +65,7 @@ RSpec.shared_examples 'geo base sync fetch' do
...
@@ -65,6 +65,7 @@ RSpec.shared_examples 'geo base sync fetch' do
before
do
before
do
allow
(
subject
).
to
receive
(
:fetch_geo_mirror
).
and_return
(
true
)
allow
(
subject
).
to
receive
(
:fetch_geo_mirror
).
and_return
(
true
)
allow
(
repository
).
to
receive
(
:update_root_ref
)
end
end
it
'cleans up temporary repository'
do
it
'cleans up temporary repository'
do
...
@@ -79,6 +80,12 @@ RSpec.shared_examples 'geo base sync fetch' do
...
@@ -79,6 +80,12 @@ RSpec.shared_examples 'geo base sync fetch' do
fetch_repository
fetch_repository
end
end
it
'syncs the HEAD ref'
do
expect
(
repository
).
to
receive
(
:update_root_ref
)
fetch_repository
end
context
'repository does not exist'
do
context
'repository does not exist'
do
before
do
before
do
allow_any_instance_of
(
Repository
).
to
receive
(
:exists?
)
{
false
}
allow_any_instance_of
(
Repository
).
to
receive
(
:exists?
)
{
false
}
...
...
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