Commit Graph

659 Commits

Author SHA1 Message Date
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
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
Valery Sizov 2daa8d387b Remove background job throttling feature
We remove this feature as it never worked properly
2018-09-24 18:41:14 +03:00
Stan Hu 711e9f0796 Merge branch 'frozen-string-app-controller' into 'master'
Enable frozen string in app/controllers/**/*.rb

See merge request gitlab-org/gitlab-ce!21736
2018-09-20 22:53:27 +00:00
Dmitriy Zaporozhets 00057a75f4 Merge branch '44998-split-admin-settings-into-multiple-sub-pages' into 'master'
Resolve "Split admin settings into multiple sub pages"

Closes #44998

See merge request gitlab-org/gitlab-ce!21467
2018-09-20 13:24:20 +00:00
Martin Wortschack df9cb93091 Add empty controller actions and utilize referer_path helper 2018-09-19 12:57:14 +02:00
gfyoung 73322a0e55 Enable frozen string in app/controllers/**/*.rb
Enables frozen string for the following:

* app/controllers/*.rb
* app/controllers/admin/**/*.rb
* app/controllers/boards/**/*.rb
* app/controllers/ci/**/*.rb
* app/controllers/concerns/**/*.rb

Partially addresses #47424.
2018-09-18 21:22:45 -07:00
Martin Wortschack a7071deddc Parse request.referer properly 2018-09-18 10:47:05 +02:00
Yorick Peterse f0e7b5e7a3
Cleaned up CI runner administration code
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19625 some
changes were introduced that do not meet our abstraction reuse rules.
This commit cleans up some of these changes so the requirements are met.

Most notably, sorting of the runners in Admin::RunnersFinder has been
delegated to Ci::Runner.order_by, similar to how we order data in
models that include the Sortable module. If we need more sort orders in
the future we can include Sortable and have Ci::Runner.order_by call
`super` to delegate to Sortable.order_by.
2018-09-14 15:05:46 +02:00
Martin Wortschack 378242d760 Adds empty methods for 'geo' and 'templates' 2018-09-14 14:37:05 +02:00
Grzegorz Bizon 55c23a0935 Merge branch 'feature/runner-state-filter-for-admin-view' into 'master'
Feature: State filter for admin runners view

See merge request gitlab-org/gitlab-ce!19625
2018-09-14 09:03:44 +00:00
Alexis Reigel 03890558b4
rename variable from *_cnt to *_count 2018-09-12 17:31:25 +02:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Martin Wortschack a2f7936c74 merge master and resolve conflicts 2018-09-11 08:43:10 +02:00
Martin Wortschack bfd2181310 use referer for redirect instead of hidden field param from partials 2018-09-10 19:45:33 +02:00
Jan Provaznik a415a904b8 Ask user explicitly about usage stats agreement 2018-09-07 14:32:28 +00:00
Felipe Artur 9710cda30e Move project services log to a separate file 2018-09-06 14:48:31 -03:00
Martin Wortschack 276e78e058 handle redirect properly 2018-09-06 15:44:15 +02:00
Martin Wortschack be41338b66 redirect to the relevant sub page after updating application settings 2018-09-05 11:22:18 +02:00
Alexis Reigel 34bdb74740
add sort dropdown to admin runners page 2018-08-29 15:02:54 +02:00
Alexis Reigel 0a0350be00
extract filter/sort/paging logic to finder class 2018-08-20 17:15:11 +02:00
Alexis Reigel 16d12491c5
add status filter to admin runners page 2018-08-20 17:15:11 +02:00
Rémy Coutable f20a40f4a1 Merge branch 'frozen-string-enable-app-models' into 'master'
Enable frozen string in app/models/*.rb

See merge request gitlab-org/gitlab-ce!20851
2018-08-02 09:11:52 +00:00
Luke Bennett 1b27c45753 Merge branch 'master' into '41416-making-instance-wide-data-tools-more-accessible'
# Conflicts:
#   app/models/application_setting.rb
#   lib/api/settings.rb
2018-07-31 16:29:13 +00:00
Stan Hu 00709a13a4 Fix /admin/jobs failing to load due to statement timeout
The `ORDER BY created_at DESC` clause causes a sequential scan because
there is no index on the `created_at` column. We can sort by `id`
or by `updated_at` to make things fast.

Closes #49767
2018-07-30 10:03:05 -07:00
Luke Bennett 602a1c34e3 Create instance_statistics namespace and move convdev index and cohorts to it 2018-07-27 15:54:26 +02:00
Sean McGivern ed81ee9ba2 Revert "Merge branch '41416-making-instance-wide-data-tools-more-accessible' into 'master'"
This reverts merge request !20679
2018-07-27 13:12:35 +00:00
gfyoung 50abbd3e53 Enable frozen string in app/models/*.rb
Partially addresses #47424.
2018-07-26 16:55:41 -07:00
Luke Bennett f8f2d0f9e1 Create instance_statistics namespace and move convdev index and cohorts to it 2018-07-26 19:00:09 +02:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Yorick Peterse f30089075f
Fixed pagination of web hook logs
For reasons unknown, the logs of a web hook were paginated in memory.
This would result in the "Edit" page of a web hook timing out once it
has more than a few thousand log entries.

This commit makes the following changes:

1. We use LIMIT/OFFSET to paginate the data, instead of doing this in
   memory.

2. We limit the logs to the last two days, just like the documentation
   says (instead of retrieving everything).

3. We change the indexes on "web_hook_logs" so the query to get the data
   can perform a backwards index scan, without the need for a Filter.

These changes combined ensure that Projects::HooksController#edit no
longer times out.
2018-07-03 14:24:17 +02:00
Rémy Coutable 955f0ea57f Merge branch 'patch-28' into 'master'
Update wrong initial setting transfer in application_settings_controller.rb

See merge request gitlab-org/gitlab-ce!20059
2018-06-26 10:39:32 +00:00
Andrei Vukolov 6d2b934d44 Fix initial settings loading at the first run of GitLab installed from source 2018-06-25 17:44:03 +00:00
Lin Jen-Shin b23428d664 Bring changes from EE 2018-06-25 21:11:00 +08:00
Andrei Vukolov 1d116f3ecd Update wrong initial setting transfer in application_settings_controller.rb 2018-06-21 10:08:59 +00:00
Jasper Maes e3046dcabe Rails5 fix Admin::HooksController 2018-06-20 08:30:24 +02:00
Alexis Reigel ce6172e863
allow uploading favicon in appearance settings 2018-06-05 16:20:18 +02:00
Kamil Trzciński c6e95b0440 Improve `Ci::Runner#assign_to` to return a flag whether it succeeded or not 2018-05-31 10:56:41 +02:00
Stan Hu b6125f7045 Fix fast admin counters not working when PostgreSQL has secondaries
This commit does a number of things:

1. Reduces the number of queries needed by perform a single query to get all
the tuples for the relevant rows.

2. Uses a transaction to query the tuple counts to ensure that the data
is retrieved from the primary.

Closes #46742
2018-05-25 22:58:43 -07:00
Rémy Coutable a46929ea2f
Use ApplicationSetting.current_without_cache instead of ApplicationSetting.current where applicable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-05-23 16:14:43 +02:00
Stan Hu e38938b332 Fix Error 500 viewing admin page due to statement timeouts
Uses PostgreSQL tuple estimates to provide a much faster yet approximate
count. See https://wiki.postgresql.org/wiki/Slow_Counting for more details.
We only use this fast method if the table has been analyzed or vacuumed
within the last hour.

Closes #46255
2018-05-16 08:27:48 -07:00
Dmitriy Zaporozhets 6106cad955
Don't reset application settings oauth providers by mistake
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-04-13 18:54:08 +03:00
Dmitriy Zaporozhets bcf7a7e76c
Don't reset application settings import sources
If form does not have import sources checkboxes we should not reset
import sources to empty. This fixes issue when import sources got reset
after user modifies unrelated settings section like GitLab pages

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-04-13 14:52:54 +03:00
blackst0ne ac1b5def53 [Rails5] Fix admin/application_settings_controller
The `RAILS5=1 rspec spec/controllers/admin/application_settings_controller_spec.rb`
command throws the error:

Failures:

  1) Admin::ApplicationSettingsController PUT #update falls back to defaults when settings are omitted
      Failure/Error: import_sources = params[:application_setting][:import_sources]

      NoMethodError:
        undefined method `[]' for nil:NilClass
      # ./app/controllers/admin/application_settings_controller.rb:62:in `application_setting_params'

This commit fixes it.
2018-04-11 12:33:11 +11:00
blackst0ne 3d3b46f344 [Rails5] Rename `sort` methods to `sort_by_attribute` 2018-04-04 09:19:47 +00:00
André Luís f8049f4e26 Backport changes in EE MR 4972: System Header and Footer 2018-04-02 14:27:12 +00:00
Toon Claes 9ab43aa762 Add read-only banner to all pages
When the database is in a read-only state, display a banner on each
page informing the user they cannot write to that GitLab instance.

Closes gitlab-org/gitlab-ce#43937.
2018-03-22 20:34:45 +01:00
julien MILLAU 30ef73afac Remove impersonate token from flash scope 2018-03-02 10:10:39 +00:00
Rémy Coutable 1c88d92b3f Improve Member services
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-27 16:02:22 +01:00
Clement Ho 95994503c9 Replace $.ajax in admin broadcast messages with axios 2018-02-05 14:59:48 +00:00