Commit Graph

70 Commits

Author SHA1 Message Date
gfyoung 50abbd3e53 Enable frozen string in app/models/*.rb
Partially addresses #47424.
2018-07-26 16:55:41 -07:00
Jasper Maes 71e0d33e74 Rails5 ActionController::ParameterMissing: param is missing or the value is empty: application_setting 2018-06-13 18:00:15 +02:00
Dmitriy Zaporozhets b6c6adfa51
Update invalid test application_settings_controller_spec.rb
There are 2 problems with this spec:

1. It checks for default visiblity level however there is not code in
controller to handle such default. Same check can be performed on model
directly.
2. It passes empty application_setting hash while controller requires
application_setting not to be empty by using `require` with `permit`

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-04-14 00:04:55 +03:00
Stan Hu 48f0eff37a Remove N+1 queries in /admin/projects page 2018-03-19 08:32:57 -07:00
Zeger-Jan van de Weg 94a3dbca33
Gitaly Server info for admin panel
Implements the client side for gitlab-org/gitaly#819. Which is a server
info command. This checks the server version and git binairy version on
the server.

A small UI was added for administrators, so they can check the status of
the Gitaly server. This is done for each storage the monolith knows.

Because of this commit, gitlab-org/gitlab-ce!15580 is now closed. That
MR removed the Git version too, but didn't replace it with anything.
2018-01-31 08:54:45 +01:00
Mark Fletcher 6dcba97c83 Permits 'password_authentication_enabled_for_git' parameter for ApplicationSettingsController 2018-01-19 12:04:45 +00:00
Alexis Reigel 337ced28bc reference triggers.values for permitted parameters 2018-01-17 09:55:00 +01:00
Alexis Reigel eb5e0e921c add missing permitted param 2018-01-17 09:55:00 +01:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Bob Van Landuyt f1ae1e39ce Move the circuitbreaker check out in a separate process
Moving the check out of the general requests, makes sure we don't have
any slowdown in the regular requests.

To keep the process performing this checks small, the check is still
performed inside a unicorn. But that is called from a process running
on the same server.

Because the checks are now done outside normal request, we can have a
simpler failure strategy:

The check is now performed in the background every
`circuitbreaker_check_interval`. Failures are logged in redis. The
failures are reset when the check succeeds. Per check we will try
`circuitbreaker_access_retries` times within
`circuitbreaker_storage_timeout` seconds.

When the number of failures exceeds
`circuitbreaker_failure_count_threshold`, we will block access to the
storage.

After `failure_reset_time` of no checks, we will clear the stored
failures. This could happen when the process that performs the checks
is not running.
2017-12-08 09:11:39 +01:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +02:00
Zeger-Jan van de Weg f879c58706
Fix namespace deletion tests 2017-10-05 15:01:26 +02:00
Tiago Botelho 0ffa4772c2 Changes the password change workflow for admins. 2017-08-31 12:25:24 +01:00
Tiago Botelho 21066e827a Pending delete projects no longer return 500 error in Admins projects view 2017-08-11 11:45:09 +01:00
Rémy Coutable c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Bob Van Landuyt 3598e60bf2 Add a Circuitbreaker for storage paths 2017-08-04 15:38:48 +02:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Oswaldo Ferreira e561b142fa Backport gitlab-ee!2456 2017-07-27 12:09:46 -04:00
Tiago Botelho 22d53f0607 Fixes 500 error caused by pending delete projects in admin dashboard 2017-07-25 17:59:47 +01:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Nick Thomas 5c602e306c Limit non-administrators to adding 100 members at a time to groups and projects 2017-06-06 16:04:26 +01:00
Nick Thomas f09b7f5607 Support hard deletion in Admin::UsersController#destroy 2017-06-05 17:48:57 +01:00
Gabriel Mazetto 44129aceaf Codestyle 2017-05-13 02:18:57 +01:00
Gabriel Mazetto 2e97db051c Make the new repository_update_events configurable in System Hooks UI 2017-05-12 23:26:48 +01:00
James Lopez 6ecf16b8f7 refactor code based on feedback 2017-05-05 18:01:33 +02:00
James Lopez cf002738e7 refactor a few things based on feedback 2017-05-04 18:11:28 +02:00
Dmitriy Zaporozhets bae1644015
Refactor Admin::GroupsController#members_update method and add some specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-04-20 19:25:02 +03:00
Sean McGivern 0483019e98 Port 'Add more usage data to EE ping' to CE
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/735
2017-04-14 15:20:55 +02:00
Toon Claes 5058fc67ac Remove redundant code to convert restricted_levels to integers
The ApplicationSetting#restricted_visibility_levels= now takes care of
converting string formatted levels to integers.
2017-03-23 15:25:42 +01:00
Toon Claes 7bfa523485 Resolve future conflicts with CE -> EE merge
EE already includes specs for the ApplicationSettingsController, so
ensure future changes will be easier to merge to EE.
2017-03-23 11:13:11 +01:00
Toon Claes 4e1cebabc7 Undo explicit conversion to Integer
With the changes in Gitlab::VisibilityLevel it is no longer needed to
explicit conversion to Integer in the controller itself.
2017-03-20 22:57:45 +01:00
Markus Koller 789db2cc19 Make sure scopes are loaded in admin OAuth application form 2017-03-07 14:54:36 +01:00
Lin Jen-Shin 60288d6c62 Use expect { }.to change { }
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8664#note_23427575
2017-02-15 20:21:51 +08:00
Lin Jen-Shin 3856a3daa1 Add some tests for admin/project runners page 2017-02-15 19:16:12 +08:00
Robert Speicher 4642ca6686 Use `empty_project` where possible in controller specs 2017-01-25 17:14:38 -05:00
Z.J. van de Weg df99883d44 Add tests for admin service templates 2017-01-06 13:21:49 +01:00
Oren Kanner 8dd9a8b6e0 Allow admins to stop impersonating users without e-mail addresses
Resolves #24576

Modify the guard clause of the `ApplicationController#require_email`
before action to skip requests where an admin is impersonating the
current user.
2016-11-17 23:28:39 -05:00
Steve Halasz 36ec5eaf85 Only show one error message for an invalid email
If notification_email is blank, it's set from email. If an admin
attempted to create a user with an invalid email, an error would be
displayed for both fields. Only validate the notification_email if it's
different from email.
2016-10-27 15:46:28 -04:00
Stan Hu e665444724 Fix incorrect "stopped impersonation" log message
Closes #21015
2016-08-23 01:09:16 -07:00
Robert Speicher 7fef2f7b75 Merge branch 'akismet-submittable' into 'master'
Submit to Akismet Part 1 (Issues)

Related to #5932 #5573 gitlab-com/infrastructure#14

See merge request !5538
2016-08-15 22:59:47 +00:00
Patricio Cano 5994c11910 Further refactor and syntax fixes. 2016-08-15 17:20:57 -05:00
Kamil Trzcinski e8aab1cd15 This fixes a long running tests due to changed Sidekiq state 2016-08-15 23:26:40 +02:00
Patricio Cano 43e756d4ea Refactored AkismetHelper into AkismetService and cleaned up `Spammable`
- Refactored SpamCheckService into SpamService
2016-08-15 13:18:15 -05:00
Patricio Cano 96399a81cb Allow `Issue` to be submitted as spam
- Added controller actions as reusable concerns
- Added controller tests
2016-08-15 13:18:15 -05:00
Stan Hu cb8a425ba4 Fix bug where destroying a namespace would not always destroy projects
There is a race condition in DestroyGroupService now that projects are deleted asynchronously:

1. User attempts to delete group
2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project
3. DestroyGroupService destroys the Group, leaving all its projects without a namespace
4. Projects::DestroyService runs later but the can?(current_user,
   :remove_project) is `false` because the user no longer has permission to
   destroy projects with no namespace.
5. This leaves the project in pending_delete state with no namespace/group.

Projects without a namespace or group also adds another problem: it's not possible to destroy the container
registry tags, since container_registry_path_with_namespace is the wrong value.

The fix is to destroy the group asynchronously and to run execute directly on Projects::DestroyService.

Closes #17893
2016-08-11 15:36:35 -07:00
tiagonbotelho 519275c110 fixes part1 of files to start using active tense 2016-08-09 15:06:23 +01:00
Alfredo Sumaran 338072cc4b Layout for Users Groups and Projects on admin area 2016-07-07 13:25:58 -05:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00