summaryrefslogtreecommitdiff
path: root/app/workers
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Enable Style/DotPosition"Douwe Maan2017-02-238-21/+21
| | | | | | | | | | | | | | | This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9. # Conflicts: # .rubocop.yml # .rubocop_todo.yml # lib/gitlab/ci/config/entry/global.rb # lib/gitlab/ci/config/entry/jobs.rb # spec/lib/gitlab/ci/config/entry/factory_spec.rb # spec/lib/gitlab/ci/config/entry/global_spec.rb # spec/lib/gitlab/ci/config/entry/job_spec.rb # spec/lib/gitlab/ci/status/build/factory_spec.rb # spec/lib/gitlab/incoming_email_spec.rb
* Revert "Prefer leading style for Style/DotPosition"Douwe Maan2017-02-2313-38/+38
| | | | This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
* Manually correct autocorrectDouwe Maan2017-02-231-2/+2
|
* Prefer leading style for Style/DotPositionDouwe Maan2017-02-2313-38/+38
|
* Enable Style/ColonMethodCallDouwe Maan2017-02-231-3/+3
|
* Enable Style/DotPositionDouwe Maan2017-02-238-21/+21
|
* Add user deletion permission check in `Users::DestroyService`sh-delete-user-permission-checkStan Hu2017-02-201-0/+2
| | | | | | | | | We saw from a recent incident that the `Users::DestroyService` would attempt to delete a user over and over. Revoking the permissions from the current user did not help. We should ensure that the current user does, in fact, have permissions to delete the user. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch 'zj-drop-ruby-21-tests' into 'master' Rémy Coutable2017-02-131-1/+1
|\ | | | | | | | | Update Rubocop to Ruby 2.3 See merge request !8994
| * Update Rubocop to ruby 2.3zj-drop-ruby-21-testsZ.J. van de Weg2017-02-071-1/+1
| |
* | Fix inconsistent naming for services that delete thingsdixpac2017-02-082-2/+2
| | | | | | | | | | | | * Changed name of delete_user_service and worker to destroy * Move and change delete_group_service to Groups::DestroyService * Rename Notes::DeleteService to Notes::DestroyService
* | Merge branch 'master' into jej-pages-picked-from-eeJames Edwards-Jones2017-02-031-2/+4
|\ \ | |/
| * Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2017-01-264-2/+32
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix-git-hooks-when-creating-file * upstream/master: (1122 commits) Update CHANGELOG.md for 8.16.2 Display project ID in project settings (!8572) fixed points from comments to improve code quality Update CHANGELOG.md for 8.14.8 Statisfy eslint Add CHANGELOG entry Fix access to the wiki code via HTTP when repository feature disabled Display fullscreen button on small screens (!5302) Prevent removing fields from dropdowns on input elements fix for all themes Return struct instead of multiple values Fix race conditions for AuthorizedProjectsWorker Add User#nested_groups and User#nested_projects methods Fix spec failure due to timestamp ordering issue in mySQL Fixed error with filter keyboard tests `can?` already includes the `feature_available?` check Test there is no Merge Request button when MRs are disabled Ensure the correct Merge Request button is found Add 409 conflict tests Add CHANGELOG ...
| * | Prefer leading dots over trailing dotsLin Jen-Shin2017-01-051-4/+4
| | |
| * | Merge branch 'master' into fix-git-hooks-when-creating-fileLin Jen-Shin2017-01-043-32/+28
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (1031 commits) Add changelog entry for renaming API param [ci skip] Add missing milestone parameter Refactor issues filter in API Fix project hooks params Gitlab::LDAP::Person uses LDAP attributes configuration Don't delete files from spec/fixtures Copy, don't move uploaded avatar files Minor improvements to changelog docs Rename logo, apply for Slack too Fix Gemfile.lock for the octokit update Fix cross-project references copy to include the project reference Add logo in public files Use stable icon for Mattermost integration rewrite the item.respond_to?(:x?) && item.x? to item.try(:x?) API: extern_uid is a string Increases pipeline graph drowdown width in order to prevent strange position on chrome on ubuntu Removed bottom padding from merge manually from CLI because of repositioning award emoji's Make haml_lint happy Improve spec Add feature tests for Cycle Analytics ...
| * \ \ Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-12-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix-git-hooks-when-creating-file * upstream/master: (116 commits) adds impersonator variable and makes sudo usage overall more clear Reenables /user API request to return private-token if user is admin and requested with sudo Fix Backup::Manager#remove_old Allow public access to some Tag API endpoints Update outdated visible content spec descriptions Grapify the issues API new DevOps report, 404s, typos Remove dashboard.scss Update custom_hooks.md for global custom hooks and chained hook info Move admin hooks spinach to rspec Move admin logs spinach test to rspec Fix 404 error when visit group label edit page A simpler implementation of finding a merge request Encourage bug reporters to mention if they use GitLab.com [ci skip] Bump gitlab-shell version to 4.0.3 Remove confirmation.scss Explain "js: true" in "deleted_source_branch_spec.rb" [ci skip] Move award emojis to framwork Move image styles to framework Remove tags.scss ...
| * | | | Introduce Repository#with_tmp_ref which we needLin Jen-Shin2016-12-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | commits from the other repository. We'll cleanup the tmp ref after we're done with our business.
* | | | | Initial work on GitLab Pages updateKamil Trzcinski2017-01-311-1/+5
| | | | |
* | | | | Move most of PagesWorker logic UpdatePagesServiceKamil Trzcinski2017-01-311-131/+2
| | | | |
* | | | | Asynchronously remove pagesKamil Trzcinski2017-01-311-1/+10
| | | | |
* | | | | Rename pages namespace or project path when changedKamil Trzcinski2017-01-311-4/+0
| | | | | | | | | | | | | | | | | | | | - Move UploadsTransfer to ProjectTransfer and inherit from this to UploadsTransfer and PagesTransfer
* | | | | Revert "Store pages in shared/pages/fqdn/fqdn/public or ↵Kamil Trzcinski2017-01-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shared/pages/fqdn/subpath/public - makes it simpler to implement CNAMEs in future" This reverts commit 86a2a78f0d13a678899460638add6b862059433e.
* | | | | Store pages in shared/pages/fqdn/fqdn/public or ↵Kamil Trzcinski2017-01-311-4/+0
| | | | | | | | | | | | | | | | | | | | shared/pages/fqdn/subpath/public - makes it simpler to implement CNAMEs in future
* | | | | Fix testsKamil Trzcinski2017-01-311-5/+11
| | | | |
* | | | | Split PagesWorkerKamil Trzcinski2017-01-311-40/+61
| | | | |
* | | | | Remove locking and add force to FileUtils methodsKamil Trzcinski2017-01-311-20/+12
| | | | |
* | | | | Fix specsKamil Trzcinski2017-01-311-1/+2
| | | | |
* | | | | Add GitLab PagesKamil Trzcinski2017-01-311-0/+123
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The pages are created when build artifacts for `pages` job are uploaded - Pages serve the content under: http://group.pages.domain.com/project - Pages can be used to serve the group page, special project named as host: group.pages.domain.com - User can provide own 403 and 404 error pages by creating 403.html and 404.html in group page project - Pages can be explicitly removed from the project by clicking Remove Pages in Project Settings - The size of pages is limited by Application Setting: max pages size, which limits the maximum size of unpacked archive (default: 100MB) - The public/ is extracted from artifacts and content is served as static pages - Pages asynchronous worker use `dd` to limit the unpacked tar size - Pages needs to be explicitly enabled and domain needs to be specified in gitlab.yml - Pages are part of backups - Pages notify the deployment status using Commit Status API - Pages use a new sidekiq queue: pages - Pages use a separate nginx config which needs to be explicitly added
* | | | Fix race conditions for AuthorizedProjectsWorkerrefresh-authorizations-fork-joinYorick Peterse2017-01-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two cases that could be problematic: 1. Because sometimes AuthorizedProjectsWorker would be scheduled in a transaction it was possible for a job to run/complete before a COMMIT; resulting in it either producing an error, or producing no new data. 2. When scheduling jobs the code would not wait until completion. This could lead to a user creating a project and then immediately trying to push to it. Usually this will work fine, but given enough load it might take a few seconds before a user has access. The first one is problematic, the second one is mostly just annoying (but annoying enough to warrant a solution). This commit changes two things to deal with this: 1. Sidekiq scheduling now takes places after a COMMIT, this is ensured by scheduling using Rails' after_commit hook instead of doing so in an arbitrary method. 2. When scheduling jobs the calling thread now waits for all jobs to complete. Solution 2 requires tracking of job completions. Sidekiq provides a way to find a job by its ID, but this involves scanning over the entire queue; something that is very in-efficient for large queues. As such a more efficient solution is necessary. There are two main Gems that can do this in a more efficient manner: * sidekiq-status * sidekiq_status No, this is not a joke. Both Gems do a similar thing (but slightly different), and the only difference in their name is a dash vs an underscore. Both Gems however provide far more than just checking if a job has been completed, and both have their problems. sidekiq-status does not appear to be actively maintained, with the last release being in 2015. It also has some issues during testing as API calls are not stubbed in any way. sidekiq_status on the other hand does not appear to be very popular, and introduces a similar amount of code. Because of this I opted to write a simple home grown solution. After all, all we need is storing a job ID somewhere so we can efficiently look it up; we don't need extra web UIs (as provided by sidekiq-status) or complex APIs to update progress, etc. This is where Gitlab::SidekiqStatus comes in handy. This namespace contains some code used for tracking, removing, and looking up job IDs; all without having to scan over an entire queue. Data is removed explicitly, but also expires automatically just in case. Using this API we can now schedule jobs in a fork-join like manner: we schedule the jobs in Sidekiq, process them in parallel, then wait for completion. By using Sidekiq we can leverage all the benefits such as being able to scale across multiple cores and hosts, retrying failed jobs, etc. The one downside is that we need to make sure we can deal with unexpected increases in job processing timings. To deal with this the class Gitlab::JobWaiter (used for waiting for jobs to complete) will only wait a number of seconds (30 by default). Once this timeout is reached it will simply return. For GitLab.com almost all AuthorizedProjectWorker jobs complete in seconds, only very rarely do we spike to job timings of around a minute. These in turn seem to be the result of external factors (e.g. deploys), in which case a user is most likely not able to use the system anyway. In short, this new solution should ensure that jobs are processed properly and that in almost all cases a user has access to their resources whenever they need to have access.
* | | | Merge remote-tracking branch 'origin/master' into 21698-redis-runner-last-buildKamil Trzcinski2017-01-194-32/+41
|\ \ \ \
| * | | | Merge branch '24185-legacy-ci-status-reactive-cache' into 'security'Robert Speicher2017-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use ReactiveCaching to update external CI status asynchronously See https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2055
| * | | | Record and show last used date of SSH KeysVincent Wong2017-01-091-0/+13
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Addresses: Issue #13810 1. Adds a last_used_at attribute to the Key table/model 2. Update a key's last_used_at whenever it gets used 3. Display how long ago an ssh key was last used
| * | | Add more storage statisticsMarkus Koller2016-12-211-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds counters for build artifacts and LFS objects, and moves the preexisting repository_size and commit_count from the projects table into a new project_statistics table. The counters are displayed in the administration area for projects and groups, and also available through the API for admins (on */all) and normal users (on */owned) The statistics are updated through ProjectCacheWorker, which can now do more granular updates with the new :statistics argument.
| * | | Merge branch 'project-authorizations-diff' into 'master' Nick Thomas2016-12-201-21/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Smarter refreshing of authorized projects This MR reworks the way `User#refresh_authorized_projects`, resulting in a much more efficient process leading to fewer dead tuples. Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/25257 See merge request !7956
| | * | | Smarter refreshing of authorized projectsproject-authorizations-diffYorick Peterse2016-12-191-21/+1
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit the refreshing of authorized projects was done in two steps: 1. Remove existing authorizations 2. Insert a new list of all authorizations This can lead to a high amount of dead tuples as every time all rows are being replaced. For example, if a user with 100 authorizations is given access to a new project this would lead to: * 100 rows being removed * 101 new rows being inserted This commit changes the way this system works so it only removes/inserts what is necessary. Using the above example this would lead to only 1 new row being inserted, with the initial 100 being left untouched. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/25257
| * | | Add a ReactiveCaching concern for use in the KubernetesServiceNick Thomas2016-12-191-0/+15
| |/ /
* | | Fixed broken buildKim "BKC" Carlbäcker2016-12-211-1/+1
| | |
* | | #NamingThingsKim "BKC" Carlbäcker2016-12-161-2/+1
| | |
* | | Update Runners in a ServiceKim "BKC" Carlbäcker2016-12-151-15/+1
| | |
* | | Use correct variablesKim "BKC" Carlbäcker2016-12-141-1/+1
| | |
* | | typo-oKim "BKC" Carlbäcker2016-12-141-1/+1
| | |
* | | This is needed as well...Kim "BKC" Carlbäcker2016-12-141-1/+8
| | |
* | | Add BuildQueueWorker for injecting redis-keysKim "BKC" Carlbäcker2016-12-141-0/+18
|/ /
* | Merge branch 'fix/rename-mwbs-to-merge-when-pipeline-succeeds' into 'master' Kamil Trzciński2016-12-051-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename MWBS service to Merge When Pipeline Succeeds ## What does this MR do? This MR renames Merge When Build Succeeds feature to Merge When Pipeline Succeeds, because we recently changed the behavior, see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6675. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] All builds are passing ## What are the relevant issue numbers? Closes #23354 See merge request !7135
| * Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeedsGrzegorz Bizon2016-11-301-2/+21
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (110 commits) Rewrite an HTTP link to use HTTPS Edit /spec/features/profiles/preferences_spec.rb to match changes in 084d90ac Add blue back to sub nav active Remove JSX/React eslint plugins. Fix a transient spec failure Adds hoverstates for collapsed Issue/Merge Request sidebar Moved groups above projects Add StackProf to the Gemfile, along with a utility to get a profile for a spec Update Sidekiq-cron to fix compatibility issues with Sidekiq 4.2.1 Add a CHANGELOG entry Alert user when logged in user email is not the same as the invitation Expose timestamp in build entity used by serializer Rename `MergeRequest#pipeline` to `head_pipeline` Remove unnecessary database indexes CE-specific changes gitlab-org/gitlab-ee#1137 Fixing typo & Clarifying Key name fix started_at check fix blob controller spec failure - updated not to use file-path- fix blob controller spec failure Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' ... Conflicts: app/controllers/projects/merge_requests_controller.rb lib/api/merge_requests.rb spec/requests/api/merge_requests_spec.rb
| * \ Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeedsGrzegorz Bizon2016-11-252-36/+22
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (312 commits) Fix bad selection on dropdown menu for tags filter Fixed issue boards scrolling with a lot of lists & issues You can only assign default_branch when editing a project ... Don't convert data which already is the target type Stop supporting Google and Azure as backup strategies renames some of the specs and adds changelog entry Fixed dragging issue moving wrong issue after multiple drags of issue Fixed issue boards issue sorting when dragging issue into list Rephrase some system notes to be compatible with new system note style Add missing JIRA file that redirects to the new location Fix documentation to create the `pg_trm` extension before creating the DB Document that we always use `do...end` for `before` in RSpec Backport Note#commands_changes from EE Log mv_namespace parameters Add default_branch attr to Project API payload in docs. Fix title case to sentence case properly escape username validation error message flash Remove header ids from University docs Add missing documentation. Added test that checks the correct select box is there for the LFS ... ... Conflicts: app/services/system_note_service.rb spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb spec/services/system_note_service_spec.rb
| * | | Rename MWBS service to Merge When Pipeline SucceedsGrzegorz Bizon2016-11-211-1/+1
| | | |
* | | | Pass commit data to ProcessCommitWorkerprocess-commit-worker-improvementsYorick Peterse2016-12-011-9/+16
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | By passing commit data to this worker we remove the need for querying the Git repository for every job. This in turn reduces the time spent processing each job. The migration included migrates jobs from the old format to the new format. For this to work properly it requires downtime as otherwise workers may start producing errors until they're using a newer version of the worker code.
* | | Refresh project authorizations using a Redis leaserefresh-authorizations-with-leaseYorick Peterse2016-11-251-2/+21
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I proposed using serializable transactions I was hoping we would be able to refresh data of individual users concurrently. Unfortunately upon closer inspection it was revealed this was not the case. This could result in a lot of queries failing due to serialization errors, overloading the database in the process (given enough workers trying to update the target table). To work around this we're now using a Redis lease that is cancelled upon completion. This ensures we can update the data of different users concurrently without overloading the database. The code will try to obtain the lease until it succeeds, waiting at least 1 second between retries. This is necessary as we may otherwise end up _not_ updating the data which is not an option.
* | Merge branch 'preserve-second-parameter-new-note-worker' into 'master' Sean McGivern2016-11-221-1/+3
|\ \ | | | | | | | | | | | | | | | | | | Preserve optional second parameter in NewNoteWorker jobs Closes #24678 See merge request !7602
| * | Preserve optional second parameter in NewNoteWorker jobspreserve-second-parameter-new-note-workerStan Hu2016-11-191-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | If there are any old or retries in the Sidekiq queue, NewNoteWorker will fail with the error: wrong number of arguments (given 2, expected 1) This change allows the optional second argument to be used to preserve backwards compatibility. It can be removed later. Closes #24678