summaryrefslogtreecommitdiff
path: root/spec/models
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade rspec-rails to 3.8.2 and dependenciessh-bump-rspec-versionsDouglas Barbosa Alexandre2019-07-101-4/+3
| | | | | | | | This brings the rspec-core version in line with the Gitaly changes and introduces Rails 5.1/5.2 improvements. Full CHANGELOG: https://github.com/rspec/rspec-rails/blob/master/Changelog.md
* Merge branch 'prepare-cycle-analytics-for-group-level' into 'master'Douglas Barbosa Alexandre2019-07-108-11/+17
|\ | | | | | | | | Prepare cycle analytics for group level See merge request gitlab-org/gitlab-ce!30356
| * Add newline before subjectprepare-cycle-analytics-for-group-levelMałgorzata Ksionek2019-07-106-0/+6
| | | | | | | | Fix rubocop offences
| * Add cr remarksMałgorzata Ksionek2019-07-098-8/+8
| |
| * Add code review remarksMałgorzata Ksionek2019-07-091-2/+2
| |
| * Move project level specsMałgorzata Ksionek2019-07-091-2/+2
| |
| * Update class callsMałgorzata Ksionek2019-07-097-7/+7
| |
* | GraphQL support for Notes created in discussions62826-graphql-note-mutationsLuke Duncalfe2019-07-101-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | A new `discussion_id` argument on the `createNote` mutation allows people to create a note within that discussion. The ability to lazy-load Discussions has been added, so GraphQL.object_from_id can treat Discussions the same as AR objects and batch load them. https://gitlab.com/gitlab-org/gitlab-ce/issues/62826 https://gitlab.com/gitlab-org/gitlab-ee/issues/9489
* | Merge branch 'master' into sathieu/gitlab-ce-project_apiDouglas Barbosa Alexandre2019-07-0914-441/+489
|\ \ | |/
| * Merge branch 'allow-reactive-caching-of-nil' into 'master'Stan Hu2019-07-091-27/+29
| |\ | | | | | | | | | | | | Allow ReactiveCaching to support nil value See merge request gitlab-org/gitlab-ce!30456
| | * Allow ReactiveCaching to support nil valueFabio Pitino2019-07-081-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Schedule namespace aggregation in other contextsMayra Cabrera2019-07-081-0/+43
| |/ | | | | | | | | | | | | Schedules a Namespace::AggregationSchedule worker if some of the project statistics are refreshed. The worker is only executed if the feature flag is enabled.
| * Merge branch 'run-pipeline-for-merge-train-at-train-ref-ce' into 'master'Kamil Trzciński2019-07-081-0/+30
| |\ | | | | | | | | | | | | CE Port: Fix race condition of `refs/merge` competing overwrite See merge request gitlab-org/gitlab-ce!30308
| | * Fix race condition on merge train ref generationrun-pipeline-for-merge-train-at-train-ref-ceShinya Maeda2019-07-081-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Today, Pipelines for merge train run on `refs/merge`, however, this causes a race condition that it can be overwritten by CheckMergeabilityService. This patch fixes the problem by generating `refs/train` for those pipelines.
| * | Merge branch '63475-fix-n-1' into 'master'Lin Jen-Shin2019-07-083-149/+127
| |\ \ | | | | | | | | | | | | | | | | Reduce N+1 queries in MergeRequestsController#ci_environment_status See merge request gitlab-org/gitlab-ce!30224
| | * | Restore fallback to deployment_platform_clusterThong Kuah2019-07-081-0/+12
| | | | | | | | | | | | | | | | In 12.2 we will remove this fallback.
| | * | Remove un-used methodThong Kuah2019-07-081-28/+0
| | | | | | | | | | | | | | | | We stopped calling the fallback so we can remove this now
| | * | Extract deployment_metrics into own objectThong Kuah2019-07-082-107/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We can now share project so that we don't have to load project twice. Also, this extracts non-relevant logic out of Deployment. Update DeploymentsController accordingly
| | * | Share project object in EnvironmentStatusThong Kuah2019-07-081-2/+1
| | | | | | | | | | | | | | | | | | | | Otherwise, each EnvironmentStatus object instantiates its own project when really they are the same. Improves query count performance
| | * | Remove fallback to project.deployment_platformThong Kuah2019-07-081-12/+0
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves query performance of MergeRequestsController#ci_environments_status a lot. However this means old deployments that deployed to kubernetes clusters with prometheus installations will no longer show performance metrics as we cannot backfill cluster_id from deployment_platform with certainty (clusters may be edited/added/deleted, which changes the results of deployment_platform).
| * | Merge branch '40379-CJK-search-min-chars' into 'master'Andreas Brandl2019-07-081-0/+10
| |\ \ | | | | | | | | | | | | | | | | 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-0/+10
| | | | | | | | | | | | | | | | | | | | 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-082-1/+90
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 OpenSSL::OpenSSLError to HTTP_ERRORSDouglas Barbosa Alexandre2019-07-051-0/+9
| | | | | | | | | | | | | | | | | | Some services can raise OpenSSL::X509::CertificateError due to an invalid SSL certificates, with OpenSSL::OpenSSLError we can handle these errors.
| * | Merge branch 'create-merge-train-ref-ce' into 'master'Douwe Maan2019-07-051-2/+3
| |\ \ | | | | | | | | | | | | | | | | CE Port: Extend `MergeToRefService` to create merge ref from an arbitrary ref See merge request gitlab-org/gitlab-ce!30361
| | * | Extend MergeToRefService for creating merge ref from the other refShinya Maeda2019-07-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, MergeToRefService is specifically designed for createing merge commits from source branch and target branch of merge reqeusts. We extend this behavior to source branch and any target ref paths.
| * | | Remove now unused KubernetesService methodsremove_unused_k8s_service_methodsJames Fargher2019-07-052-235/+0
| |/ / | | | | | | | | | | | | Now that KubernetesService can no longer be a DeploymentPlatform we can remove all kubernetes client code and KubernetesService edge cases.
| * | Merge branch '54117-transactional-rebase' into 'master'Douglas Barbosa Alexandre2019-07-041-24/+91
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Allow asynchronous rebase operations to be monitored Closes #54117 See merge request gitlab-org/gitlab-ce!29940
| | * | Allow asynchronous rebase operations to be monitoredNick Thomas2019-07-041-24/+91
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | This MR introduces tracking of the `rebase_jid` for merge requests. As with `merge_ongoing?`, `rebase_in_progress?` will now return true if a rebase is proceeding in sidekiq. After one release, we should remove the Gitaly-based lookup of rebases. It is much better to track this kind of thing via the database.
| * | Implements lease_release on NamespaceAggregationMayra Cabrera2019-07-041-1/+30
| | | | | | | | | | | | | | | | | | | | | Sets lease_release? to false to prevent the job to be re-executed more often than lease timeout Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64079
| * | Refactor pipeline errors_messagerefactor-pipeline-errors_message-ceShinya Maeda2019-07-041-0/+24
| |/ | | | | | | Use the shared method in Ci::Pipeline
| * Fix order-dependent spec failure in appearance_spec.rbStan Hu2019-07-031-1/+1
| | | | | | | | | | | | | | | | | | When file_mover_spec.rb ran, it would initialize fog-aws with `Fog::AWS::Storage::Real` service instead of `Fog::AWS::Storage::Mock` because `Fog.mock!` was not called. Ensure that we use `stub_uploads_object_storage` to prevent that from happening. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64083
| * Put a failed example from appearance_spec in quarantineIgor2019-07-031-1/+1
| |
* | Add auto_devops_* to project APIMathieu Parent2019-07-031-2/+23
| | | | | | | | | | 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/+17
| | | | | | | | | | We map the boolean to the string 'fetch' or 'clone', to be more explicit.
* | Add *_access_level to project APIMathieu Parent2019-07-031-5/+13
|/ | | | | | | | | - issues_access_level - repository_access_level - merge_requests_access_level - builds_access_level - wiki_access_level - snippets_access_level
* Show upcoming status for releasesJason Goodman2019-07-031-0/+10
| | | | | | Add released_at field to releases API Add released_at column to releases table Return releases to the API sorted by released_at
* Add username to deploy tokensKrasimir Angelov2019-07-021-2/+33
| | | | | | | | | This new attribute is optional and used when set instead of the default format `gitlab+deploy-token-#{id}`. Empty usernames will be saved as null in the database. Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/50228.
* Merge branch '63690-issue-trackers-title' into 'master'Dmitriy Zaporozhets2019-07-027-34/+330
|\ | | | | | | | | | | | | Use title and description fields for issue trackers Closes #63690 See merge request gitlab-org/gitlab-ce!30096
| * Use title and description fields for issue trackers63690-issue-trackers-titleJarka Košanová2019-07-027-34/+330
| | | | | | | | | | - instead of using properties - backward compatibility has to be kept for now
* | Includes logic to persist namespace statisticsMayra Cabrera2019-07-023-1/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Enables ingress for uninstallationJoão Cunha2019-07-021-1/+15
| | | | | | | | - JupyterHub must not be available (installed or updated)
* | Fix failing spec/models/user_spec.rbStan Hu2019-07-021-1/+1
| |
* | Use an uncached application setting for usage ping checksStan Hu2019-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The introduction of the in-memory cache for application settings had a side effect of making it harder to invalidate changes when the settings occur. We now bypass the cache because it's possible the admin enabled the usage ping, and we don't want to annoy the user again if they already set the value. To avoid causing significant load on the system, we add an extra check to ensure the user is an admin. and we don't want to annoy the user again if they already set the value. This is a bit of hack, but the alternative would be to put in a more complex cache invalidation step. Since this call only gets called in the uncommon situation where the user is an admin and the only user in the instance, this shouldn't cause too much load on the system.
* | Fix specs in spec/models/concerns/cacheable_attributes_spec.rbStan Hu2019-07-011-4/+5
| |
* | Allow JupyterHub to be uninstalledJoão Cunha2019-07-011-1/+1
|/ | | | | | - enabled uninstallation - give it a specific uninstall message - ajust specs
* Merge branch 'id-stale-branches' into 'master'Grzegorz Bizon2019-07-011-42/+0
|\ | | | | | | | | Add endpoint for fetching diverging commit counts See merge request gitlab-org/gitlab-ce!29802
| * Add endpoint for fetching diverging commit countsid-stale-branchesIgor Drozdov2019-06-281-42/+0
| | | | | | | | Extract diverging_commit_counts into a service class
* | Merge branch 'add-clusters-to-deployment' into 'master'Lin Jen-Shin2019-07-012-4/+72
|\ \ | | | | | | | | | | | | Add clusters association to deployment See merge request gitlab-org/gitlab-ce!29960