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
b173fe21
Commit
b173fe21
authored
Jan 26, 2022
by
Siddharth Asthana
Committed by
Markus Koller
Jan 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses
Changelog: other
parent
053b7006
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
25 deletions
+17
-25
.rubocop_todo/rails/save_bang.yml
.rubocop_todo/rails/save_bang.yml
+0
-7
spec/lib/gitlab/import_export/importer_spec.rb
spec/lib/gitlab/import_export/importer_spec.rb
+1
-1
spec/lib/gitlab/import_export/lfs_restorer_spec.rb
spec/lib/gitlab/import_export/lfs_restorer_spec.rb
+2
-2
spec/lib/gitlab/import_export/lfs_saver_spec.rb
spec/lib/gitlab/import_export/lfs_saver_spec.rb
+4
-4
spec/lib/gitlab/import_export/members_mapper_spec.rb
spec/lib/gitlab/import_export/members_mapper_spec.rb
+0
-1
spec/lib/gitlab/import_export/project/relation_factory_spec.rb
...lib/gitlab/import_export/project/relation_factory_spec.rb
+1
-1
spec/lib/gitlab/import_export/project/tree_restorer_spec.rb
spec/lib/gitlab/import_export/project/tree_restorer_spec.rb
+1
-1
spec/lib/gitlab/import_export/project/tree_saver_spec.rb
spec/lib/gitlab/import_export/project/tree_saver_spec.rb
+8
-8
No files found.
.rubocop_todo/rails/save_bang.yml
View file @
b173fe21
...
...
@@ -15,10 +15,3 @@ Rails/SaveBang:
-
spec/lib/gitlab/database/custom_structure_spec.rb
-
spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb
-
spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
-
spec/lib/gitlab/import_export/importer_spec.rb
-
spec/lib/gitlab/import_export/lfs_restorer_spec.rb
-
spec/lib/gitlab/import_export/lfs_saver_spec.rb
-
spec/lib/gitlab/import_export/members_mapper_spec.rb
-
spec/lib/gitlab/import_export/project/relation_factory_spec.rb
-
spec/lib/gitlab/import_export/project/tree_restorer_spec.rb
-
spec/lib/gitlab/import_export/project/tree_saver_spec.rb
spec/lib/gitlab/import_export/importer_spec.rb
View file @
b173fe21
...
...
@@ -17,7 +17,7 @@ RSpec.describe Gitlab::ImportExport::Importer do
stub_uploads_object_storage
(
FileUploader
)
FileUtils
.
mkdir_p
(
shared
.
export_path
)
ImportExportUpload
.
create
(
project:
project
,
import_file:
import_file
)
ImportExportUpload
.
create
!
(
project:
project
,
import_file:
import_file
)
allow
(
FileUtils
).
to
receive
(
:rm_rf
).
and_call_original
end
...
...
spec/lib/gitlab/import_export/lfs_restorer_spec.rb
View file @
b173fe21
...
...
@@ -36,7 +36,7 @@ RSpec.describe Gitlab::ImportExport::LfsRestorer do
)
end
saver
.
save
saver
.
save
# rubocop:disable Rails/SaveBang
project
.
lfs_objects
.
delete_all
end
...
...
@@ -81,7 +81,7 @@ RSpec.describe Gitlab::ImportExport::LfsRestorer do
context
'when there is not an existing `LfsObject`'
do
before
do
lfs_object
.
destroy
lfs_object
.
destroy
!
end
it
'creates a new lfs object'
do
...
...
spec/lib/gitlab/import_export/lfs_saver_spec.rb
View file @
b173fe21
...
...
@@ -34,13 +34,13 @@ RSpec.describe Gitlab::ImportExport::LfsSaver do
end
it
'does not cause errors'
do
saver
.
save
saver
.
save
# rubocop:disable Rails/SaveBang
expect
(
shared
.
errors
).
to
be_empty
end
it
'copies the file in the correct location when there is an lfs object'
do
saver
.
save
saver
.
save
# rubocop:disable Rails/SaveBang
expect
(
File
).
to
exist
(
"
#{
shared
.
export_path
}
/lfs-objects/
#{
lfs_object
.
oid
}
"
)
end
...
...
@@ -61,7 +61,7 @@ RSpec.describe Gitlab::ImportExport::LfsSaver do
end
it
'saves a json file correctly'
do
saver
.
save
saver
.
save
# rubocop:disable Rails/SaveBang
expect
(
File
.
exist?
(
lfs_json_file
)).
to
eq
(
true
)
expect
(
lfs_json
).
to
eq
(
...
...
@@ -96,7 +96,7 @@ RSpec.describe Gitlab::ImportExport::LfsSaver do
expect
(
fake_uri
).
to
receive
(
:open
).
and_return
(
StringIO
.
new
(
'LFS file content'
))
expect
(
URI
).
to
receive
(
:parse
).
with
(
'http://my-object-storage.local'
).
and_return
(
fake_uri
)
saver
.
save
saver
.
save
# rubocop:disable Rails/SaveBang
expect
(
File
.
read
(
exported_file_path
)).
to
eq
(
'LFS file content'
)
end
...
...
spec/lib/gitlab/import_export/members_mapper_spec.rb
View file @
b173fe21
...
...
@@ -243,7 +243,6 @@ RSpec.describe Gitlab::ImportExport::MembersMapper do
before
do
group
.
add_users
([
user
,
user2
],
GroupMember
::
DEVELOPER
)
user
.
update
(
public_email:
'invite@test.com'
)
end
it
'maps the importer'
do
...
...
spec/lib/gitlab/import_export/project/relation_factory_spec.rb
View file @
b173fe21
...
...
@@ -10,7 +10,7 @@ RSpec.describe Gitlab::ImportExport::Project::RelationFactory, :use_clean_rails_
let
(
:importer_user
)
{
admin
}
let
(
:excluded_keys
)
{
[]
}
let
(
:created_object
)
do
described_class
.
create
(
described_class
.
create
(
# rubocop:disable Rails/SaveBang
relation_sym:
relation_sym
,
relation_hash:
relation_hash
,
relation_index:
1
,
...
...
spec/lib/gitlab/import_export/project/tree_restorer_spec.rb
View file @
b173fe21
...
...
@@ -880,7 +880,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
before
do
group
=
create
(
:group
,
visibility_level:
group_visibility
)
group
.
add_users
([
user
],
GroupMember
::
MAINTAINER
)
project
.
update
(
group:
group
)
project
.
update
!
(
group:
group
)
end
context
'private group visibility'
do
...
...
spec/lib/gitlab/import_export/project/tree_saver_spec.rb
View file @
b173fe21
...
...
@@ -36,7 +36,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
project_tree_saver
=
described_class
.
new
(
project:
project
,
current_user:
user
,
shared:
shared
)
project_tree_saver
.
save
project_tree_saver
.
save
# rubocop:disable Rails/SaveBang
end
end
...
...
@@ -305,14 +305,14 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
end
before
do
user2
.
update
(
public_email:
user2
.
email
)
user2
.
update
!
(
public_email:
user2
.
email
)
group
.
add_developer
(
user2
)
end
context
'when has no permission'
do
before
do
group
.
add_developer
(
user
)
project_tree_saver
.
save
project_tree_saver
.
save
# rubocop:disable Rails/SaveBang
end
it
'does not export group members'
do
...
...
@@ -324,7 +324,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
before
do
group
.
add_maintainer
(
user
)
project_tree_saver
.
save
project_tree_saver
.
save
# rubocop:disable Rails/SaveBang
end
it
'does not export group members'
do
...
...
@@ -336,7 +336,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
before
do
group
.
add_owner
(
user
)
project_tree_saver
.
save
project_tree_saver
.
save
# rubocop:disable Rails/SaveBang
end
it
'exports group members as group owner'
do
...
...
@@ -348,7 +348,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
let
(
:user
)
{
create
(
:admin
)
}
before
do
project_tree_saver
.
save
project_tree_saver
.
save
# rubocop:disable Rails/SaveBang
end
context
'when admin mode is enabled'
,
:enable_admin_mode
do
...
...
@@ -376,7 +376,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
let
(
:relation_name
)
{
:projects
}
before
do
project_tree_saver
.
save
project_tree_saver
.
save
# rubocop:disable Rails/SaveBang
end
it
{
is_expected
.
to
include
({
'description'
=>
params
[
:description
]
})
}
...
...
@@ -471,7 +471,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
merge_request
=
create
(
:merge_request
,
source_project:
project
,
milestone:
milestone
)
ci_build
=
create
(
:ci_build
,
project:
project
,
when:
nil
)
ci_build
.
pipeline
.
update
(
project:
project
)
ci_build
.
pipeline
.
update
!
(
project:
project
)
create
(
:commit_status
,
project:
project
,
pipeline:
ci_build
.
pipeline
)
create
(
:milestone
,
project:
project
)
...
...
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