Commit Graph

3716 Commits

Author SHA1 Message Date
Ahmad Sherif 2290b438f4 Fix rubocop offenses introduced in !16623 2018-01-25 20:44:16 +01:00
Robert Speicher af95ba2fb4 Merge branch 'feature/migrate-repo-restorer-to-gitaly' into 'master'
Migrate restoring repo from bundle to Gitaly

Closes gitaly#946

See merge request gitlab-org/gitlab-ce!16623
2018-01-25 19:03:51 +00:00
Rémy Coutable 26c4dea7ad Merge branch 'lint-rugged' into 'master'
Add a lint check to restrict use of Rugged

See merge request gitlab-org/gitlab-ce!16656
2018-01-25 17:52:01 +00:00
Grzegorz Bizon 9df130ff22 Merge branch 'fix/batch-lfs-pointers-accepting-lazy-enum' into 'master'
Fix .batch_lfs_pointers accepting a lazy enumerator

See merge request gitlab-org/gitlab-ce!16701
2018-01-25 14:28:48 +00:00
Ahmad Sherif 07b0beb004 Fix .batch_lfs_pointers accepting a lazy enumerator 2018-01-25 14:11:27 +01:00
Jacob Vosmaer 6d6f7536bd Look for rugged with static analysis 2018-01-25 14:05:11 +01:00
Douwe Maan eab9ffeff6 Merge branch 'revert-430b3f0e' into 'master'
Revert "Merge branch 'remove-rugged-walk' into 'master'"

See merge request gitlab-org/gitlab-ce!16676
2018-01-25 11:15:07 +00:00
Rémy Coutable d2bf53942f Merge branch 'jej/gitattributes-check-at-ref' into 'master'
Can parse root .gitattributes file for a ref

See merge request gitlab-org/gitlab-ce!16418
2018-01-25 11:01:36 +00:00
Jacob Vosmaer (GitLab) 7363aa0b9d Revert "Merge branch 'remove-rugged-walk' into 'master'"
This reverts merge request !16525
2018-01-25 11:03:29 +01:00
Rémy Coutable 567b3826a9 Merge branch '42161-gitaly-commitservice-encoding-undefinedconversionerror-u-c124-from-utf-8-to-ascii-8bit' into 'master'
Resolve "Gitaly::CommitService: Encoding::UndefinedConversionError: U+C124 from UTF-8 to ASCII-8BIT"

Closes #42161

See merge request gitlab-org/gitlab-ce!16637
2018-01-25 09:16:18 +00:00
Stan Hu 8671261309 Add a gRPC health check to ensure Gitaly is up
This will enable Geo to skip shards that not operational.

Relates to gitlab-org/gitlab-ee#4329
2018-01-24 15:47:27 -08:00
Yorick Peterse a349a4269c Merge branch 'search-100' into 'master'
Use limit for search count queries

See merge request gitlab-org/gitlab-ce!16502
2018-01-24 20:21:40 +00:00
Robert Speicher f35bac576d Merge branch '40744-idempotent-ids' into 'master'
Use the DatabaseCleaner 'deletion' strategy instead of 'truncation'

Closes #30783

See merge request gitlab-org/gitlab-ce!16516
2018-01-24 19:29:57 +00:00
Ahmad Sherif 29fa930baf Migrate .batch_lfs_pointers to Gitaly
Closes gitaly#921
2018-01-24 19:02:51 +01:00
Ahmad Sherif 6a28967c14 Migrate restoring repo from bundle to Gitaly
Closes gitaly#946
2018-01-24 19:02:32 +01:00
Nick Thomas 93ea3234df
Use the DatabaseCleaner 'deletion' strategy instead of 'truncation' 2018-01-24 17:25:55 +00:00
Ahmad Sherif 24625323a8 Migrate repository bundling to Gitaly
Closes gitaly#929
2018-01-24 12:10:31 +01:00
James Edwards-Jones 0683d31ab1 Can parse root .gitattributes file for a ref 2018-01-24 05:15:37 +00:00
Jan Provaznik 090ca9c33e Use limit for search count queries
Search query is especially slow if a user searches a generic string
which matches many records, in such case search can take tens of
seconds or time out. To speed up the search query, we search only for
first 1000 records, if there is >1000 matching records we just display
"1000+" instead of precise total count supposing that with such amount
the exact count is not so important for the user.

Because for issues even limited search was not fast enough, 2-phase
approach is used for issues: first we use simpler/faster query to get
all public issues, if this exceeds the limit, we just return the limit.
If the amount of matching results is lower than limit, we re-run more
complex search query (which includes also confidential issues).
Re-running the complex query should be fast enough in such case because the
amount of matching issues is lower than limit.

Because exact total_count is now limited, this patch also switches to
to "prev/next" pagination.

Related #40540
2018-01-23 22:33:42 +01:00
Rémy Coutable d8eb961d0b
Fix a migration spec messing up the MergeRequestDiff DB schema
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-01-23 17:42:37 +01:00
Rémy Coutable ae1358e483 Merge branch 'gitaly-update-remote-mirror' into 'master'
Incorporate Gitaly's RemoteService.UpdateRemoteMirror RPC

Closes gitaly#936

See merge request gitlab-org/gitlab-ce!16536
2018-01-23 09:35:29 +00:00
Douwe Maan 09fc32173f Merge branch 'gitaly-user-commit-files' into 'master'
Incorporate Gitaly's OperationService.UserCommitFiles RPC

Closes gitaly#890

See merge request gitlab-org/gitlab-ce!16307
2018-01-23 09:34:59 +00:00
Lin Jen-Shin b33e7281ff Make sure we're passing ASCII-8BIT to Gitaly
when counting commit count.
2018-01-23 16:27:34 +08:00
Stan Hu c2c6ce076a Merge branch 'add-profiler-to-application' into 'master'
Add Gitlab::Profiler for profiling from a console or runner

See merge request gitlab-org/gitlab-ce!16552
2018-01-22 18:49:28 +00:00
Alejandro Rodríguez d86751d842 Incorporate Gitaly's RemoteService.UpdateRemoteMirror RPC 2018-01-22 13:51:02 -03:00
Stan Hu b9c537487f Fix Error 500 when repository has no avatar
Closes #42249
2018-01-20 21:00:39 -08:00
Alejandro Rodríguez 081a584a35 Ensure hooks are deleted regardless of the project forking method 2018-01-19 13:57:17 -03:00
Sean McGivern b16c0080ac Add Gitlab::Profiler for profiling from a console or runner
Gitlab::Profiler.profile takes a URL to profile, and returns the ruby-prof
profile result.

This is currently only for interactive use (in a console) or from the script
runner. Note that when using this interactively, changes to the application
within that console session will be used, so this can be used to test proposed
performance changes.
2018-01-19 12:31:54 +00:00
Douwe Maan 792e9ed7fa Merge branch 'background-migration-fix' into 'master'
Reduce UPDATEs for background column type changes

Closes #42158

See merge request gitlab-org/gitlab-ce!16551
2018-01-18 18:10:38 +00:00
Sean McGivern d7c7061a9c Merge branch 'gitaly-commit-signature' into 'master'
Retrieve commit signatures with Gitaly

Closes gitaly#923

See merge request gitlab-org/gitlab-ce!16467
2018-01-18 14:12:41 +00:00
Jacob Vosmaer (GitLab) 4d87f3bb37 Retrieve commit signatures with Gitaly 2018-01-18 14:10:17 +00:00
Jacob Vosmaer (GitLab) fa52038731 Remove Rugged::Walker from Repository#log 2018-01-18 14:05:14 +00:00
Yorick Peterse 0054d3838c
Reduce UPDATEs for background column type changes
Prior to this commit we would essentially update all rows in a table,
even those where the source column (e.g. `issues.closed_at`) was NULL.
This in turn could lead to statement timeouts when using the default
batch size of 10 000 rows per job.

To work around this we don't schedule jobs for rows where the source
value is NULL. We also don't update rows where the source column is NULL
(as an extra precaution) or the target column already has a non-NULL
value. Using this approach it should be possible to update 10 000 rows
in the "issues" table in about 7.5 - 8 seconds.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/42158
2018-01-18 14:22:41 +01:00
Oswaldo Ferreira f351cc28c2 Merge branch 'sh-backport-10-3-4-security-fixes' into 'master'
Backport 10.3.4 security fixes into master

See merge request gitlab-org/gitlab-ce!16509
2018-01-17 20:26:59 +00:00
Oswaldo Ferreira d1eb3ff594 Make ruby lint happy 2018-01-17 11:42:32 -02:00
Jacob Vosmaer (GitLab) f4de7309ab Remove unused methods from Gitlab::Git 2018-01-17 09:54:27 +00:00
Grzegorz Bizon ceb2a76876 Merge branch 'fix/gb/improve-manual-action-tooltips' into 'master'
Fix running manual action tooltip

Closes #41418

See merge request gitlab-org/gitlab-ce!16489
2018-01-17 08:03:09 +00:00
James Lopez 532a0b6018 Merge branch 'fix/import-rce-10-3' into 'security-10-3'
[10.3] Fix RCE via project import mechanism

See merge request gitlab/gitlabhq!2294

(cherry picked from commit dcfec507d6f9ee119d65a832393e7c593af1d3b2)

86d75812 Fix RCE via project import mechanism
2018-01-16 17:04:51 -08:00
Robert Speicher 791ca43f3f Merge branch '41293-fix-command-injection-vulnerability-on-system_hook_push-queue-through-web-hook' into 'security-10-3'
Don't allow line breaks on HTTP headers

See merge request gitlab/gitlabhq!2277

(cherry picked from commit 7fc0a6fc096768a5604d6dd24d7d952e53300c82)

073b8f9c Don't allow line breaks on HTTP headers
2018-01-16 17:04:51 -08:00
Douwe Maan 536a47b4b7 Merge branch 'sh-migrate-can-push-to-deploy-keys-projects-10-3' into 'security-10-3'
[10.3] Migrate `can_push` column from `keys` to `deploy_keys_project`

See merge request gitlab/gitlabhq!2276

(cherry picked from commit f6ca52d31bac350a23938e0aebf717c767b4710c)

1f2bd3c0 Backport to 10.3
2018-01-16 17:04:51 -08:00
Robert Speicher 954a44574f Merge branch 'ac/fix-path-traversal' into 'security-10-3'
[10.3] Fix path traversal in gitlab-ci.yml cache:key

See merge request gitlab/gitlabhq!2270

(cherry picked from commit c32d0c6807dfd41d7838a35742e6d0986871b389)

df29094a Fix path traversal in gitlab-ci.yml cache:key
2018-01-16 17:04:38 -08:00
Robert Speicher 72a57525a8 Merge branch 'ac/41346-xss-ci-job-output' into 'security-10-3'
[10.3] Fix XSS vulnerability in Pipeline job trace

See merge request gitlab/gitlabhq!2258

(cherry picked from commit 44caa80ed9a2514a74a5eeab10ff51849d64851b)

5f86f3ff Fix XSS vulnerability in Pipeline job trace
2018-01-16 17:04:38 -08:00
Stan Hu 3228ac06a0 Merge branch 'jej/lfs-rev-list-handles-non-utf-paths-41627' into 'master'
Prevent RevList failing on non utf8 paths

Closes #41627

See merge request gitlab-org/gitlab-ce!16440
2018-01-16 20:47:17 +00:00
Rémy Coutable a7d172625a Merge branch '41666-cannot-search-with-keyword-merge' into 'master'
Resolve "Cannot search with keyword "merge""

Closes #41666

See merge request gitlab-org/gitlab-ce!16462
2018-01-16 14:24:36 +00:00
James Edwards-Jones c4dd7b8296 Prevent RevList failing on non utf8 paths 2018-01-16 13:27:59 +00:00
Sean McGivern 82f4564fb7 Fix project search results for digits surrounded by colons
A file containing /:\d+:/ in its contents would break the search results if
those contents were part of the results, because we were splitting on colons,
which can't work with untrusted input.

Changing to use the null byte as a separator is much safer.
2018-01-16 11:56:07 +00:00
Grzegorz Bizon c0e9a46dd5 Fix running manual action tooltip 2018-01-16 12:22:09 +01:00
Sean McGivern 9fd6440d4a Prevent background migration spec from polluting later models
If the schema changes after 20171114162227 for any of these models, and specs
after this one use factories, then those factories will use the models with
outdated column information cached.

We shouldn't really use factories in migration specs, but this is a special case
because there is a lot of git-related setup code in the model that would be
painful to copy to the migration. Instead, we just manually reset the column
information for the models we could pollute.
2018-01-16 10:58:07 +00:00
Rémy Coutable 9e70ff345f Merge branch '1819-override-ce' into 'master'
CE: Override module to specify that we're overriding

See merge request gitlab-org/gitlab-ce!16131
2018-01-15 18:16:21 +00:00
Robert Speicher 15ef5d6694 Merge branch 'feature/migrate-import-repository-to-gitaly' into 'master'
Migrate importing repository to Gitaly

Closes gitaly#907

See merge request gitlab-org/gitlab-ce!16431
2018-01-15 16:59:06 +00:00
Mayra Cabrera 1827f398ad Resolve "Managed Prometheus deployment installs a lot of extra stuff" 2018-01-15 16:27:58 +00:00
Ahmad Sherif 49d6ed9ded Migrate importing repository to Gitaly
Closes gitaly#907
2018-01-15 14:15:54 +01:00
Francisco Javier López 4f6e0379b4 Fixing request json mime type 2018-01-15 09:09:21 +00:00
Douwe Maan 5e3ef30259 Merge branch 'sh-log-when-user-blocked' into 'master'
Log and send a system hook if a blocked user attempts to login

Closes #41633

See merge request gitlab-org/gitlab-ce!16451
2018-01-15 08:53:31 +00:00
Grzegorz Bizon 6277ef8e28 Merge branch 'feature/migrate-can-be-merged-to-gitaly' into 'master'
Migrate Repository#can_be_merged? to Gitaly

Closes gitaly#893

See merge request gitlab-org/gitlab-ce!16316
2018-01-15 08:10:30 +00:00
Stan Hu 0d187a9a65 Log and send a system hook if a blocked user fails to login
Closes #41633
2018-01-14 22:22:06 -08:00
Lin Jen-Shin cfd75101d1 Merge remote-tracking branch 'upstream/master' into 1819-override-ce
* upstream/master: (621 commits)
  Add a note about GitLab QA page objects validator to docs
  Refactor dispatcher projects blame and blob path
  Update export message to mention we can download the file from the UI
  Fix Ctrl+Enter keyboard shortcut saving comment/note edit
  fix case where tooltip messes up :last-child selector
  Add reason to keep postgresql 9.2 for CI
  Remove warning noise in ProjectImportOptions
  Add changelog entry
  Add RedirectRoute factory
  Update Ingress extra cost note to be more generic
  Fix Rubocop offense
  Refactor dispatcher project branches path
  Revert "Revert "Fix Route validation for unchanged path""
  Document that we need rsync for backing up
  Docs: move article "Laravel and Envoy w/ CI/CD"
  Recommend against the use of EFS
  Adds Rubocop rule for line break around conditionals
  Update CHANGELOG.md for 10.1.6
  Filter out build traces from logged parameters
  Refactored project:n* imports in dispatcher.js
  ...
2018-01-12 19:43:38 +08:00
Douwe Maan 7acabf7c59 Merge branch 'remove-soft-removals' into 'master'
Remove soft removals related code

Closes #37447

See merge request gitlab-org/gitlab-ce!15789
2018-01-11 16:06:01 +00:00
Ahmad Sherif b4b267b739 Migrate Repository#can_be_merged? to Gitaly 2018-01-11 16:40:13 +01:00
Rémy Coutable ccb3fe1f42 Merge branch 'feature/migrate-merged-branch-names-to-gitaly' into 'master'
Migrate merged_branch_names to Gitaly

Closes gitaly#851

See merge request gitlab-org/gitlab-ce!16157
2018-01-11 15:22:49 +00:00
Sean McGivern 27732df371 Merge branch 'option-disable-archive-cache' into 'master'
Add option to disable git archive caching in workhorse

See merge request gitlab-org/gitlab-ce!16325
2018-01-11 15:00:07 +00:00
Ahmad Sherif 831019412f Migrate merged_branch_names to Gitaly
Closes gitaly#851
2018-01-11 14:52:15 +01:00
Yorick Peterse 0a51eae586 Merge branch '38068-commits-count' into 'master'
Resolve "Store the number of merge request commits in merge_request_diffs.commits_count"

Closes #38068

See merge request gitlab-org/gitlab-ce!16164
2018-01-11 12:39:23 +00:00
Jan Provaznik e6a1db6d9e Denormalize commits count for merge request diffs
For each MR diff an extra 'SELECT COUNT()' is executed
to get number of commits for the diff. Overall time to get counts for
all MR diffs may be quite expensive. To speed up loading of MR info,
information about number of commits is stored in a MR diff's extra column.

Closes #38068
2018-01-10 20:40:02 +01:00
Douwe Maan ed2c9797e1 Merge branch 'zj-migrate-gitlab-project-rm-mv' into 'master'
Migrate GitlabProject (re)move project endpoints

Closes gitaly#873

See merge request gitlab-org/gitlab-ce!16249
2018-01-10 10:09:57 +00:00
Stan Hu 35d3411f77 Fix hooks not being set up properly for bare import Rake task
Closes #41739
2018-01-09 23:39:19 -08:00
Zeger-Jan van de Weg 58e17bf3b0
Migrate GitlabProject (re)move project endpoints
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
2018-01-09 19:23:18 +01:00
Jacob Vosmaer d805cd3606 Add option to disable git archive caching in workhorse 2018-01-09 16:59:46 +01:00
Douwe Maan 2e4a1b3b78 Merge branch 'jej/backport-authorized-keys-to-ce' into 'master'
Backport authorized_keys

Closes gitlab-ee#3953

See merge request gitlab-org/gitlab-ce!16014
2018-01-09 11:21:23 +00:00
Grzegorz Bizon a04ef4db58 Merge branch 'check-environment-regex-ce' into 'master'
Backport "Fix environment scope regex" to CE

Closes gitlab-ee#4308

See merge request gitlab-org/gitlab-ce!15945
2018-01-09 09:03:43 +00:00
Stan Hu bd50ecbad8 Merge branch '41683-timeout-is-not-set-for-gitaly-fetch_remote-calls' into 'master'
Resolve "Timeout is not set for gitaly fetch_remote calls"

Closes #41683

See merge request gitlab-org/gitlab-ce!16245
2018-01-08 22:24:03 +00:00
James Edwards-Jones bd9ead683c Fix spec in shell_spec.rb
The spec for "#add_key does nothing" would always have passed,
since the expectation was on both the wrong object and message.
2018-01-08 20:34:38 +00:00
Valery Sizov d9557e43e4 Backport spec fixes in spec/lib/gitlab/shell_spec.rb 2018-01-08 20:34:37 +00:00
Michael Kozono 797fe0a6e6 Backport authorized_keys_enabled defaults to true'
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
2018-01-08 20:34:20 +00:00
Michael Kozono 255a0f85e3 Backport option to disable writing to `authorized_keys` file
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
2018-01-08 20:34:19 +00:00
Pablo Carranza ac86b2043d Backport authorized_keys branch 'find-key-by-fingerprint'
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
2018-01-08 20:34:16 +00:00
Yorick Peterse d0b8f536a1
Remove soft removals related code
This removes all usage of soft removals except for the "pending delete"
system implemented for projects. This in turn simplifies all the query
plans of the models that used soft removals. Since we don't really use
soft removals for anything useful there's no point in keeping it around.

This _does_ mean that hard removals of issues (which only admins can do
if I'm not mistaken) can influence the "iid" values, but that code is
broken to begin with. More on this (and how to fix it) can be found in
https://gitlab.com/gitlab-org/gitlab-ce/issues/31114.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37447
2018-01-08 17:04:45 +01:00
Rémy Coutable 8ff0c9b151 Merge branch 'delay-background-migrations' into 'master'
Run background migrations with a minimum interval

Closes #41624

See merge request gitlab-org/gitlab-ce!16230
2018-01-08 13:06:49 +00:00
Sean McGivern 3013951c73 Merge branch 'remove-commit-tree' into 'master'
Remove the Commit#tree method

See merge request gitlab-org/gitlab-ce!16236
2018-01-08 11:31:10 +00:00
Sean McGivern d42c0ecc02 Merge branch 'gitaly-fetch-internal-remote' into 'master'
Incorporate RemoteService.FetchInternalRemote Gitaly RPC

Closes gitaly#857

See merge request gitlab-org/gitlab-ce!16140
2018-01-08 10:42:35 +00:00
Shinya Maeda c519e4a728 Add spec 2018-01-08 17:18:04 +09:00
Kamil Trzciński df48758c69 Merge branch 'fix/gb/fix-import-export-restoring-associations' into 'master'
Fix restoring associations with import/export

Closes #41646

See merge request gitlab-org/gitlab-ce!16221
2018-01-07 16:02:40 +00:00
Stan Hu c2b7147c2f Fix error 500 when viewing commit and merge request diffs
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
2018-01-07 04:49:07 -08:00
Kamil Trzciński 54bacb1860 Merge branch '22643-manual-job-page' into 'master'
Resolve "Improve non-triggered manual action job detail page"

Closes #22643 and #37843

See merge request gitlab-org/gitlab-ce!15991
2018-01-06 14:40:45 +00:00
Grzegorz Bizon 6e6f2313aa Merge branch 'master' into fix/gb/fix-import-export-restoring-associations
* master: (114 commits)
2018-01-06 08:36:26 +01:00
Alejandro Rodríguez 15ddfa2b5b Pass timeout to RepositoryService.FetchRemote Gitaly RPC calls 2018-01-05 18:27:00 -03:00
Alejandro Rodríguez 9ff44c2986 Incorporate RemoteService.FetchInternalRemote Gitaly RPC 2018-01-05 15:45:24 -03:00
Matija Čupić d66c48b303
Merge branch 'master' into 41249-clearing-the-cache 2018-01-05 18:21:45 +01:00
Lin Jen-Shin (godfat) 33c5630b02 Use --left-right and --max-count for counting diverging commits 2018-01-05 16:52:06 +00:00
Sean McGivern b72af2b9c7 Merge branch 'ce-backport=reorder-issues' into 'master'
CE Backport of reordering issues in epics

See merge request gitlab-org/gitlab-ce!16247
2018-01-05 16:26:06 +00:00
Yorick Peterse 7f30bb9c29
Run background migrations with a minimum interval
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
2018-01-05 16:23:25 +01:00
Grzegorz Bizon 7e117b4c9d Assert on correctly restoring pipelines after an import 2018-01-05 15:38:56 +01:00
Grzegorz Bizon adc9e13d27 Fix import/export project tree saver specs 2018-01-05 15:19:05 +01:00
Grzegorz Bizon 05ddb25995 Assign stage and pipeline to a status when importing 2018-01-05 14:48:50 +01:00
Jarka Kadlecová 153ea18301 Refactor matchers for background migrations 2018-01-05 13:40:31 +01:00
Filipa Lacerda f0c4fbea1c Merge branch 'master' into 22643-manual-job-page
* master: (24 commits)
  Allow local tests to use a modified Gitaly
  Update check.md
  add deprecation and removal issue to docs
  Add status attribute to runner api entity
  Fix typos in a code comment
  Just try to detect and assign once
  Modify `LDAP::Person` to return username value based on attributes
  Create Kubernetes based on Application Templates
  Fix a bug where charlock_holmes was used needlessly to encode strings
  Ignore the Migration/Datetime cop in a migration that fix a column type to datetime_with_timezone
  Use `__` instead of `s__` when context is not required
  Enclose props in quotes
  Update some Gitaly annotations in Gitlab::Shell
  Prepare Gitlab::Git::Repository#rebase for Gitaly migration
  add missing changelog
  refactor spec, add docs
  deprecate check integrity task
  add lock specs
  add locks chek
  remove max-depth flag so it works with subgroups
  ...
2018-01-05 11:37:06 +00:00
Douwe Maan 3bb68efb7a Merge branch 'zj-blob-batch' into 'master'
Reroute batch blobs to single blob RPC

See merge request gitlab-org/gitlab-ce!16082
2018-01-05 10:47:28 +00:00
Douwe Maan 4dbf32d109 Merge branch 'ldap_username_attributes' into 'master'
Modify `LDAP::Person` to return username value based on attributes

Closes #39691

See merge request gitlab-org/gitlab-ce!15286
2018-01-05 09:22:40 +00:00
Matija Čupić b27b1e60f0
Rename cache_index in safe_model_attributes 2018-01-05 01:46:52 +01:00
Drew Blessing 7d1fdcdc83 Modify `LDAP::Person` to return username value based on attributes
`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.
2018-01-04 17:10:40 -06:00