summaryrefslogtreecommitdiff
path: root/app/models/ci/runner.rb
Commit message (Collapse)AuthorAgeFilesLines
* Optimise build queue serviceoptimise-build-queue-serviceKamil Trzciński2019-08-221-8/+20
| | | | | | | | This makes BuildQueueService to force refresh runners that are considered to have recent queue. Such runners are the ones that connected within online interval + time to expire runner cache.
* Use persistent Redis cluster for Workhorse pub/sub notificationssh-use-shared-state-cluster-pubsubStan Hu2019-07-221-1/+1
| | | | | | | | | Previously, in Omnibus, Workhorse expected to listen via the Redis shared state cluster for the `workhorse:notifications` publish/subscribe channel, but the Rails code was using the Sidekiq queue cluster for this. To fix this inconsistency, we make the Rails code use the persistent cluster, since we don't want Workhorse to be looking at anything Sidekiq-related.
* Inherit from ApplicationRecord instead of ActiveRecord::BaseNick Thomas2019-03-281-1/+1
|
* Make runners token encryption to be optionalKamil Trzciński2019-03-181-1/+1
|
* Use encrypted runner tokensKamil Trzciński2019-03-061-1/+1
| | | | | | This makes code to support encrypted runner tokens. This code also finished previously started encryption process.
* Remove N+1 query for tags in /admin/runners pageStan Hu2019-02-261-0/+1
| | | | | | | | 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.
* Take contacted_at value from the DB when it is about to be displayed in the ↵Alexander Kutelev2019-01-041-0/+4
| | | | Web interface with sorting enabled.
* Rename GroupHierarchy into ObjectHierarchyJarka Košanová2018-12-191-1/+1
| | | | | | - we now use the hierarchy class also for epics - also rename supports_nested_groups? into supports_nested_objects? - move it to a concern
* Remove rails4 specific codeJasper Maes2018-12-161-2/+1
|
* Add custom validation message for chronic duration attributeGrzegorz Bizon2018-12-051-1/+2
|
* Migrate runners token first before fully switchingGrzegorz Bizon2018-12-031-1/+1
|
* Encrypt runners communication token in the databaseGrzegorz Bizon2018-11-201-5/+4
|
* Merge branch 'feature/runner-type-filter-for-admin-view' into 'master'Kamil Trzciński2018-09-261-13/+14
|\ | | | | | | | | Feature: Runner type filter for admin view See merge request gitlab-org/gitlab-ce!19649
| * add type param to runners apiAlexis Reigel2018-09-151-13/+14
| |
* | Added FromUnion to easily select from a UNIONYorick Peterse2018-09-171-4/+13
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the module `FromUnion`, which provides the class method `from_union`. This simplifies the process of selecting data from the result of a UNION, and reduces the likelihood of making mistakes. As a result, instead of this: union = Gitlab::SQL::Union.new([foo, bar]) Foo.from("(#{union.to_sql}) #{Foo.table_name}") We can now write this instead: Foo.from_union([foo, bar]) This commit also includes some changes to make this new setup work properly. For example, a bug in Rails 4 (https://github.com/rails/rails/issues/24193) would break the use of `from("sub-query-here").includes(:relation)` in certain cases. There was also a CI query which appeared to repeat a lot of conditions from an outer query on an inner query, which isn't necessary. Finally, we include a RuboCop cop to ensure developers use this new module, instead of using Gitlab::SQL::Union directly. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
* Cleaned up CI runner administration codeYorick Peterse2018-09-141-0/+11
| | | | | | | | | | | | 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.
* add a comment to the usage of a anti-pattern queryAlexis Reigel2018-09-131-0/+6
|
* dry up available scopes to constantsAlexis Reigel2018-08-201-1/+3
|
* add offline scope to Ci::RunnerAlexis Reigel2018-08-201-0/+1
|
* Enable frozen string for app/models/**/*.rbrepo-forks/gitlab-ce-frozen-string-enable-app-models-moregfyoung2018-08-031-0/+2
| | | | Partially addresses #47424.
* Make deprecated scopes of Runner explicitKamil Trzciński2018-07-041-2/+2
|
* Remove the use of `is_shared` of `Ci::Runner`remove-is-shared-from-ci-runnersKamil Trzciński2018-06-261-22/+12
|
* Do not validate cached dataoptimise-runner-update-cached-infoKamil Trzciński2018-06-051-4/+2
|
* Run `Ci::Runner#assign_to` in transactionKamil Trzciński2018-05-311-2/+9
|
* Add `Ci::Runner` inverse_of'sKamil Trzciński2018-05-311-2/+2
|
* Fix static analysisKamil Trzciński2018-05-311-2/+2
|
* Improve `Ci::Runner#assign_to` to return a flag whether it succeeded or notKamil Trzciński2018-05-311-3/+2
|
* Make Ci::Runner#assign_to keep returning RunnerProjectDylan Griffith2018-05-311-1/+2
|
* Refactor validations and make runner factory by default to be instance-wide ↵Kamil Trzciński2018-05-311-10/+25
| | | | runner
* Improve runner_type validations for Ci::RunnerDylan Griffith2018-05-311-6/+16
|
* Merge branch '46082-runner-contacted_at-is-not-always-a-time-type' into 'master'Kamil Trzciński2018-05-211-1/+1
|\ | | | | | | | | | | | | Resolve "Runner#contacted_at is not always a Time type" Closes #46082 See merge request gitlab-org/gitlab-ce!18810
| * Dynamically cast value from cacheMatija Čupić2018-05-151-2/+1
| |
| * Merge branch 'master' into 46082-runner-contacted_at-is-not-always-a-time-typeMatija Čupić2018-05-091-0/+1
| |\
| * | Move Runner#contacted_at to RedisCacheable#cached_attr_time_readerMatija Čupić2018-05-081-1/+2
| | |
* | | Allow group runners to be viewed/edited in APIDylan Griffith2018-05-161-1/+1
| | |
* | | Ensure Ci::Runner#assign_to errors for group runnerscorrect-runner-type-when-assigning-shared-to-projectDylan Griffith2018-05-101-0/+2
| | |
* | | Ensure runner_type is updated correctly when assigning shared runner to projectDylan Griffith2018-05-101-1/+5
| |/ |/|
* | Add validation Ci::Runner runner_type must be presentDylan Griffith2018-05-091-0/+1
|/
* Dont remove duplicates in Runner.owned_or_shared since its not necessaryDylan Griffith2018-05-031-1/+4
|
* Remove Runner#belonging_to_any_project since this is no longer neededDylan Griffith2018-05-031-2/+0
|
* Rename RunnerGroup -> RunnerNamespaceDylan Griffith2018-05-021-3/+3
|
* Rename Runner#invalidate_build_cache -> Runner#pick_buildDylan Griffith2018-05-021-1/+1
|
* Start persisting runner_type when creating runnersDylan Griffith2018-04-301-0/+6
|
* Rename Runner#group? -> #assigned_to_group? and Runner#project? -> ↵Dylan Griffith2018-04-301-3/+3
| | | | #assigned_to_project?
* Revert fair scheduling for all buildsDylan Griffith2018-04-301-18/+0
| | | | Per discussion in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9646#note_65730532 this logic is being optimized elsewhere and it will simplify things if we make less changes to this code right now.
* Rename `runner.belonging_to_group(project.id) -> ↵Dylan Griffith2018-04-271-2/+2
| | | | runner.belonging_to_parent_group_of_project(project.id)`
* extract method to adhere to "tell, don't ask"Alexis Reigel2018-04-231-0/+6
|
* use more efficient AR length check methodsAlexis Reigel2018-04-231-2/+2
|
* restrict projects ci controller to project runnersAlexis Reigel2018-04-231-1/+6
|
* simplify runner selectionAlexis Reigel2018-04-231-0/+18
| | | | | | don't differentiate between the different runner types, instead we rely on the Runner model to provide the available projects. scheduling is now applied to all runners equally.