summaryrefslogtreecommitdiff
path: root/spec/services
Commit message (Collapse)AuthorAgeFilesLines
* Do not persist translated system notes63262-notes-are-persisted-with-the-user-s-localeSean McGivern2019-08-281-0/+7
|
* Save board lists collapsed settingFelipe Artur2019-08-282-2/+93
| | | | Persists if a board list is collapsed for each user.
* Merge branch 'sh-lfs-object-batches' into 'master'Rémy Coutable2019-08-281-0/+18
|\ | | | | | | | | | | | | Makes LFS object link process OIDs in batches Closes #66274 See merge request gitlab-org/gitlab-ce!32268
| * Makes LFS object linker process OIDs in batchessh-lfs-object-batchesStan Hu2019-08-271-0/+18
| | | | | | | | | | | | | | | | | | | | During a project import, `LfsLinkService` attempts to link `LfsObjects` that have not already been associated with a project. It's possible for a large repo to have thousands of OIDs, which can cause long database query and parsing times. By processing a batch of 1000 at a time, we can reduce that time at the expense of a few more SQL queries. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66274
* | CE-specific changes for designs `user_notes_count`Luke Duncalfe2019-08-274-53/+29
|/ | | | | | | | | | | | | | | Notes call `#after_note_created` and `#after_note_destroyed` on their noteable in callbacks, so the noteable can perform tasks particular to them, like cache expiry. This is in preparation of the EE-specific class `DesignManagement::Design` clearing its `user_notes_count` cache when its note are created or destroyed. Refactoring Rspec behaviour testing of a counter caching service into a shared example. https://gitlab.com/gitlab-org/gitlab-ee/issues/13353
* Use `stub_full_request` to fix spec failure66641-broken-master-real-http-connections-are-disabled-unregistered-requestHeinrich Lee Yu2019-08-271-13/+20
| | | | Also change test URL sequest to .test TLD
* Add usage pings for merge request creatingIgor2019-08-261-1/+7
| | | | Code Review Usage Ping for Create SMAU
* Merge branch ↵Nick Thomas2019-08-261-0/+18
|\ | | | | | | | | | | | | | | | | '66443-unrecoverable-configuration-loop-in-external-auth-control' into 'master' Resolve "Unrecoverable configuration loop in external auth control" Closes #66443 See merge request gitlab-org/gitlab-ce!32102
| * Add more tests to cover all cases66443-unrecoverable-configuration-loop-in-external-auth-controlRobert Schilling2019-08-221-0/+12
| |
| * Add test, reduce complexityRobert Schilling2019-08-221-0/+6
| |
* | Add a link to docs in project descriptionReuben Pereira2019-08-231-234/+0
| | | | | | | | Add to the service and migration both.
* | Merge branch 'optimise-build-queue-service' into 'master'Grzegorz Bizon2019-08-231-43/+67
|\ \ | |/ |/| | | | | | | | | Optimise UpdateBuildQueueService Closes #66438 See merge request gitlab-org/gitlab-ce!32095
| * Optimise build queue serviceoptimise-build-queue-serviceKamil Trzciński2019-08-221-43/+67
| | | | | | | | | | | | | | | | 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.
* | Merge branch '63372-award-emoji-services' into 'master'Grzegorz Bizon2019-08-215-0/+290
|\ \ | |/ |/| | | | | | | | | Add service classes for mutating AwardEmoji Closes #63372 See merge request gitlab-org/gitlab-ce!29782
| * Add service classes for mutating AwardEmojiLuke Duncalfe2019-08-214-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding, destroying and toggling emoji previously lacked services and instead were performed through methods called on Awardable models. This led to inconsistencies where relevant todos would be marked as done only when emoji were awarded through our controllers, but not through the API. Todos could also be marked as done when an emoji was being removed. Behaviour changes - Awarding emoji through the API will now mark a relevant Todo as done - Toggling an emoji off (destroying it) through our controllers will no longer mark a relevant Todo as done Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63372
| * Renaming AwardedEmojiFinder to a ServiceLuke Duncalfe2019-08-211-0/+25
| | | | | | | | | | | | | | | | | | | | This finder class acts more as a service, as it only returns mapped data. Renaming this class allows us to create a new AwardEmojiFinder without the ambiguity of there being two similarly-named finders. https://gitlab.com/gitlab-org/gitlab-ce/issues/63372
* | Merge branch '65427-improve-system-notes-for-zoom-links' into 'master'Thong Kuah2019-08-212-4/+4
|\ \ | |/ |/| | | | | | | | | Resolve "Improve system notes for Zoom links" Closes #65427 See merge request gitlab-org/gitlab-ce!31410
| * Improve system notes for Zoom links65427-improve-system-notes-for-zoom-linksJacopo2019-08-172-4/+4
| | | | | | | | | | | | | | changes: @user a Zoom call was added to this issue into: @user added a Zoom call to this issue Same concept appleis for "removed"
* | Fix pipelines not always being created after a pushsh-fix-pipelines-not-being-createdStan Hu2019-08-171-0/+16
| | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31741 introduced a regression where not all the right parameters would be passed into `Ci::CreatePipelineService`. We fix this by breaking out the pipeline parameters and reusing a method from `Gitlab::DataBuilder::Push`. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66196
* | Merge branch 'dm-process-commit-worker-n+1' into 'master'Stan Hu2019-08-161-10/+60
|\ \ | | | | | | | | | | | | | | | | | | Look up upstream commits once before queuing ProcessCommitWorkers Closes #65464 See merge request gitlab-org/gitlab-ce!31871
| * | Look up upstream commits once before queuing ProcessCommitWorkersDouwe Maan2019-08-161-10/+60
| | | | | | | | | | | | | | | | | | | | | | | | Instead of checking if a commit already exists in the upstream project in its ProcessCommitWorker and bailing out if it does, we check the existence of all commits in bulk in Git::BranchHooksService, so that we can skip scheduling ProcessCommitWorker jobs for those commits that already exist upstream entirely.
* | | Expire project caches once per push instead of once per refStan Hu2019-08-161-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `ProjectCacheWorker` would be scheduled once per ref, which would generate unnecessary I/O and load on Sidekiq, especially if many tags or branches were pushed at once. `ProjectCacheWorker` would expire three items: 1. Repository size: This only needs to be updated once per push. 2. Commit count: This only needs to be updated if the default branch is updated. 3. Project method caches: This only needs to be updated if the default branch changes, but only if certain files change (e.g. README, CHANGELOG, etc.). Because the third item requires looking at the actual changes in the commit deltas, we schedule one `ProjectCacheWorker` to handle the first two cases, and schedule a separate `ProjectCacheWorker` for the third case if it is needed. As a result, this brings down the number of `ProjectCacheWorker` jobs from N to 2. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52046
* | | Only read rebase status from the modelNick Thomas2019-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to 12.1, rebase status was looked up directly from Gitaly. In https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14417 , a DB column was added to track the status instead. However, we couldn't stop looking at the gitaly status immediately, since some rebases may been running across the upgrade. Now that we're in 12.3, it is safe to remove the direct-to-gitaly lookup. This also happens to fix a 500 error that is seen when viewing an MR for a fork where the source project has been removed. We still look at the Gitaly status in the service, just in case Gitaly and Sidekiq get out of sync - I assume this is possible, and it's a relatively cheap check. Since we atomically check and set `merge_requests.rebase_jid`, we should never enqueue two `RebaseWorker` jobs in parallel.
* | | Allow disabling group/project email notificationsBrett Walker2019-08-153-71/+289
| |/ |/| | | | | | | | | - Adds UI to configure in group and project settings - Removes notification configuration for users when disabled at group or project level
* | Merge branch 'sh-optimize-commit-deltas-post-receive' into 'master'Nick Thomas2019-08-144-4/+87
|\ \ | | | | | | | | | | | | | | | | | | Reduce Gitaly calls in PostReceive Closes #65878 See merge request gitlab-org/gitlab-ce!31741
| * | Reduce Gitaly calls in PostReceivesh-optimize-commit-deltas-post-receiveStan Hu2019-08-124-4/+87
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reduces I/O load and memory utilization during PostReceive for the common case when no project hooks or services are set up. We saw a Gitaly N+1 issue in `CommitDelta` when many tags or branches are pushed. We can reduce this overhead in the common case because we observe that most new projects do not have any Web hooks or services, especially when they are first created. Previously, `BaseHooksService` unconditionally iterated through the last 20 commits of each ref to build the `push_data` structure. The `push_data` structured was used in numerous places: 1. Building the push payload in `EventCreateService` 2. Creating a CI pipeline 3. Executing project Web or system hooks 4. Executing project services 5. As the return value of `BaseHooksService#execute` 6. `BranchHooksService#invalidated_file_types` We only need to generate the full `push_data` for items 3, 4, and 6. Item 1: `EventCreateService` only needs the last commit and doesn't actually need the commit deltas. Item 2: In addition, `Ci::CreatePipelineService` only needed a subset of the parameters. Item 5: The return value of `BaseHooksService#execute` also wasn't being used anywhere. Item 6: This is only used when pushing to the default branch, so if many tags are pushed we can save significant I/O here. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65878 Fic
* | Merge branch 'require-needs-to-be-present' into 'master'Grzegorz Bizon2019-08-141-1/+2
|\ \ | | | | | | | | | | | | | | | | | | Require `needs:` to be present Closes #65839 See merge request gitlab-org/gitlab-ce!31761
| * | Require `needs:` to be presentrequire-needs-to-be-presentKamil Trzciński2019-08-131-1/+2
| |/ | | | | | | | | | | | | This changes the `needs:` logic to require that all jobs to be present. Instead of skipping do fail the pipeline creation if `needs:` dependency is not found.
* | Rework retry strategy for remote mirrorsBob Van Landuyt2019-08-131-12/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Prevention of running 2 simultaneous updates** Instead of using `RemoteMirror#update_status` and raise an error if it's already running to prevent the same mirror being updated at the same time we now use `Gitlab::ExclusiveLease` for that. When we fail to obtain a lease in 3 tries, 30 seconds apart, we bail and reschedule. We'll reschedule faster for the protected branches. If the mirror already ran since it was scheduled, the job will be skipped. **Error handling: Remote side** When an update fails because of a `Gitlab::Git::CommandError`, we won't track this error in sentry, this could be on the remote side: for example when branches have diverged. In this case, we'll try 3 times scheduled 1 or 5 minutes apart. In between, the mirror is marked as "to_retry", the error would be visible to the user when they visit the settings page. After 3 tries we'll mark the mirror as failed and notify the user. We won't track this error in sentry, as it's not likely we can help it. The next event that would trigger a new refresh. **Error handling: our side** If an unexpected error occurs, we mark the mirror as failed, but we'd still retry the job based on the regular sidekiq retries with backoff. Same as we used to The error would be reported in sentry, since its likely we need to do something about it.
* | Only expire tag cache once per pushsh-only-flush-tags-once-per-pushStan Hu2019-08-131-2/+2
|/ | | | | | | | | | Previously each tag in a push would invoke the Gitaly `FindAllTags` RPC since the tag cache would be invalidated with every tag. We can eliminate those extraneous calls by expiring the tag cache once in `PostReceive` and taking advantage of the cached tags. Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/65795
* Improve quick action error messagesHeinrich Lee Yu2019-08-131-18/+18
| | | | Standardize punctuation and format
* Fix :wiki_can_not_be_created_total counteralipniagov-fix-wiki_can_not_be_created_total-counterAleksei Lipniagov2019-08-091-1/+4
|
* Record usage on snippet usageMark Chao2019-08-083-0/+71
| | | | Generalize wiki page counter for other page types to extend to.
* CE port for bulk updating group labelsEugenia Grieff2019-08-081-151/+168
| | | | - Original EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14827
* Save instance administration project id in DBReuben Pereira2019-08-071-18/+53
| | | | | - This will make it easy to identify the project even if admins change the name of the project or move it.
* Support dashboard params for metrics dashboardSarah Yasonik2019-08-072-0/+296
| | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/62971 Adds support to EnvironmentsController#metrics_dashboard for the following params: group, title, y_label These params are used to uniquely identify a panel on the metrics dashboard. Metrics are stored in several places, so this adds utilities to find a specific panel from the database or filesystem depending on the metric specified. Also moves some shared utilities into separate classes, notably default values and errors.
* Merge branch 'sh-disable-registry-delete' into 'master'Thong Kuah2019-08-071-0/+12
|\ | | | | | | | | Don't attempt to contact registry if it is disabled See merge request gitlab-org/gitlab-ce!31553
| * Don't attempt to contact registry if it is disabledsh-disable-registry-deleteStan Hu2019-08-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21679 moved the deletion of registry tags outside of a transaction, but introduced an issue where Sidekiq would attempt to contact the container registry during project destruction even if it were disabled. Relates to: * https://gitlab.com/charts/gitlab/issues/1455 * https://gitlab.com/gitlab-org/gitlab-ce/issues/45941
* | Use separate Kubernetes namespaces per environmentTiger Watson2019-08-072-5/+66
| | | | | | | | | | | | | | | | | | | | | | | | Kubernetes deployments on new clusters will now have a separate namespace per project environment, instead of sharing a single namespace for the project. Behaviour of existing clusters is unchanged. All new functionality is controlled by the :kubernetes_namespace_per_environment feature flag, which is safe to enable/disable at any time.
* | Convert RestClient to Gitlab::HTTP for Prometheus MonitorDavid Wilkins2019-08-072-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | - Closes #60024 - Change PrometheusClient.new to accept a base url instead of an already created RestClient - Use Gitlab::HTTP in PrometheusClient instead of creating RestClient in PrometheusService - Move http_options from PrometheusService to PrometheusClient (follow_redirects: false) - ensure that base urls don't have the trailing slash - Created a `PrometheusClient#url` method that might not be strictly required - Change rescued exceptions from RestClient::* to HTTParty::ResponseError where possible and StandardError for the rest
* Merge branch 'georgekoltsov/55474-outbound-setting-system-hooks' into 'master'Rémy Coutable2019-08-053-10/+30
|\ | | | | | | | | Add outbound setting for system hooks See merge request gitlab-org/gitlab-ce!31177
| * Add backwards compatibility for legacy settingGeorge Koltsov2019-08-021-1/+1
| | | | | | | | | | `allow_local_requests_for_hooks_and_services` was renamed to `allow_local_requests_for_web_hooks_and_services`.
| * Refactor SystemHookUrlValidator and specsGeorge Koltsov2019-08-021-5/+5
| | | | | | | | | | | | Simplify SystemHookUrlValidator to inherit from PublicUrlValidator Refactor specs to move out shared examples to be used in both system hooks and public url validators.
| * Update security/webhooks.md doc page & specsGeorge Koltsov2019-08-021-29/+21
| | | | | | | | | | | | Updating security/webhooks.md to match new behaviour as well as drying up few specs to extract shared examples
| * Add outbound requests setting for system hooksGeorge Koltsov2019-08-023-10/+38
| | | | | | | | | | | | | | This MR adds new application setting to network section `allow_local_requests_from_system_hooks`. Prior to this change system hooks were allowed to do local network requests by default and we are adding an ability for admins to control it.
* | Merge branch 'properly-process-all-needs' into 'master'Sean McGivern2019-08-051-0/+44
|\ \ | | | | | | | | | | | | | | | | | | Properly process all needs Closes #65488 See merge request gitlab-org/gitlab-ce!31415
| * | Properly process `needs:` with `when:`properly-process-all-needsKamil Trzciński2019-08-021-0/+44
| |/ | | | | | | | | | | | | | | | | | | Currently, some of the jobs with `needs:` would be processed in stages, it means that `when:` for such jobs would not be respected. This changes the behavior to have a separate execution paths for jobs with `needs:`.
* | Make needs: to require previous jobsmake-needs-strong-connectionKamil Trzciński2019-08-021-0/+56
|/ | | | | | | | | This changes `needs:` from weak reference to have a strong reference. This means that job will not be created unless all needs are present as part of a pipeline.
* Merge branch 'ce-docker_image_replication' into 'master'Douglas Barbosa Alexandre2019-08-011-0/+13
|\ | | | | | | | | Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3809 See merge request gitlab-org/gitlab-ce!31375
| * Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3809ce-docker_image_replicationValery Sizov2019-08-011-0/+13
| | | | | | | | Introducing Docker Registry replication