summaryrefslogtreecommitdiff
path: root/spec/services
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | | Fix inability to set visibility_level on project via APIsh-fix-issue-63158Stan Hu2019-06-141-0/+27
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the scenario: 1. The default visibility level is set to internal 2. A user attempts to create a private project within a private group Previously this would always fail because default_value_for would overwrite the private visibility setting, no matter what visibility_level were specified. This was happening because default_value_for was confused by the default value of 0 specified by the database schema. default_value_for attempts to assign the default value in the block by checking whether the attribute has changed. The problem is that since the default value by the database was 0, and the user requested 0, this appeared as though no changes were made. As a result, default_value_for would always overwrite the user's preference. To fix this, we remove the use of default_value_for and only set the visibility level to the default application setting when no preference has been given at creation time. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63158
* | Modify the branch hooks spec to expect processing of commit messagesFabio Papa2019-06-131-2/+2
| | | | | | | | | | | | | | | | | | Commit messages are not processed for references to issues when creating the default branch on push. This was expected behavior (probably to avoid performance problems when first pushing a repository with thousands of commits). However, this is not an issue because we always limit the number of commits to process to 100 regardless of whether we are creating the default branch or not.
* | Add auto merge strategiesadd-merge-train-auto-merge-strategy-ceShinya Maeda2019-06-121-2/+2
| | | | | | | | AddToMergeTrainWhenPipelineSucceeds and MergeTrain
* | Merge branch 'expose-project-git-depth-via-api' into 'master'Kamil Trzciński2019-06-121-4/+4
|\ \ | | | | | | | | | | | | | | | | | | Expose default_git_depth via project API Closes #62908 See merge request gitlab-org/gitlab-ce!29353
| * | Expose ci_default_git_depth via project APIexpose-project-git-depth-via-apiFabio Pitino2019-06-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Get and Update of ci_default_git_depth for Project API. Renaming Project#default_git_depth to :ci_default_git_depth to give more context through the API usage. Add API documentation
* | | Update merge options for auto merge strategiesShinya Maeda2019-06-122-0/+48
| | | | | | | | | | | | | | | Currently, merge options is updated on #execute method, however, we should have #update interface to make it explicit.
* | | Revert "Automatically update MR merge-ref along merge status"Oswaldo Ferreira2019-06-113-212/+32
| | |
* | | Merge branch 'fix-pipeline-schedule-owner-is-nil' into 'master'Stan Hu2019-06-111-0/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix pipeline schedule when owner is nil Closes gitlab-com/gl-infra/production#805 and #63086 See merge request gitlab-org/gitlab-ce!29477
| * | | Fix pipeline schedule when owner is nilfix-pipeline-schedule-owner-is-nilShinya Maeda2019-06-111-0/+8
| |/ / | | | | | | | | | Fixing the bug
* | | Merge branch 'process-when-auto-merge-is-enabled' into 'master'Kamil Trzciński2019-06-111-0/+10
|\ \ \ | |/ / |/| | | | | | | | Notify events when auto merge is enabled or merge param is updated See merge request gitlab-org/gitlab-ce!29415
| * | Notify when auto merge is enabledprocess-when-auto-merge-is-enabledShinya Maeda2019-06-101-0/+10
| | | | | | | | | | | | | | | There are bunch of auto merge related notifications, and when auto merge is enabled, it should be evaluated immediately.
* | | Cancel Auto Merge when target branch is changedcancel-auto-merge-when-branch-is-changedShinya Maeda2019-06-101-0/+12
|/ / | | | | | | When target branch is updated, Auto Merge should be canceled.
* | Merge branch '58297-remove-extraneous-gitaly-calls-from-md-rendering' into ↵Dmitriy Zaporozhets2019-06-072-2/+4
|\ \ | | | | | | | | | | | | | | | | | | 'master' Remove extraneous DiffNote#supports_suggestion? calls See merge request gitlab-org/gitlab-ce!29027
| * | Update spec param expectationsKerri Miller2019-06-051-1/+3
| | |
| * | Remove 2nd stub expectation of #last_diff_fileKerri Miller2019-06-051-1/+1
| | | | | | | | | | | | | | | | | | It looks to be a stub/mock rather than strictly an expectation of the system, so dropping this to only a single invocation expected, as we've removed one of the two places #last_diff_file would be invoked.
* | | Merge branch '62418-project-default-git-depth' into 'master'Kamil Trzciński2019-06-071-0/+24
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Add project level git depth setting Closes #59688 See merge request gitlab-org/gitlab-ce!28919
| * | | Forks get default_git_depth 0 if the origin is nilKrasimir Angelov2019-06-061-4/+20
| | | | | | | | | | | | | | | | | | | | If the origin project has no default_git_depth set (i.e. nil) set the fork's default_git_depth to 0
| * | | Add project level git depth settingKrasimir Angelov2019-06-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce default_git_depth in project's CI/CD settings and set it to 50. Use it if there is no GIT_DEPTH variable specified. Apply this default only to newly created projects and keep it nil for old ones in order to not break pipelines that rely on non-shallow clones. default_git_depth can be updated from CI/CD Settings in the UI, must be either nil or integer between 0 and 1000 (incl). Inherit default_git_depth from the origin project when forking projects. MR pipelines are run on a MR ref (refs/merge-requests/:iid/merge) and it contains unique commit (i.e. merge commit) which doesn't exist in the other branch/tags refs. We need to add it cause otherwise it may break pipelines for old projects that have already enabled Pipelines for merge results and have git depth 0. Document new default_git_depth project CI/CD setting
* | | | Add pages domains acme ordersVladimir Shushlin2019-06-062-0/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract acme double to helper Create ACME challanges for pages domains * Create order & challange through API * save them to database * request challenge validation We're saving order and challenge as one entity, that wouldn't be correct if we would order certificates for several domains simultaneously, but we always order certificate per domain Add controller for processing acme challenges redirected from pages Don't save acme challenge url - we don't use it Validate acme challenge attributes Encrypt private_key in acme orders
* | | | Merge branch 'create-base-class-for-auto-merge-architecture' into 'master'Robert Speicher2019-06-061-0/+144
|\ \ \ \ | |/ / / |/| | | | | | | | | | | Create BaseService for Auto Merge architecture See merge request gitlab-org/gitlab-ce!29120
| * | | Create BaseService for Auto Merge architecturecreate-base-class-for-auto-merge-architectureShinya Maeda2019-06-061-0/+144
| |/ / | | | | | | | | | It abstracts some codes for common methods in AutoMerge::*Services.
* | | Introduce service for merge request pipeline creationcreate-merge-request-create-pipeline-serviceShinya Maeda2019-06-061-0/+71
|/ / | | | | | | | | | | We don't have a way to create MR pipeline today, this is one of the headaches for users. This change is a preliminary work for the capability.
* | Delete unauthorized Todos when project is privateissue_49897Felipe Artur2019-06-052-17/+42
|/ | | | | Delete Todos for guest users when project visibility level is updated to private.
* Merge branch 'cancel-auto-merge-when-merge-request-is-closed' into 'master'Grzegorz Bizon2019-06-041-0/+8
|\ | | | | | | | | Cancel auto merge when merge request is closed See merge request gitlab-org/gitlab-ce!28782
| * Cancel auto merge when merge request is closedcancel-auto-merge-when-merge-request-is-closedShinya Maeda2019-06-041-0/+8
| | | | | | | | We should cancel auto merge when merge request is closed.
* | Merge branch ↵Kamil Trzciński2019-06-041-0/+28
|\ \ | |/ |/| | | | | | | | | | | | | 'set-real-next-run-at-for-preventing-duplciate-pipeline-creations' into 'master' Make pipeline schedule worker resilient Closes gitlab-com/gl-infra/production#805 and #61955 See merge request gitlab-org/gitlab-ce!28407
| * Make pipeline schedule worker resilientset-real-next-run-at-for-preventing-duplciate-pipeline-creationsShinya Maeda2019-06-031-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, pipeline schedule worker is unstable because it's sometimes killed by excessive memory consumption. In order to improve the performance, we add the following fixes: 1. next_run_at is always real_next_run, which means the value always takes into account of worker's cron schedule 1. Remove exlusive lock. This is already covered by real_next_run change. 1. Use RunPipelineScheduleWorker for avoiding memory killer. Memory consumption is spread to the multiple sidekiq worker.
* | Merge branch 'osw-sync-merge-ref-upon-mergeability-check' into 'master'Douwe Maan2019-06-033-32/+212
|\ \ | | | | | | | | | | | | | | | | | | Automatically update MR merge-ref along merge status Closes #58495 See merge request gitlab-org/gitlab-ce!28513