summaryrefslogtreecommitdiff
path: root/lib/gitlab
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'zj-migrate-gitlab-project-rm-mv' into 'master'Douwe Maan2018-01-102-34/+18
|\ | | | | | | | | | | | | Migrate GitlabProject (re)move project endpoints Closes gitaly#873 See merge request gitlab-org/gitlab-ce!16249
| * Migrate GitlabProject (re)move project endpointsZeger-Jan van de Weg2018-01-092-34/+18
| | | | | | | | | | | | | | | | | | Migration is done through a small refactoring, which makes us call endpoins which are performing the same actions for namespaces. Tests are added to ensure only the project is removed that should be removed. Closes gitlab-org/gitaly#873
* | Merge branch 'fix/use-mirror-refmaps-instead-mirror-refmap' into 'master'Sean McGivern2018-01-101-3/+5
|\ \ | | | | | | | | | | | | | | | | | | Add support for multiple refmaps to RemoteService#add_remote Closes gitaly#903 See merge request gitlab-org/gitlab-ce!16331
| * | Add support for multiple refmaps to RemoteService#add_remotefix/use-mirror-refmaps-instead-mirror-refmapAhmad Sherif2018-01-091-3/+5
| | | | | | | | | | | | Closes gitaly#903
* | | Fix hooks not being set up properly for bare import Rake tasksh-fix-bare-import-hooksStan Hu2018-01-091-0/+1
|/ / | | | | | | Closes #41739
* | Merge branch 'jej/backport-authorized-keys-to-ce' into 'master'Douwe Maan2018-01-092-2/+91
|\ \ | | | | | | | | | | | | | | | | | | Backport authorized_keys Closes gitlab-ee#3953 See merge request gitlab-org/gitlab-ce!16014
| * | Make Gitlab::CurrentSettings available when getting settingsSean McGivern2018-01-081-8/+8
| | |
| * | Backport authorized_keys_enabled defaults to true'Michael Kozono2018-01-081-2/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally from branch 'fix-authorized-keys-enabled-default-2738' via merge request https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2240 Removed background migrations which were intended to fix state after using Gitlab without a default having been set Squashed commits: Locally, if Spring was not restarted, `current_application_settings` was still cached, which prevented the migration from editing the file. This will also ensure that any app server somehow hitting old cache data will properly default this setting regardless. Retroactively fix migration This allows us to identify customers who ran the broken migration. Their `authorized_keys_enabled` column does not have a default at this point. We will fix the column after we fix the `authorized_keys` file. Fix authorized_keys file if needed Add default to authorized_keys_enabled setting Reminder: The original migration was fixed retroactively a few commits ago, so people who did not ever run GitLab 9.3.0 already have a column that defaults to true and disallows nulls. I have tested on PostgreSQL and MySQL that it is safe to run this migration regardless. Affected customers who did run 9.3.0 are the ones who need this migration to fix the authorized_keys_enabled column. The reason for the retroactive fix plus this migration is that it allows us to run a migration in between to fix the authorized_keys file only for those who ran 9.3.0. Tweaks to address feedback Extract work into background migration Move batch-add-logic to background migration Do the work synchronously to avoid multiple workers attempting to add batches of keys at the same time. Also, make the delete portion wait until after adding is done. Do read and delete work in background migration Fix Rubocop offenses Add changelog entry Inform the user of actions taken or not taken Prevent unnecessary `select`s and `remove_key`s Add logs for action taken Fix optimization Reuse `Gitlab::ShellAdapter` Guarantee the earliest key Fix migration spec for MySQL
| * | Backport option to disable writing to `authorized_keys` fileMichael Kozono2018-01-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally branch 'mk-toggle-writing-to-auth-keys-1631' See merge request !2004 Squashed commits: Add authorized_keys_enabled to Application Settings Ensure default settings are exposed in UI Without this change, `authorized_keys_enabled` is unchecked when it is nil, even if it should be checked by default. Add “Speed up SSH operations” documentation Clarify the reasons for disabling writes Add "How to go back" section Tweak copy Update Application Setting screenshot
| * | Backport authorized_keys branch 'find-key-by-fingerprint'Pablo Carranza2018-01-081-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add find key by base64 key or fingerprint to the internal API See merge request !250 Squashed changes: Add unique index to fingerprint Add new index to schema Add internal api to get ssh key by fingerprint Change API endpoint to authorized_keys Add InsecureKeyFingerprint that calculates the fingerprint without shelling out Add require for gitlab key fingerprint Remove uniqueness of fingerprint index Remove unique option from migration Fix spec style in fingerprint test Fix rubocop complain Extract insecure key fingerprint to separate file Change migration to support building index concurrently Remove those hideous tabs
* | | Merge branch 'check-environment-regex-ce' into 'master'Grzegorz Bizon2018-01-091-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Backport "Fix environment scope regex" to CE Closes gitlab-ee#4308 See merge request gitlab-org/gitlab-ce!15945
| * | | Merge branch 'check-environment-regex' into 'master'Grzegorz Bizon2018-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix environment scope regex See merge request gitlab-org/gitlab-ee!3641
* | | | Save user ID and username in Grape API log (api_json.log)sh-store-user-in-api-logsStan Hu2018-01-081-0/+18
| |_|/ |/| | | | | | | | | | | | | | This will enable admins to identify who actually made the API request. Relates to #36960
* | | Merge branch '41683-timeout-is-not-set-for-gitaly-fetch_remote-calls' into ↵Stan Hu2018-01-082-3/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Resolve "Timeout is not set for gitaly fetch_remote calls" Closes #41683 See merge request gitlab-org/gitlab-ce!16245
| * | | Pass timeout to RepositoryService.FetchRemote Gitaly RPC calls41683-timeout-is-not-set-for-gitaly-fetch_remote-callsAlejandro Rodríguez2018-01-052-3/+6
| | | |
* | | | Merge branch 'delay-background-migrations' into 'master'Rémy Coutable2018-01-082-0/+17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run background migrations with a minimum interval Closes #41624 See merge request gitlab-org/gitlab-ce!16230
| * | | | 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 'remove-commit-tree' into 'master'Sean McGivern2018-01-082-4/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Remove the Commit#tree method See merge request gitlab-org/gitlab-ce!16236
| * | | | Remove the Commit#tree methodremove-commit-treeJacob Vosmaer2018-01-042-4/+7
| | | | |
* | | | | Merge branch 'gitaly-fetch-internal-remote' into 'master'Sean McGivern2018-01-082-13/+26
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | Incorporate RemoteService.FetchInternalRemote Gitaly RPC Closes gitaly#857 See merge request gitlab-org/gitlab-ce!16140
| * | | | Incorporate RemoteService.FetchInternalRemote Gitaly RPCgitaly-fetch-internal-remoteAlejandro Rodríguez2018-01-052-13/+26
| | | | |
* | | | | Merge branch 'fix/gb/fix-import-export-restoring-associations' into 'master'Kamil Trzciński2018-01-073-8/+16
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix restoring associations with import/export Closes #41646 See merge request gitlab-org/gitlab-ce!16221
| * \ \ \ \ Merge branch 'master' into fix/gb/fix-import-export-restoring-associationsGrzegorz Bizon2018-01-0622-145/+623
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | * master: (114 commits)
| * | | | | | Bump import/export version to 2.2.0Grzegorz Bizon2018-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to bump import/export version because we introduced a new object's hierarchy that is not backwards compatible.
| * | | | | | Assign stage and pipeline to a status when importingGrzegorz Bizon2018-01-052-7/+15
| | | | | | |
* | | | | | | Fix error 500 when viewing commit and merge request diffsStan Hu2018-01-071-1/+1
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the refactoring in !16082, `Blob#batch` no longer falls back to a default `blob_size_limit`. Since `Repository#batch_blobs` was using a default `nil` value, this would cause issues in the `Blob#find_by_rugged` method. This fix here is to be consistent and use a non-nil default value in `Repository#batch_blobs`. The problem was masked in development and tests because Gitaly is always enabled by default for all features. Closes #41735
* | | | | | Move git operations for multi_action into Gitlab::GitAlejandro Rodríguez2018-01-052-0/+48
| |_|_|_|/ |/| | | |
* | | | | Use --left-right and --max-count for counting diverging commitsLin Jen-Shin (godfat)2018-01-051-7/+68
| |_|_|/ |/| | |
* | | | 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