summaryrefslogtreecommitdiff
path: root/spec/services
Commit message (Collapse)AuthorAgeFilesLines
* [CE port] Bypass push rules for merge to ref serviceosw-bypass-push-rules-for-merge-to-refOswaldo Ferreira2019-07-092-0/+26
| | | | | | | | | | | | | | | | Turns out push rules to validate commit message does not apply in the context of automatic merge to the refs/merge-requests/:iid/merge. Mainly because if it fails to merge to it, we currently can't give enough preemptive feedback to the user and it'll turn the merge request unmergeable (given we automatically mark it as unmergeable if we can't merge to the ref). In general, it's a systematic operation, which already bypasses user authorization and git hooks. Therefore, this commit makes it bypass the push rules at EE as well.
* Fix race condition on merge train ref generationrun-pipeline-for-merge-train-at-train-ref-ceShinya Maeda2019-07-081-0/+9
| | | | | | | | | 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 'create-merge-train-ref-ce' into 'master'Douwe Maan2019-07-051-7/+48
|\ | | | | | | | | 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-7/+48
| | | | | | | | | | | | | | 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.
* | Merge branch 'make-explicit-endpoint-abort-in-auto-merge-ce' into 'master'Kamil Trzciński2019-07-054-5/+87
|\ \ | | | | | | | | | | | | CE Port: Split AutoMergeService interfaces into two `cancel` and `abort` See merge request gitlab-org/gitlab-ce!30249
| * | Split AutoMergeService interfaces into two `cancel` and `abort`make-explicit-endpoint-abort-in-auto-merge-ceShinya Maeda2019-07-054-5/+87
| |/ | | | | | | Create explicit endpoint - abort.
* | Refactor PositionTracer to support different typesPatrick Bajao2019-07-051-5/+19
|/ | | | This is to prepare for supporing image type position tracing
* Merge branch '54117-transactional-rebase' into 'master'Douglas Barbosa Alexandre2019-07-041-7/+21
|\ | | | | | | | | | | | | 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-7/+21
| | | | | | | | | | | | | | | | | | 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.
* | Fix MWPS system notes shows inconsistent shafix-mwps-shows-inconsistent-sha-ceShinya Maeda2019-07-043-2/+10
|/ | | | Fix the system note service
* Merge branch 'issue/55953' into 'master'Sean McGivern2019-07-031-1/+1
|\ | | | | | | | | | | | | rename `discussion` to `thread` Closes #55953 See merge request gitlab-org/gitlab-ce!29553
| * Merge branch 'master' into michel.engelen/gitlab-ce-issue/55953Sean McGivern2019-07-032-0/+74
| |\
| * | updated tests for !29553Michel Engelen2019-07-021-1/+1
| | |
* | | Merge branch 'jc-deprecate-diverging-count-with-max' into 'master'Jan Provaznik2019-07-031-27/+6
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Deprecate diverging commit count with max parameter Closes gitaly#1702 See merge request gitlab-org/gitlab-ce!30275
| * | Deprecate diverging commit count with max parameterjc-deprecate-diverging-count-with-maxJohn Cai2019-07-021-27/+6
| | | | | | | | | | | | | | | | | | | | | In 12.0, we turned the feature flag on that effectively turned off the --max-count flag for the count diverging commits call. Since we have commit graphs turned on, this did not affect preformance negatively. Thus, we want to deprecate the call that passes --max-count
* | | Add username to deploy tokensKrasimir Angelov2019-07-021-0/+16
|/ / | | | | | | | | | | | | | | | | 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.
* | Includes logic to persist namespace statisticsMayra Cabrera2019-07-021-0/+58
|/ | | | | | | | | | | | | | | | | | | | | - 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
* Merge branch '58583-confidential-mr-branch-backend' into 'master'Rémy Coutable2019-07-012-92/+145
|\ | | | | | | | | Support creating an MR/branch on a fork from an issue See merge request gitlab-org/gitlab-ce!29831
| * Fix issues when creating system notes58583-confidential-mr-branch-backendPatrick Bajao2019-06-292-10/+26
| | | | | | | | | | | | | | | | | | | | When `confidential_issue_project_id` is set and the issue is under that project, create the a note about branch creation in that project. If not, do nothing. When creating `new_merge_request` system note, set the project where the MR will be referenced from so it'll be linked to when the MR is created in another project.
| * Support branch creation from confidential issuePatrick Bajao2019-06-291-126/+51
| | | | | | | | | | | | | | | | Accept a `confidential_issue_project_id` param which will be used for the system note target. This also includes some refactoring on the spec to use shared examples.
| * Support creating an MR on a fork from an issuePatrick Bajao2019-06-291-82/+194
| |
* | Merge branch 'id-stale-branches' into 'master'Grzegorz Bizon2019-07-011-0/+52
|\ \ | |/ |/| | | | | 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-0/+52
| | | | | | | | Extract diverging_commit_counts into a service class
* | Replace 'JIRA' with 'Jira'Takuya Noguchi2019-06-282-4/+4
| | | | | | | | | | | | https://community.atlassian.com/t5/Jira-questions/Is-it-quot-JIRA-quot-or-quot-Jira-quot/qaq-p/681163 Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
* | Merge branch '53811-issue-boards-to-core-projects-backend-ce' into 'master'Stan Hu2019-06-271-59/+0
|\ \ | | | | | | | | | | | | Move Multiple Issue Boards for Projects to Core See merge request gitlab-org/gitlab-ce!29757
| * | Move Multiple Issue Boards for Projects to Core53811-issue-boards-to-core-projects-backend-ceAlexandru Croitor2019-06-261-59/+0
| |/ | | | | | | | | Refactor code to allow multiple issue boards management for projects in CE
* | Speed up obtaining Let's Encrypt certificatesVladimir Shushlin2019-06-261-2/+10
| |
* | Disable Rails SQL query cache when applying service templatessh-service-template-bugStan Hu2019-06-251-1/+1
|/ | | | | | | | | | When the SQL query cache is active, the SELECT query for finding projects to apply service templates returns the same values. This causes an infinite loop because even though bulk INSERT queries are made, the cached results never reflect that progress. To fix this, we call `Project.uncached` around the query to ensure new data is retrieved. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63595
* Rename to time_tracking_limit_to_hours30355-use-hours-only-for-time-trackingHeinrich Lee Yu2019-06-251-0/+24
| | | | Changes migration and all other places the attribute is used
* Merge branch 'sync-merge-ref-upon-mergeability-check' into 'master'Douwe Maan2019-06-243-31/+317
|\ | | | | | | | | Automatically update MR merge-ref along merge status See merge request gitlab-org/gitlab-ce!29569
| * Avoid touching the MR status if MR is not openedOswaldo Ferreira2019-06-211-0/+24
| |
| * Only force recheck when merge-ref is outdatedOswaldo Ferreira2019-06-201-1/+44
| | | | | | | | | | | | When recheck flag is true, we make sure the merge-ref is indeed outdated. If it is, we update it along the merge status.
| * Automatically update MR merge-ref along merge statusOswaldo Ferreira2019-06-203-31/+250
| | | | | | | | | | | | | | | | | | | | | | | | This couples the code that transitions the `MergeRequest#merge_status` and refs/merge-requests/:iid/merge ref update. In general, instead of directly telling `MergeToRefService` to update the merge ref, we should rely on `MergeabilityCheckService` to keep both the merge status and merge ref synced. Now, if the merge_status is `can_be_merged` it means the merge-ref is also updated to the latest. We've also updated the logic to be more systematic and less user-based.
* | Merge branch '60617-enable-project-cluster-jit' into 'master'Thong Kuah2019-06-242-11/+0
|\ \ | | | | | | | | | | | | Enable JIT Kubernetes resource creation for project level clusters See merge request gitlab-org/gitlab-ce!29515
| * | Enable project-level JIT resource creation60617-enable-project-cluster-jitTiger2019-06-182-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this behaviour was only available to group and instance-level clusters, as some project clusters relied on Kubernetes credentials being passed through to the runner instead of having their resources managed by GitLab (which is not available when using JIT). These clusters have been migrated to unmanaged, so resources can be created on demand for the remaining managed clusters.
* | | Merge branch 'bw-issue-reorder' into 'master'Kamil Trzciński2019-06-212-0/+104
|\ \ \ | | | | | | | | | | | | | | | | Add ability to reorder issues See merge request gitlab-org/gitlab-ce!29012
| * | | Add reorder action to Project IssuesControllerbw-issue-reorderBrett Walker2019-06-212-0/+104
| | |/ | |/| | | | | | | to support manual sorting on the frontend
* | | Don't show private keys for letsencrypt certsVladimir Shushlin2019-06-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds enum certificate_source to pages_domains table with default manually_uploaded Mark certificates as 'gitlab_provided' if the were obtained through Let's Encrypt Mark certificates as 'user_provided' if they were uploaded through controller or api Only show private key in domain edit form if it is 'user_provided' Only show LetsEncrypt option if is enabled by application settings (and feature flag) Refactor and fix some specs to match new logic Don't show Let's Encrypt certificates as well
* | | Retry fetching Kubernetes Secret tokenDylan Griffith2019-06-211-4/+52
|/ / | | | | | | | | | | | | | | Since Kubernetes is creating the Secret and token asynchronously it is necessary that we implement some delay or retrying logic to avoid a race condition where we fetch a Secret before the token is even set. There does not appear to be any way for us to force it to be set with any synchronous API call so retrying seems to be the only option.
* | Merge branch 'revert-concurrent-pipeline-schedule-creation' into 'master'Kamil Trzciński2019-06-181-0/+32
|\ \ | | | | | | | | | | | | Revert concurrent pipeline creation for pipeline schedules See merge request gitlab-org/gitlab-ce!29794
| * | Revert concurrent pipeline schedule creationrevert-concurrent-pipeline-schedule-creationShinya Maeda2019-06-181-0/+32
| |/ | | | | | | | | | | This commit reverts the previously introduced concurrent pipeline schedule creation which was a viable solution for mitigating inconsistent pipeline schedule by Sidekiq Memory Killer.
* | Merge branch '59257-find-new-branches-harder' into 'master'Rémy Coutable2019-06-181-0/+34
|\ \ | | | | | | | | | | | | | | | | | | Look for new branches more carefully Closes #59257 See merge request gitlab-org/gitlab-ce!29761
| * | Look for new branches more carefullyNick Thomas2019-06-181-0/+34
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In certain cases, GitLab can miss a PostReceive invocation the first time a branch is pushed. When this happens, the "branch created" hooks are not run, which means various features don't work until the branch is deleted and pushed again. This MR changes the `Git::BranchPushService` so it checks the cache of existing branches in addition to the `oldrev` reported for the branch. If the branch name isn't in the cache, chances are we haven't run the service yet (it's what refreshes the cache), so we can go ahead and run it, even through `oldrev` is set. If the cache has been cleared by some other means in the meantime, then we'll still fail to run the hooks when we should. Fixing that in the general case is a larger problem, and we'd need to devote significant engineering effort to it. There's a chance that we'll run the relevant hooks *multiple times* with this change, if there's a race between the branch being created, and the `PostReceive` worker being run multiple times, but this can already happen, since Sidekiq is "at-least-once" execution of jobs. So, this should be safe.
* | Move some quick actions feature specs to unit testsFelipe Artur2019-06-181-49/+98
|/ | | | | Move some feature specs for issues/merge requests quick actions to unit tests. They are taking too long to run on the pipelines.
* Hashed Storage is enabled by default on new installationshashed-storage-enabled-defaultGabriel Mazetto2019-06-173-2/+4
| | | | updated documentation for Geo
* Backport the EE schema and migrations to CEYorick Peterse2019-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backports all EE schema changes to CE, including EE migrations, ensuring both use the same schema. == Updated tests A spec related to ghost and support bot users had to be modified to make it pass. The spec in question assumes that the "support_bot" column exists when defining the spec. In the single codebase setup this is not the case, as the column is backported in a later migration. Any attempt to use a different schema version or use of "around" blocks to conditionally disable specs won't help, as reverting the backport migration would also drop the "support_bot" column. Removing the "support_bot" tests entirely appears to be the only solution. We also need to update some foreign key tests now that we have backported the EE columns. Fortunately, these changes are very minor. == Backporting migrations This commit moves EE specific migrations (except those for the Geo tracking database) and related files to CE, and also removes any traces of the ee/db directory. Some migrations had to be modified or removed, as they no longer work with the schema being backported. These migrations were all quite old, so we opted for removing them where modifying them would take too much time and effort. Some old migrations were modified in EE, while also existing in CE. In these cases we took the EE code, and in one case removed them entirely. It's not worth spending time trying to merge these changes somehow as we plan to remove old migrations around the release of 12.0, see https://gitlab.com/gitlab-org/gitlab-ce/issues/59177 for more details.
* Merge branch '9490-record-repository_type-on-lfs_objects_projects-ce' into ↵Grzegorz Bizon2019-06-171-2/+58
|\ | | | | | | | | | | | | 'master' CE backport for gitlab-ee!13894 (Save repository_type to LfsObjectsProject) See merge request gitlab-org/gitlab-ce!29179
| * CE backport for changes in EE MR 138949490-record-repository_type-on-lfs_objects_projects-ceLuke Duncalfe2019-06-171-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backports to CE changes that allow the recording of the repository_type in the table lfs_objects_projects. This is in order to allow future pruning of unreferenced LFS objects, as we will need to know which repository to look in for the LFS pointer file. The EE MR that contains the original code and a full explanation of the changes is https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894 EE Issue https://gitlab.com/gitlab-org/gitlab-ee/issues/9490 Note that there was a lot of CE code changed in the EE MR because we want to allow the wiki repository to also use LFS. See https://gitlab.com/gitlab-org/gitlab-ce/issues/43721. As the wiki is an unlicensed feature, a full backport is required to enable this.
* | Merge branch 'error-pipelines-for-blocked-users' into 'master'Grzegorz Bizon2019-06-173-27/+28
|\ \ | | | | | | | | | | | | | | | | | | Preventing blocked users and their PipelineSchdules from creating new Pipelines Closes #47756 See merge request gitlab-org/gitlab-ce!27318
| * | preventing blocked users and their PipelineSchdules from creating new Pipelinesdrew cimino2019-06-043-27/+28
| | | | | | | | | | | | updated several specs and factories to accomodate new permissions