Commit Graph

88 Commits

Author SHA1 Message Date
Imre Farkas 9bc5ed14fe Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-09 15:38:58 +00:00
Gosia Ksionek 64858317ad Add part of needed code
Add columns to store project creation settings

Add project creation level column in groups
 and default project creation column in application settings

Remove obsolete line from schema

Update migration with project_creation_level column existence check

Rename migrations to avoid conflicts

Update migration methods

Update migration method
2019-04-05 18:49:46 +00:00
Andreas Brandl 46b1b9c1d6 Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request !26823
2019-04-05 13:02:56 +00:00
Imre Farkas d9d7237d2e Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-05 11:45:47 +00:00
Alejandro Rodríguez 585fcfb9e7 Fix undefined variable error on json project views
This mistake seems to have always been there, but it only resulted in
errors on the `/explore*.json` since they were the one that _actually_
relied on the local variables.
2019-03-18 21:27:28 -03:00
Alexandru Croitor 77985826d9 Show header and footer system messages in email
* Add email_header_and_footer_enabled flag to appearances table
* Set email_header_and_footer_enabled default value to false
* Add checkbox to appearance to toggle show header and footer in emails
* Add email_header_and_footer_enabled to allowed params in controller
* Add header and footer messages to the html and text email layouts
* Remove the color styling for emails header and footer
* Add empty_mailer layout for emails without layout,
to have the header and footer applied
2019-02-27 22:07:50 +02:00
Stan Hu ebb284c0dc Remove N+1 query for tags in /admin/runners page
As discussed in https://github.com/mbleigh/acts-as-taggable-on/issues/91,
we can avoid N+1 queries if we use `tags` instead of `tag_list`.

Seen while reviewing
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19740.
2019-02-26 12:44:28 -08:00
Douwe Maan e5c7027faf Merge branch 'sh-fix-users-controller-ruby-2.6-compat' into 'master'
Make Admin::UsersController work with Ruby 2.6

See merge request gitlab-org/gitlab-ce!25316
2019-02-25 11:20:41 +00:00
Douwe Maan 28e1739a3f Port EE System Header And Footer feature to CE
remove EE specific code
remove EE licence checks
move migration from EE to CE folder structure
move specs from EE to CE folder structure
remove EE specific flag specs
2019-02-21 17:55:51 +02:00
Stan Hu e87c255d9e Make Admin::UsersController work with Ruby 2.6
Ruby 2.6 introduced `Enumerable#filter`, which takes no arguments.
Attempting to call `filter` on an `ActiveRecord::Relation` with a scope
will fail with a `wrong number of arguments (given 1, expected 0)`
message because the `Enumerable#filter` implementation overrides the
delegated `ActiveRecord::Relation#filter` method.

To make Admin::UsersController compatible with Ruby 2.6, rename
`User.filter` to `User.filter_items`.
2019-02-19 15:36:05 -08:00
Robert Speicher 12c70e636c
Admin section finds users case-insensitively
Previously, if you entered a username in the URL manually to view a
specific user, the lookup was done case-sensitively, despite usernames
being case-insensitive, often resulting in a 404. We now use the same
`find_routable!` logic as the non-admin Users controller.
2019-02-12 14:28:06 -08:00
Stan Hu 4ac4ba2654 Fix requests profiler in admin page not rendering HTML properly
By default in Rails 5, content passed to `render` will be
escaped. This doesn't work for the HTML profile output, which
should be considered safe HTML already.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56152
2019-01-09 23:09:43 -08:00
blackst0ne b44a2c801a Update specs to rails5 format
Updates specs to use new rails5 format.

The old format:
`get :show, { some: params }, { some: headers }`

The new format:
`get :show, params: { some: params }, headers: { some: headers }`
2018-12-19 10:04:31 +11:00
Imre Farkas bd3a484032
Add config to disable impersonation
Adds gitlab.impersonation_enabled config option defaulting to true to
keep the current default behaviour.

Only the act of impersonation is modified, impersonation token
management is not affected.
2018-11-29 09:37:16 +01:00
Zeger-Jan van de Weg 30b4ce940d
Remove Git circuit breaker
Was introduced in the time that GitLab still used NFS, which is not
required anymore in most cases. By removing this, the API it calls will
return empty responses. This interface has to be removed in the next
major release, expected to be 12.0.
2018-10-10 09:08:18 +02:00
Gabriel Mazetto 7b8b2563c4 Prepare admin/projects/show view to allow EE specific feature
In EE it will render a Geo Status widget when Geo is enabled and it is
in a secondary node.

Also added minimal specs to that action.
2018-10-05 18:11:16 -03:00
Tomasz Maczukin 42af229510
Simplify runner registration token resetting
This icommit adds several changes related to the same topic
- resetting a Runner registration token:

1. On Project settings page it adds a button for resetting the
   registration token and it removes the Runner token field
   that was confusing all GitLab users.

2. On Group settings page it adds the same button for resetting
   the registration token.

3. On Admin Runners settings page it moves the button to the same
   place as in Project and Group settings and it changes slightly
   the page layout to make it more similar to Group and Project
   setting pages.

4. It refactorizes a little the partial that prints runner
   registration description. Thanks to this Project, Group
   and Admin settings of the Runner are re-using the same
   code to generate the button.

5. Updates the translations of changed text.
2018-10-04 08:37:01 +02:00
Rubén Dávila 007b81b8e2 Add receive_max_input_size setting to Application settings
If user has configure the setting then it will be passed to gitlab-shell
and gitlab-workhorse
2018-09-07 12:27:35 -05:00
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