summaryrefslogtreecommitdiff
path: root/lib/gitlab
Commit message (Collapse)AuthorAgeFilesLines
* Run background migrations with a minimum intervaldelay-background-migrationsYorick Peterse2018-01-052-0/+17
| | | | | | | | | | | | | | | This adds a minimum interval to BackgroundMigrationWorker, ensuring background migrations of the same class only run once every 5 minutes. This prevents a thundering herd problem where scheduled migrations all run at once due to their delays having been expired (e.g. as the result of a queue being paused for a long time). If a job was recently executed it's rescheduled with a delay that equals the remaining time of the job's lease. This means that if the lease expires in two minutes we only need to wait two minutes, instead of five. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/41624
* Merge branch 'ban-disk-import' into 'master'Sean McGivern2018-01-053-1/+10
|\ | | | | | | | | Don't use Gitlab::Shell#import_repository on local paths See merge request gitlab-org/gitlab-ce!16228
| * rubocopban-disk-importJacob Vosmaer2018-01-041-1/+1
| |
| * Hide hooks stuffJacob Vosmaer2018-01-042-3/+2
| |
| * get it workingJacob Vosmaer2018-01-043-1/+11
| |
* | Allow local tests to use a modified GitalyJacob Vosmaer (GitLab)2018-01-051-0/+61
| |
* | Merge branch 'zj-blob-batch' into 'master'Douwe Maan2018-01-051-6/+25
|\ \ | | | | | | | | | | | | Reroute batch blobs to single blob RPC See merge request gitlab-org/gitlab-ce!16082
| * | Fix typos in a code commentZeger-Jan van de Weg2018-01-051-2/+2
| | |
| * | Reroute batch blobs to single blob RPCZeger-Jan van de Weg2018-01-021-6/+25
| | | | | | | | | | | | | | | | | | | | | Given the priorities shifted for the Gitaly team, this endpoint does not get a dedicated endpoint yet. To make it work in a cloud native environment the request needs to go to Gitaly, not rugged. This is achieved by rerouting to the generic TreeEntry endpoint.
* | | Merge branch 'fix/prepare-rebase-to-be-migrated-to-gitaly' into 'master'Sean McGivern2018-01-052-1/+13
|\ \ \ | | | | | | | | | | | | | | | | Prepare Gitlab::Git::Repository#rebase for Gitaly migration See merge request gitlab-org/gitlab-ce!16192
| * | | Prepare Gitlab::Git::Repository#rebase for Gitaly migrationfix/prepare-rebase-to-be-migrated-to-gitalyAhmad Sherif2018-01-042-1/+13
| | | |
* | | | Merge branch 'gitaly-annotations-20180104' into 'master'Sean McGivern2018-01-051-9/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Update some Gitaly annotations in Gitlab::Shell See merge request gitlab-org/gitlab-ce!16226
| * | | | Update some Gitaly annotations in Gitlab::Shellgitaly-annotations-20180104Jacob Vosmaer2018-01-041-9/+4
| | |_|/ | |/| |
* | | | Merge branch 'ldap_username_attributes' into 'master'Douwe Maan2018-01-053-8/+32
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify `LDAP::Person` to return username value based on attributes Closes #39691 See merge request gitlab-org/gitlab-ce!15286
| * | | | Modify `LDAP::Person` to return username value based on attributesDrew Blessing2018-01-043-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Gitlab::LDAP::Person` did not respect the LDAP attributes username configuration and would simply return the uid value. There are cases where users would like to specify a different username field to allow more friendly GitLab usernames. For example, it's common in AD to have sAMAccountName be an employee ID like `A12345` while the local part of the email address is more human-friendly.
* | | | | Fix a bug where charlock_holmes was used needlessly to encode strings41677-branch-name-omitted-due-to-bad-utf-8-conversion-by-gitaly-ref-handlerAlejandro Rodríguez2018-01-042-11/+17
| | | | |
* | | | | Merge branch ↵Douwe Maan2018-01-041-8/+23
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '41468-error-500-trying-to-view-a-merge-request-json-undefined-method-binary-for-nil-nilclass' into 'master' Resolve "Error 500 trying to view a merge request JSON: undefined method `binary?' for nil:NilClass" Closes #41468 See merge request gitlab-org/gitlab-ce!16193
| * | | | | Fix error when viewing diffs without blobs41468-error-500-trying-to-view-a-merge-request-json-undefined-method-binary-for-nil-nilclassSean McGivern2018-01-041-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old merge requests can have diffs without corresponding blobs. (This also may be possible for commit diffs in corrupt repositories.) We can't use the `&.` operator on the blobs, because the blob objects are never nil, but `BatchLoader` instances that delegate to `Blob`. We can't use `Object#try`, because `Blob` doesn't inherit from `Object`. `BatchLoader` provides a `__sync` method that returns the delegated object, but using `itself` also works because it's forwarded, and will work for non-`BatchLoader` instances too. So the simplest solution is to just use that with the `&.` operator.
* | | | | | Merge branch 'ce-gitaly-remote-mirror-prep' into 'master'Dmitriy Zaporozhets2018-01-043-42/+105
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | [CE] Move git operations for UpdateRemoteMirrorService into Gitlab::Git See merge request gitlab-org/gitlab-ce!16023
| * | | | | | Move git operations for UpdateRemoteMirrorService into Gitlab::Gitce-gitaly-remote-mirror-prepAlejandro Rodríguez2018-01-031-0/+75
| | | | | | |
| * | | | | | Move delete_remote_branches from Gitlab::Shell to Gitlab::Git::RepositoryAlejandro Rodríguez2018-01-032-20/+12
| | | | | | |
| * | | | | | Move push_remote_branches from Gitlab::Shell to Gitlab::Git::RepositoryAlejandro Rodríguez2018-01-032-22/+18
| | | | | | |
* | | | | | | Merge branch 'mk-no-op-delete-conflicting-redirects' into 'master'Douwe Maan2018-01-041-34/+2
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | Prevent excessive DB load due to faulty DeleteConflictingRedirectRoutes background migration See merge request gitlab-org/gitlab-ce!16205
| * | | | | | Make DeleteConflictingRedirectRoutes no-opmk-no-op-delete-conflicting-redirectsMichael Kozono2018-01-031-34/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Both the post-deploy and background migration.
* | | | | | | Merge branch 'sh-validate-path-project-import' into 'master'Yorick Peterse2018-01-041-8/+8
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | Avoid leaving a push event empty if payload cannot be created See merge request gitlab-org/gitlab-ce!16214
| * | | | | | Avoid leaving a push event empty if payload cannot be createdsh-validate-path-project-importStan Hu2018-01-031-8/+8
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the payload cannot be created for some reason, we could be left with a nil push event payload, which causes Error 500s when viewing the dashboard. Guard against this error and log when it happens. Avoids problems seen in #38823
* | | | | | Merge branch 'gitaly-merge-nil' into 'master'Sean McGivern2018-01-041-0/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle Gitaly aborted merge due to branch update Closes gitaly#854 See merge request gitlab-org/gitlab-ce!16116
| * | | | | | Fix method lookupJacob Vosmaer2018-01-031-1/+3
| | | | | | |
| * | | | | | Handle Gitaly aborted merge due to branch updateJacob Vosmaer2018-01-031-0/+1
| | | | | | |
* | | | | | | Merge branch 'feature/add-max-count-to-count-commits-rpc' into 'master'Rémy Coutable2018-01-042-0/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for max_count option to Git::Repository#count_commits See merge request gitlab-org/gitlab-ce!16145
| * | | | | | | Add support for max_count option to Git::Repository#count_commitsfeature/add-max-count-to-count-commits-rpcAhmad Sherif2017-12-272-0/+2
| | | | | | | |
* | | | | | | | Merge branch 'change-issues-closed-at-background-migration' into 'master'Sean McGivern2018-01-043-10/+204
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a background migration for migrating issues.closed_at See merge request gitlab-org/gitlab-ce!16083
| * | | | | | | | Use a background migration for issues.closed_atchange-issues-closed-at-background-migrationYorick Peterse2018-01-033-10/+204
| | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a previous attempt (rolled back in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16021) we tried to migrate `issues.closed_at` from timestamp to timestamptz using a regular migration. This has a bad impact on GitLab.com and as such was rolled back. This commit re-implements the original migrations using generic background migrations, allowing us to still migrate the data in a single release but without a negative impact on availability. To ensure the database schema is up to date the background migrations are performed inline in development and test environments. We also make sure to not migrate that that doesn't need migrating in the first place or has already been migrated.
* | | | | | | | Merge branch 'osw-introduce-merge-request-statistics' into 'master'Sean McGivern2018-01-041-0/+135
|\ \ \ \ \ \ \ \ | |_|_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | Improve closed/merged events queries performance on Projects::MergeRequestsController#show.json See merge request gitlab-org/gitlab-ce!15642
| * | | | | | | Cache merged and closed events data in merge_request_metrics tableOswaldo Ferreira2018-01-021-0/+135
| |/ / / / / /
* | | | | | | fix issue #37843Danny2018-01-031-1/+1
| | | | | | |
* | | | | | | Fix Repository#processable? to allow .git repos in the root folderDouglas Barbosa Alexandre2018-01-031-1/+2
| | | | | | |
* | | | | | | Refactoring Project#write_repository_configDouglas Barbosa Alexandre2018-01-031-5/+2
| | | | | | |
* | | | | | | Import directory tree created with hashed storage using import rake taskDouglas Barbosa Alexandre2018-01-032-12/+33
| |_|_|/ / / |/| | | | |
* | | | | | Merge branch 'sh-optimize-commit-stats' into 'master'Robert Speicher2018-01-031-7/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speed up generation of commit stats by using Rugged native methods See merge request gitlab-org/gitlab-ce!16186
| * | | | | | Speed up generation of commit stats by using Rugged native methodssh-optimize-commit-statsStan Hu2018-01-021-7/+2
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation iterated across the entire patch set to determine the number of lines added, deleted, and changed. Rugged has a native method `Rugged::Diff#stat` that does this already, which appears to be a little faster and require less RAM than doing this ourselves. Improves performance in #41524
* | | | | | Merge branch 'migrate-fork-repo-to-gitaly' into 'master'Robert Speicher2018-01-033-16/+68
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate repo forking to Gitaly Closes gitaly#825 See merge request gitlab-org/gitlab-ce!16018
| * | | | | | Migrate repo forking to Gitalymigrate-fork-repo-to-gitalyAhmad Sherif2018-01-023-16/+68
| | |_|/ / / | |/| | | | | | | | | | | | | | | | Closes gitaly#825
* | | | | | Merge branch 'sh-fix-seed-fu-ci' into 'master'Robert Speicher2018-01-031-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix `rake db:seed_fu` not doing anything in CI Closes #41517 See merge request gitlab-org/gitlab-ce!16146
| * | | | | | Fix `rake db:seed_fu` not doing anything in CIsh-fix-seed-fu-ciStan Hu2018-01-021-1/+1
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default behavior of seed_fu is to load the fixtures using the RAILS_ENV environment. In CI, since we set RAILS_ENV=test, nothing is ever loaded. Instead of `rake db:seed_fu`, use `rake gitlab:setup`, which sets up MySQL properly with limits. Closes #41517
* | | | | | Merge branch '41424-gitlab-rake-gitlab-import-repos-schedules-an-import' ↵Douwe Maan2018-01-032-1/+3
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 'master' Resolve "gitlab-rake gitlab:import:repos schedules an import" Closes #41424 See merge request gitlab-org/gitlab-ce!16115
| * | | | | add note to import sourcesJames Lopez2018-01-031-0/+1
| | | | | |
| * | | | | refactor code to use new import typeJames Lopez2018-01-031-2/+1
| | | | | |
| * | | | | fix missing create services callJames Lopez2018-01-021-2/+0
| | | | | |
| * | | | | fix wiki checkJames Lopez2018-01-021-0/+2
| | | | | |