summaryrefslogtreecommitdiff
path: root/app/services/git
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@13-0-stable-eeGitLab Bot2020-05-203-2/+124
|
* Add latest changes from gitlab-org/gitlab@12-10-stable-eeGitLab Bot2020-04-202-0/+10
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-03-171-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-071-4/+12
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-061-10/+16
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-221-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-171-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-111-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-11-211-0/+24
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-172-4/+19
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-162-3/+10
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-111-0/+57
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-035-25/+29
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-032-16/+0
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-181-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-134-0/+8
|
* Log errors for failed pipeline creation in PostReceivesh-add-sidekiq-logging-for-bad-ciStan Hu2019-09-051-1/+27
| | | | | | | | | | When a pipeline fails to create in `PostReceive`, the error is silently discarded, making it difficult to understand why a pipeline was not created. We now add a Sidekiq warning message for this. Adding a Sentry exception when this happens would generate a lot of noise for invalid CI files. Relates to https://gitlab.com/gitlab-org/gitlab-ee/issues/14720
* Fix pipelines not always being created after a pushsh-fix-pipelines-not-being-createdStan Hu2019-08-171-7/+12
| | | | | | | | | 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-2/+23
|\ | | | | | | | | | | | | 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-2/+23
| | | | | | | | | | | | | | | | 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-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge branch 'sh-optimize-commit-deltas-post-receive' into 'master'Nick Thomas2019-08-141-12/+33
|\ \ | |/ |/| | | | | | | | | 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-121-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Invalidate branches cache on PostReceivePatrick Bajao2019-08-091-2/+2
|/ | | | | | | | | | | | | | | | Whenever `PostReceive` is enqueued, `UpdateMergeRequestsWorker` is enqueued and `MergeRequests::RefreshService` is called, it'll check if the source branch of each MR asssociated to the push exists or not via `MergeRequest#source_branch_exists?`. The said method will call `Repository#branch_exists?` which is cached in `Rails.cache`. When the cache contains outdated data and the source branch actually exists, the `MergeRequests#RefreshService` job will close associated MRs which is not correct. The fix is to expire the branches cache of the project so we have updated data during the post receive hook which will help in the accuracy of the check if we need to close associated MRs or not.
* Backport of 12014-incremental-es-wiki-updatesce-12014-incremental-es-wiki-updatesMario de la Ossa2019-06-181-0/+9
| | | | Bringing in the DB migration and some light changes for CE classes
* Look for new branches more carefullyNick Thomas2019-06-181-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Modify the branch hooks spec to expect processing of commit messagesFabio Papa2019-06-131-5/+1
| | | | | | | | | 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.
* Fix remote mirrors not updating after tag pushsh-fix-tag-push-remote-mirrorStan Hu2019-05-172-1/+9
| | | | | | | | | Remote mirrors were only being updated after pushes to branches, not tags. This change consolidates the functionality into Git::BaseHooksService so that both tags and branches will now update remote mirrors. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51240
* Change DetectRepositoryLanguagesWorker to not receive userDiego Silva2019-05-091-1/+1
| | | | Fixes #60425
* Use all keyword args for DataBuilder::Push.build()Jonathon Reinhart2019-04-251-7/+7
|
* Process at most 4 pipelines during pushlimit-amount-of-created-pipelinesKamil TrzciƄski2019-04-101-0/+2
| | | | | | | | This adds a limitation that we will try to create pipeline for at most 4 first changes (branches and tags). This does not affect processing of Pipelines for Merge Requests, as each updated MR will have associated pipeline created.
* Use Gitlab::PushOptions for `ci.skip` push optionLuke Duncalfe2019-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the raw push option Array was sent to Pipeline::Chain::Skip. This commit updates this class (and the chain of classes that pass the push option parameters from the API internal `post_receive` endpoint to that class) to treat push options as a Hash of options parsed by GitLab::PushOptions. The GitLab::PushOptions class takes options like this: -o ci.skip -o merge_request.create -o merge_request.target=branch and turns them into a Hash like this: { ci: { skip: true }, merge_request: { create: true, target: 'branch' } } This now how Pipeline::Chain::Skip is determining if the `ci.skip` push option was used.
* Extract a Git::{Base,Tag,Branch}HooksServiceNick Thomas2019-04-055-229/+310
|
* Only execute system hooks once when pushing tagsNick Thomas2019-04-031-12/+0
|
* Rename GitPushService -> Git::BranchPushServiceNick Thomas2019-03-251-0/+244
|
* Rename GitTagPushService -> Git::TagPushServiceNick Thomas2019-03-251-0/+68