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
143d072c
Commit
143d072c
authored
Jan 31, 2022
by
Markus Koller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_220040_13' into 'master'
Fix Rails/SaveBang offenses See merge request gitlab-org/gitlab!75975
parents
b5b5aefa
d06cdd6b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
21 deletions
+14
-21
.rubocop_todo/rails/save_bang.yml
.rubocop_todo/rails/save_bang.yml
+0
-7
spec/lib/gitlab/auth_spec.rb
spec/lib/gitlab/auth_spec.rb
+8
-8
spec/lib/gitlab/authorized_keys_spec.rb
spec/lib/gitlab/authorized_keys_spec.rb
+1
-1
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
+2
-2
spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
..._importers/self_monitoring/project/create_service_spec.rb
+3
-3
No files found.
.rubocop_todo/rails/save_bang.yml
View file @
143d072c
...
...
@@ -8,10 +8,3 @@ Rails/SaveBang:
-
spec/lib/gitlab/auth/ldap/user_spec.rb
-
spec/lib/gitlab/auth/o_auth/user_spec.rb
-
spec/lib/gitlab/auth/saml/user_spec.rb
-
spec/lib/gitlab/auth_spec.rb
-
spec/lib/gitlab/authorized_keys_spec.rb
-
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
-
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
-
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/auth_spec.rb
View file @
143d072c
...
...
@@ -165,27 +165,27 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
end
it
'recognises user token'
do
build
.
update
(
user:
create
(
:user
))
build
.
update
!
(
user:
create
(
:user
))
expect
(
subject
).
to
have_attributes
(
actor:
build
.
user
,
project:
build
.
project
,
type: :build
,
authentication_abilities:
described_class
.
build_authentication_abilities
)
end
it
'recognises project level bot access token'
do
build
.
update
(
user:
create
(
:user
,
:project_bot
))
build
.
update
!
(
user:
create
(
:user
,
:project_bot
))
project
.
add_maintainer
(
build
.
user
)
expect
(
subject
).
to
have_attributes
(
actor:
build
.
user
,
project:
build
.
project
,
type: :build
,
authentication_abilities:
described_class
.
build_authentication_abilities
)
end
it
'recognises group level bot access token'
do
build
.
update
(
user:
create
(
:user
,
:project_bot
))
build
.
update
!
(
user:
create
(
:user
,
:project_bot
))
group
.
add_maintainer
(
build
.
user
)
expect
(
subject
).
to
have_attributes
(
actor:
build
.
user
,
project:
build
.
project
,
type: :build
,
authentication_abilities:
described_class
.
build_authentication_abilities
)
end
it
'fails with blocked user token'
do
build
.
update
(
user:
create
(
:user
,
:blocked
))
build
.
update
!
(
user:
create
(
:user
,
:blocked
))
expect
(
subject
).
to
have_attributes
(
auth_failure
)
end
...
...
@@ -213,7 +213,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
it
'recognizes other ci services'
do
project
.
create_drone_ci_integration
(
active:
true
)
project
.
drone_ci_integration
.
update
(
token:
'token'
)
project
.
drone_ci_integration
.
update
!
(
token:
'token'
,
drone_url:
generate
(
:url
)
)
expect
(
gl_auth
.
find_for_git_client
(
'drone-ci-token'
,
'token'
,
project:
project
,
ip:
'ip'
)).
to
have_attributes
(
actor:
nil
,
project:
project
,
type: :ci
,
authentication_abilities:
described_class
.
build_authentication_abilities
)
end
...
...
@@ -326,7 +326,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
context
'orphaned token'
do
before
do
user
.
destroy
user
.
destroy
!
end
it_behaves_like
'an oauth failure'
...
...
@@ -903,7 +903,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
it
'resets failed_attempts when true and password is correct'
do
user
.
failed_attempts
=
2
user
.
save
user
.
save
!
expect
do
gl_auth
.
find_with_user_password
(
username
,
password
,
increment_failed_attempts:
true
)
...
...
@@ -932,7 +932,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
it
'does not reset failed_attempts when true and password is correct'
do
user
.
failed_attempts
=
2
user
.
save
user
.
save
!
expect
do
gl_auth
.
find_with_user_password
(
username
,
password
,
increment_failed_attempts:
true
)
...
...
spec/lib/gitlab/authorized_keys_spec.rb
View file @
143d072c
...
...
@@ -38,7 +38,7 @@ RSpec.describe Gitlab::AuthorizedKeys do
end
describe
'#create'
do
subject
{
authorized_keys
.
create
}
subject
{
authorized_keys
.
create
}
# rubocop:disable Rails/SaveBang
context
'authorized_keys file exists'
do
before
do
...
...
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
View file @
143d072c
...
...
@@ -22,8 +22,8 @@ RSpec.describe Gitlab::BitbucketServerImport::Importer do
data:
{
project_key:
project_key
,
repo_slug:
repo_slug
},
credentials:
{
base_uri:
import_url
,
user:
bitbucket_user
,
password:
password
}
)
data
.
save
project
.
save
data
.
save
!
project
.
save
!
end
describe
'#import_repository'
do
...
...
spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
View file @
143d072c
...
...
@@ -60,7 +60,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
before
do
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
application_setting
.
update
(
allow_local_requests_from_web_hooks_and_services:
true
)
application_setting
.
update
!
(
allow_local_requests_from_web_hooks_and_services:
true
)
end
shared_examples
'has prometheus integration'
do
|
server_address
|
...
...
@@ -181,7 +181,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
let
(
:existing_project
)
{
create
(
:project
,
namespace:
existing_group
)
}
before
do
application_setting
.
update
(
instance_administrators_group_id:
existing_group
.
id
,
application_setting
.
update
!
(
instance_administrators_group_id:
existing_group
.
id
,
self_monitoring_project_id:
existing_project
.
id
)
end
...
...
@@ -195,7 +195,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
context
'when local requests from hooks and integrations are not allowed'
do
before
do
application_setting
.
update
(
allow_local_requests_from_web_hooks_and_services:
false
)
application_setting
.
update
!
(
allow_local_requests_from_web_hooks_and_services:
false
)
end
it_behaves_like
'has prometheus integration'
,
'http://localhost:9090'
...
...
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