Commit Graph

1296 Commits

Author SHA1 Message Date
Rémy Coutable b355ebc4c9 Merge branch 'jej/fix-protected-branch-validations-ce' into 'master'
Fix ProtectedBranch access level validations

See merge request gitlab-org/gitlab-ce!15586
2017-11-24 16:16:31 +00:00
James Edwards-Jones 96106287db Deduplicate protected ref human_access_levels
Previously these were duplicated so they could be different for push/merge,
but this was no longer necessary after
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11232
2017-11-24 13:47:03 +00:00
Markus Koller 257fd57134 Allow password authentication to be disabled entirely 2017-11-23 13:16:14 +00:00
Jacob Vosmaer (GitLab) 4cfcc97544 Fix encoding bugs in Gitlab::Git::User 2017-11-23 10:48:57 +00:00
Clement Ho 5083e0cf70 Merge branch '40295-fix-reply-quote-shortcut-on-mr' into 'master'
Fix reply quote keyboard shortcut on MRs

Closes #40295

See merge request gitlab-org/gitlab-ce!15523
2017-11-22 17:11:25 +00:00
Rémy Coutable c4de6ec496 Merge branch 'improve-extra-queries-output' into 'master'
Improve output for extra queries in specs

See merge request gitlab-org/gitlab-ce!15537
2017-11-22 16:33:10 +00:00
Sean McGivern db1925f917 Improve output for extra queries in specs
Previously, this used `Array#-`, which would remove all queries that matches the
query text in the original set.

However, sometimes we have a problem with parameterised queries, where the query
text is identical both times, so we'd run a query N times instead of once, and
it would be hidden from the output.

Replace the logic to only remove a given query N times from the actual log,
where N is the number of times it appears in the expected log.
2017-11-22 15:08:55 +00:00
Stan Hu 52b6cbcb9d Add QUERY_RECORDER_DEBUG environment variable to improve performance debugging 2017-11-21 21:32:56 -08:00
Eric Eastwood 59502122bd Fix reply quote keyboard shortcut on MRs
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/40295
2017-11-21 14:27:16 -06:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Kim "BKC" Carlbäcker 6545e56d92 we need to disable gitaly for some tests 2017-11-14 22:35:27 +01:00
Douwe Maan 20ac30a705 Merge branch '36099-api-responses-missing-x-content-type-options-header' into '10-1-stable'
Include X-Content-Type-Options (XCTO) header into API responses

See merge request gitlab/gitlabhq!2211

(cherry picked from commit 6c818e77f2)

e087e075 Include X-Content-Type-Options (XCTO) header into API responses
2017-11-08 20:11:18 -08:00
Douwe Maan 92249f1ac8 Merge branch 'github-importer-refactor' into 'master'
Rewrite the GitHub importer to perform work in parallel and greatly improve performance

Closes #33135, #38621, and #39361

See merge request gitlab-org/gitlab-ce!14731
2017-11-08 11:52:39 +00:00
Yorick Peterse 4dfe26cd8b
Rewrite the GitHub importer from scratch
Prior to this MR there were two GitHub related importers:

* Github::Import: the main importer used for GitHub projects
* Gitlab::GithubImport: importer that's somewhat confusingly used for
  importing Gitea projects (apparently they have a compatible API)

This MR renames the Gitea importer to Gitlab::LegacyGithubImport and
introduces a new GitHub importer in the Gitlab::GithubImport namespace.
This new GitHub importer uses Sidekiq for importing multiple resources
in parallel, though it also has the ability to import data sequentially
should this be necessary.

The new code is spread across the following directories:

* lib/gitlab/github_import: this directory contains most of the importer
  code such as the classes used for importing resources.
* app/workers/gitlab/github_import: this directory contains the Sidekiq
  workers, most of which simply use the code from the directory above.
* app/workers/concerns/gitlab/github_import: this directory provides a
  few modules that are included in every GitHub importer worker.

== Stages

The import work is divided into separate stages, with each stage
importing a specific set of data. Stages will schedule the work that
needs to be performed, followed by scheduling a job for the
"AdvanceStageWorker" worker. This worker will periodically check if all
work is completed and schedule the next stage if this is the case. If
work is not yet completed this worker will reschedule itself.

Using this approach we don't have to block threads by calling `sleep()`,
as doing so for large projects could block the thread from doing any
work for many hours.

== Retrying Work

Workers will reschedule themselves whenever necessary. For example,
hitting the GitHub API's rate limit will result in jobs rescheduling
themselves. These jobs are not processed until the rate limit has been
reset.

== User Lookups

Part of the importing process involves looking up user details in the
GitHub API so we can map them to GitLab users. The old importer used
an in-memory cache, but this obviously doesn't work when the work is
spread across different threads.

The new importer uses a Redis cache and makes sure we only perform
API/database calls if absolutely necessary.  Frequently used keys are
refreshed, and lookup misses are also cached; removing the need for
performing API/database calls if we know we don't have the data we're
looking for.

== Performance & Models

The new importer in various places uses raw INSERT statements (as
generated by `Gitlab::Database.bulk_insert`) instead of using Rails
models. This allows us to bypass any validations and callbacks,
drastically reducing the number of SQL queries and Gitaly RPC calls
necessary to import projects.

To ensure the code produces valid data the corresponding tests check if
the produced rows are valid according to the model validation rules.
2017-11-07 23:24:59 +01:00
Bob Van Landuyt 414c4e3fd8 Add helper methods to redirect legacy paths 2017-11-07 19:52:09 +01:00
Rémy Coutable 3a8cf27674 Merge branch 'fix-comments-spec' into 'master'
Fix merge_request_spec

See merge request gitlab-org/gitlab-ce!15250
2017-11-07 18:49:59 +00:00
Annabel Dunstone Gray a2e2b11cf5
Fix merge_request_spec 2017-11-07 10:27:20 -07:00
Shinya Maeda 4fac95a64d Merge branch 'master' into 38464-k8s-apps 2017-11-08 01:46:53 +09:00
Kamil Trzciński ad526918d3 Merge branch 'fix/gb/ensure-that-job-belongs-to-stage' into 'master'
Make sure that every job has a stage assigned

Closes #37979

See merge request gitlab-org/gitlab-ce!14724
2017-11-07 12:52:52 +00:00
Shinya Maeda bbdb0cf051 Merge branch 'master' into 38464-k8s-apps 2017-11-07 21:23:54 +09:00
Rémy Coutable 31e3ef93e5 Merge branch 'feature/custom-attributes-on-projects-and-groups' into 'master'
Support custom attributes on groups and projects

See merge request gitlab-org/gitlab-ce!14593
2017-11-07 10:59:38 +00:00
Shinya Maeda dab3075a36 Merge branch 'master' into 38464-k8s-apps 2017-11-07 16:52:55 +09:00
Shinya Maeda a99ad59e65 Remove 10.3 comments (Tracked by a tech debts issue). Refactor spec factory name. Use ArgumentError 2017-11-06 23:06:10 +09:00
Grzegorz Bizon 772d3b1b4d Fix cycle analytics specs 2017-11-06 11:36:11 +01:00
Markus Koller 6902848a9c
Support custom attributes on projects 2017-11-06 10:51:46 +01:00
Shinya Maeda b737282ac7 Merge branch 'master' into refactor-clusters 2017-11-05 19:36:12 +09:00
Mike Greiling 72157766a2
Merge branch 'master' into sh-headless-chrome-support
* master: (33 commits)
  Ignore SQL CACHE hits in Sherlock
  Fix SQL timings for the performance bar
  Find the LFS-objects for a fork within a the fork network
  Remove bottom-border from last responsive table row
  Add system hooks user_rename and group_rename
  Unlink a project from a fork network when it's source was deleted.
  Make sure the settings page renders when root of a fork is deleted
  Remove Peek's original keyboard shortcut (numpad 0, keycode 96)
  Add application setting to Auto DevOps docs
  Enable MergeableSelector in scss-lint (for !14567)
  Enable MergeableSelector in scss-lint (for !14055)
  Enable MergeableSelector in scss-lint (for !14062)
  Enable MergeableSelector in scss-lint (for !14398)
  Enable MergeableSelector in scss-lint (for !13480)
  Enable MergeableSelector in scss-lint (for !13473)
  Enable MergeableSelector in scss-lint (for !13600)
  Enable MergeableSelector in scss-lint
  Resolve ""To do" should be "Todos" on Todos list page"
  Avoid regenerating the ref path for the environment
  Remove white space at bottom of issue boards
  ...
2017-11-03 14:02:52 -05:00
Alessio Caiazza c0299ce494
Add Projects::Clusters::ApplicationsController tests 2017-11-03 16:40:13 +01:00
Douwe Maan e19f54ca41 Merge branch 'bvl-unlink-fixes' into 'master'
This fixes some bugs related to forked projects of which the source was deleted.

Closes #39667

See merge request gitlab-org/gitlab-ce!15150
2017-11-03 15:33:53 +00:00
Bob Van Landuyt 0f1d6402b9 Find the LFS-objects for a fork within a the fork network 2017-11-03 14:59:47 +01:00
Shinya Maeda 6ebe6792de Merge branch 'master' into refactor-clusters 2017-11-03 16:41:50 +09:00
Mike Greiling 11c21e953f
Merge branch 'master' into sh-headless-chrome-support
* master: (109 commits)
  Remove Filesystem check metrics that use too much CPU to handle requests
  Set merge_request_diff_id on MR when creating
  Add a column linking an MR to its diff
  Remove useless closeReopenReport specs
  Clarify external artifacts only working when GitLab pages is enabled
  Send SIGSTP before SIGTERM to actually give Sidekiq jobs 30s to finish when the memory killer kicks in
  Remove an exception from the git user default SSH config check
  Geo route whitelisting is too optimistic
  Update .nvmrc to current stable (v9.0.0)
  Update documentation
  Address Douwe's feedback
  Refactor responsive table styles to support nested error block
  Add changelog items
  Update specs for sudo behavior
  Move RSS and incoming email tokens from User Settings > Accounts to User Settings > Access Tokens
  Remove user authentication_token column
  Migrate user private tokens to personal access tokens
  Add sudo API scope
  Consistently use PersonalAccessToken instead of PersonalToken
  Remove User#private_token
  ...
2017-11-02 17:05:06 -05:00
Mike Greiling ed3b23fec9
refactor wait_for_requests, add slow_requests block helper 2017-11-02 16:36:36 -05:00
Shinya Maeda 3602c0b987 Fix some tests 2017-11-03 03:37:32 +09:00
Sean McGivern 56dccc2e10 Merge branch 'dm-remove-private-token' into 'master'
Remove Private Tokens

Closes #38595 and #38447

See merge request gitlab-org/gitlab-ce!14838
2017-11-02 15:25:42 +00:00
Douwe Maan 4d6830ec50 Merge branch 'patch-28' into 'master'
Add debugging section to testing_guide/best_practices.md.

See merge request gitlab-org/gitlab-ce!14858
2017-11-02 11:58:54 +00:00
Rémy Coutable 0364e07447
Address Douwe's feedback
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-11-02 12:02:51 +01:00
Douwe Maan 294fa6fcdc Remove authentication using user.private_token 2017-11-02 11:39:02 +01:00
Douwe Maan fbdf057898 Remove private_token from API user entity 2017-11-02 11:39:01 +01:00
Kim Carlbäcker d6066870cc Fix encoding issue with Repository.ls_files 2017-11-02 08:29:03 +00:00
Shinya Maeda a41fb7b229 Merge branch 'master' into refactor-clusters 2017-11-02 16:12:41 +09:00
Mike Greiling 8a0455f2ea
remove unused capybara_select2 helper 2017-11-01 16:16:59 -05:00
Mike Greiling fcba23561a
add spacing around yield 2017-11-01 16:15:16 -05:00
Mike Greiling 3f3875dbf9
make window resizing more resiliant on small screens when headless mode is off 2017-11-01 14:04:24 -05:00
Mike Greiling 2304550b43
fix flaky fill_in use in which return key would occasionally be intercepted by autocomplete 2017-11-01 14:03:53 -05:00
Mike Greiling 9d9affdca3
move resize option the pre-test hooks instead of post-test 2017-11-01 12:17:13 -05:00
Mike Greiling 1d85dbc979
reset browser window size between tests 2017-11-01 11:01:33 -05:00
Shinya Maeda 6571efb6c3 Fix spec. Fix usage ping. Fix warnings by adding new models and attributes. 2017-11-01 16:12:44 +09:00
Shinya Maeda ef3ebed6d3 Merge branch 'master' into refactor-clusters 2017-11-01 15:42:57 +09:00
Ahmad Sherif 56e53556c5 Migrate Gitlab::Git::Wiki#file to Gitaly
Closes gitaly#689
2017-10-31 20:49:41 +02:00