summaryrefslogtreecommitdiff
path: root/app/models/concerns
Commit message (Collapse)AuthorAgeFilesLines
* Add Job specific variablesMatija Čupić2019-07-291-0/+14
| | | | | Adds Job specific variables to facilitate specifying variables when running manual jobs.
* Merge branch 'remove-nested-groups-checks' into 'master'Lin Jen-Shin2019-07-261-11/+0
|\ | | | | | | | | | | | | Remove code related to object hierarchy and MySQL Closes #65056 and #65055 See merge request gitlab-org/gitlab-ce!31095
| * Remove code related to object hierarchy in MySQLremove-nested-groups-checksHeinrich Lee Yu2019-07-251-11/+0
| | | | | | | | | | These are not required because MySQL is not supported anymore
* | Prefer `flat_map` over `map` + `flatten`Peter Leitzen2019-07-261-1/+1
|/ | | | | Convert several occurrences of `map` + `flatten` to `flat_map` where applicable.
* Make RelativePositioning reusablemake-relative-positioning-module-reusableAdam Hegyi2019-07-241-16/+36
| | | | | | | | RelativePositioning module was heavily dependent on the Issue model. This changes makes it easier to reuse the functionality provided by RelativePositioning in other models. Needed by: https://gitlab.com/gitlab-org/gitlab-ee/issues/12196
* Remove dead MySQL codeNick Thomas2019-07-232-41/+6
| | | | None of this code can be reached any more, so it can all be removed
* Merge branch ↵Douwe Maan2019-07-221-1/+2
|\ | | | | | | | | | | | | '64697-markdown-issues-checkbox-inside-blockquote-status-won-t-be-saved' into 'master' Markdown issues: Checkbox inside blockquote status won't be saved See merge request gitlab-org/gitlab-ce!30952
| * Properly identify task lists inside a blockquote64697-markdown-issues-checkbox-inside-blockquote-status-won-t-be-savedBrett Walker2019-07-191-1/+2
| | | | | | | | | | Updated the task list regex to understand blockquote characters that can come before the task item marker
* | Fix the project auto devops APINick Thomas2019-07-191-4/+2
|/ | | | | | | | | | | | | If `project_auto_devops.enabled` is nil for a project, when setting any auto devops values via the API, we try to create a new row in the DB, instead of re-using the existing one. This leads to the project_id being set to nil, and the database `NOT NULL` constraint leading to a 500 response. This commit resolves the issue by correctly detecting the presence of a ProjectAutoDevops row and re-using it. Persistence is also moved away from explicit `update!` calls and into relying on `autosave: true` on the model.
* CE port for milestones should not be set on epics issue promotionEugenia Grieff2019-07-181-0/+7
|
* Removes clusters_cte feature flagremove_clusters_cte_feature_flagThong Kuah2019-07-171-22/+1
| | | | | | This has been enabled on production without issue https://gitlab.com/gitlab-org/gitlab-ce/issues/64259
* Don't use transactions and exceptionsReuben Pereira2019-07-161-0/+35
| | | | Instead return error objects.
* Upgrade to Rails 5.2upgrade-rails-5-2-ceHeinrich Lee Yu2019-07-124-35/+37
| | | | Updates changed method names and fixes spec failures
* Merge branch '51575-remove-rails-4-specific-code-from-fromunion-from_union' ↵Robert Speicher2019-07-111-5/+1
|\ | | | | | | | | | | | | | | | | into 'master' Remove Rails 4-specific code from `FromUnion.from_union` Closes #51575 See merge request gitlab-org/gitlab-ce!30587
| * Pass string directly to #from51575-remove-rails-4-specific-code-from-fromunion-from_unionHeinrich Lee Yu2019-07-111-5/+1
| |
* | Merge branch '64161-gitlab-fqdn' into 'master'Grzegorz Bizon2019-07-111-0/+1
|\ \ | | | | | | | | | | | | | | | | | | Add CI variable to provide GitLab FQDN Closes #64161 See merge request gitlab-org/gitlab-ce!30417
| * | Add CI variable to provide GitLab FQDNBalasankar "Balu" C2019-07-101-0/+1
| | | | | | | | | | | | Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
* | | Merge branch 'banzai-avoid-redis-if-db-cache' into 'master'Douwe Maan2019-07-112-2/+16
|\ \ \ | |_|/ |/| | | | | | | | Banzai - avoid redis if attr is in DB cache See merge request gitlab-org/gitlab-ce!30334
| * | Banzai - avoid redis if attr is in DB cachebanzai-avoid-redis-if-db-cacheMario de la Ossa2019-07-102-2/+16
| | | | | | | | | | | | | | | | | | | | | When cache_collection_render runs we end up reading and writing things to redis even if we already have the rendered field cached in the DB. This commit avoids using redis at all whenever we have the field already rendered in the DB cache.
* | | Add a rubocop for Rails.loggerMayra Cabrera2019-07-102-2/+2
| |/ |/| | | | | | | | | Suggests to use a JSON structured log instead Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
* | Merge branch 'master' into sathieu/gitlab-ce-project_apiDouglas Barbosa Alexandre2019-07-093-6/+25
|\ \
| * | Allow ReactiveCaching to support nil valueFabio Pitino2019-07-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When :calculate_reactive_caching returns a nil value this caused ReactiveCaching to schedule a worker every time the code using :with_reactive_cache was called. This issue caused an increasing amount of Sidekiq jobs being created continuously. Implementing this fix behind feature flag :reactive_caching_check_key_exists
| * | Merge branch '40379-CJK-search-min-chars' into 'master'Andreas Brandl2019-07-081-2/+2
| |\ \ | | | | | | | | | | | | | | | | Remove minimum required characters for fuzzy search if no trigram is used See merge request gitlab-org/gitlab-ce!29810
| | * | Ignore min_chars_for_partial_matching unles trigrm40379-CJK-search-min-charsMario de la Ossa2019-07-041-2/+2
| | |/ | | | | | | | | | | | | If we're not using a trigram index, then ignore the min_chars_for_partial_matching setting
| * | Create CTE query for clusters hierarchyThong Kuah2019-07-081-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This enables us to use a scope to query all clusters in group hierarchy order in one query, and also enables us to union to instance clusters later. - Handle case where clusters not present at level. In which case the query should go ahead and return the next level's clusters. - Swap with new CTE query behind Feature flag. This FF is default disabled.
| * | Prevent amplification of ReactiveCachingWorker jobs upon failuressh-disable-reactive-caching-automatic-retriesStan Hu2019-07-061-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `ReactiveCachingWorker` hits an SSL or other exception that occurs quickly and reliably, automatically rescheduling a new worker could lead to excessive number of jobs being scheduled. This happens because not only does the failed job get rescheduled in a minute, but each Sidekiq retry will also add even more rescheduled jobs. In busy instances, this can become an issue because large numbers of `ReactiveCachingWorker` running can cause high rates of `ExclusiveLease` reads to occur and possibly saturate the Redis server with queries. We now disable this automatic retry and rely on Sidekiq to perform its 3 retries with a backoff period. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64176
* | Add auto_devops_* to project APIMathieu Parent2019-07-031-0/+10
| | | | | | | | | | The auto_devops object sometimes doesn't exists. We may need to create it.
* | Add build_git_strategy attribute to project APIMathieu Parent2019-07-031-0/+10
| | | | | | | | | | We map the boolean to the string 'fetch' or 'clone', to be more explicit.
* | Add *_access_level to project APIMathieu Parent2019-07-031-8/+46
|/ | | | | | | | | - issues_access_level - repository_access_level - merge_requests_access_level - builds_access_level - wiki_access_level - snippets_access_level
* Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ceMarin Jankovski2019-07-035-21/+29
|\
| * Includes logic to persist namespace statisticsMayra Cabrera2019-07-021-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add two new ActiveRecord models: - RootNamespaceStoragestatistics will persist root namespace statistics - NamespaceAggregationSchedule will save information when a new update to the namespace statistics needs to be scheduled - Inject into UpdateProjectStatistics concern a new callback that will call an async job to insert a new row onto NamespaceAggregationSchedule table - When a new row is inserted a new job is scheduled. This job will update call an specific service to update the statistics and after that it will delete thee aggregated scheduled row - The RefresherServices makes heavy use of arel to build composable queries to update Namespace::RootStorageStatistics attributes. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows
| * Add a memory cache local to the thread to reduce Redis loadStan Hu2019-07-011-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Loading `ApplicationSetting` from Redis was responsible for at least 50% of the CPU load of the Redis cluster on GitLab.com. Since these values generally don't change very much, we can load this from the database and cache it in memory, skipping Redis altogther. We use `ActiveSupport::Cache::MemoryStore` as a drop-in replacement for `RedisCacheStore` even though we probably don't need synchronized access within `Thread.current`. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63977
| * Merge branch 'add-clusters-to-deployment' into 'master'Lin Jen-Shin2019-07-011-0/+1
| |\ | | | | | | | | | | | | Add clusters association to deployment See merge request gitlab-org/gitlab-ce!29960
| | * Populate cluster_id when creating a deploymentThong Kuah2019-06-271-0/+1
| | |
| * | Do not change updated_at on an issue when reordering on an issue boardEugenia Grieff2019-06-281-2/+2
| | |
| * | Remove instance_clusters feature_flagremove_group_and_instance_clusters_feature_flagThong Kuah2019-06-281-7/+1
| | | | | | | | | | | | | | | | | | Now we have terminals for instance and group clusters we can remove the FF now. Deploying to instance clusters has been working without complaints too.
| * | Remove group_clusters feature flagThong Kuah2019-06-281-7/+1
| |/ | | | | | | | | | | Now we have terminals for instance and group clusters we can remove the FF now. Deploying to group clusters has been working without complaints too.
* | Merge branch 'security-59581-related-merge-requests-count' into 'master'Marin Jankovski2019-07-021-1/+5
|\ \ | |/ |/| | | | | Expose merge requests count based on user access See merge request gitlab/gitlabhq!3157
| * Expose merge requests count based on user accessAlexandru Croitor2019-06-181-1/+5
| | | | | | | | | | | | | | | | | | Count issues related merge requests based on user access level. And issue can have related MRs from projects where user does not have access so the number of related merge requests should be adjusted based on user's ability to access the related MRs. https://gitlab.com/gitlab-org/gitlab-ce/issues/59581
* | Extract common validations from ci servicesRaphael Tweitmann2019-06-211-0/+43
| | | | | | | | | | | | DroneCI and TeamCity shared the same validations methods on the data received. These validations were extracted into a concern
* | Remove Kubernetes service from deployment platformTiger2019-06-211-38/+1
|/ | | | | This will no longer be used for deployments, as all service templates have been migrated to clusters.
* Expose comments on Noteables in GraphQLBob Van Landuyt2019-06-141-8/+1
| | | | | | | | | This exposes `Note`s on Issues & MergeRequests using a `Types::Notes::NoteableType` in GraphQL. Exposing notes on a new type can be done by implementing the `NoteableType` interface on the type. The presented object should be a `Noteable`.
* Merge branch 'add-default-reactive-cache-key' into 'master'Nick Thomas2019-06-112-3/+2
|\ | | | | | | | | Add a default reactive cache key See merge request gitlab-org/gitlab-ce!29337
| * Add a default reactive cache keyadd-default-reactive-cache-keyTiger2019-06-072-3/+2
| | | | | | | | | | Aligns with the other reactive cache options by providing a default that can be overridden if necessary.
* | Merge branch ↵Stan Hu2019-06-071-2/+2
|\ \ | | | | | | | | | | | | | | | | | | 'thomas-nilsson-irfu/gitlab-ce-thomas-nilsson-irfu-master-patch-13137' into 'master' Allow masking if 8 or more characters in base64 See merge request gitlab-org/gitlab-ce!29143
| * | Allow masking if 8 or more characters in base64Thomas Nilsson2019-06-061-2/+2
| |/ | | | | | | | | | | This should allow for private ssh-keys to remain private. Solves https://gitlab.com/gitlab-org/gitlab-ce/issues/60790.
* | Add task count and completed count to responses of Issue and MRPatrick Derichs2019-06-071-0/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add spec for task_completion_status Add test cases for task_completion_status result Extracted shared samples Add new spec file for task completion status response Fix style errors Add changelog entry Changed samples to Hashes Remove test for successful request Remove not nil expectation Add task_completion_status to api documentation for issues Add task_completion_status to api documentation for merge_requests Refactor spec so it just requests one specific item Add task_completion_status to Taskable Simplified task completion status in entities Refactor spec so it separates status code check and content check Fix spec description text and field name
* Use Redis for CacheMarkDownField on non AR modelsPatrick Bajao2019-06-051-72/+16
| | | | | | | | | | | | | | | | | | This allows using `CacheMarkdownField` for models that are not backed by ActiveRecord. When the including class inherits `ActiveRecord::Base` we include `Gitlab::MarkdownCache::ActiveRecord::Extension`. This will cause the markdown fields to be rendered and the generated HTML stored in a `<field>_html` attribute on the record. We also store the version used for generating the markdown. All other classes that include this model will include the `Gitlab::MarkdownCache::Redis::Extension`. This add the `<field>_html` attributes to that model and will generate the html in them. The generated HTML will be cached in redis under the key `markdown_cache:<class>:<id>`. The class this included in must therefore respond to `id`.
* Merge branch 'ce-9578-adjust-opened-issues-count-and-completion-rate' into ↵Robert Speicher2019-06-041-14/+6
|\ | | | | | | | | | | | | 'master' Port: EE adjust burndown chart opened issues count See merge request gitlab-org/gitlab-ce!28777
| * Adjust burndown chart opened issues countce-9578-adjust-opened-issues-count-and-completion-rateAlexandru Croitor2019-06-041-14/+6
| | | | | | | | | | | | * Adjust opened issues count in the milestone burndown chart to match current opened issues in the milestone. * Fix completion rate calculation to include milestones only.