Commit Graph

4058 Commits

Author SHA1 Message Date
Felipe Artur aefefbf117 Prevents position update for image diff notes 2017-11-13 16:40:54 -02:00
Rémy Coutable 2e13dafbe8 Merge branch '39602-move-update-project-counter-caches-out-of-issues-merge-requests' into 'master'
Move update_project_counter_caches? out of issue and merge request

Closes #39602

See merge request gitlab-org/gitlab-ce!15300
2017-11-13 12:44:52 +00:00
George Andrinopoulos 3963f91ee3 Move update_project_counter_caches? out of issue and merge request 2017-11-11 21:06:28 +02:00
George Andrinopoulos 46cacbe5cf Add feature test to milestone 2017-11-11 16:47:39 +02:00
George Andrinopoulos 561693ad17 Move total time spend calculation to milestoneish 2017-11-11 16:47:39 +02:00
George Andrinopoulos f39fe4d8db Add total time spent to milestones 2017-11-11 16:47:39 +02:00
Douwe Maan 2fbbba9a29 Always return full avatar URL for private/internal groups/projects when asset host is set 2017-11-09 15:40:41 +00: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
Douwe Maan de614b0e1a Merge branch 'bvl-free-paths' into 'master'
Free some reserved group routes

See merge request gitlab-org/gitlab-ce!15052
2017-11-08 08:41:56 +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
Yorick Peterse 44be82dd18
Refactor User.find_by_any_email
By using SQL::Union we can return a proper ActiveRecord::Relation,
making it possible to select the columns we're interested in (instead of
all of them).
2017-11-07 22:28:52 +01:00
Bob Van Landuyt 58d1d6a5c7 Free up some group reserved words 2017-11-07 19:52:09 +01:00
Kamil Trzcinski e957ea4ae1 Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce into add-ingress-to-cluster-applications 2017-11-07 17:54:03 +01:00
Kamil Trzcinski 1625adf5ba Make ingress to use install_command 2017-11-07 17:49:27 +01:00
Shinya Maeda 4fac95a64d Merge branch 'master' into 38464-k8s-apps 2017-11-08 01:46:53 +09:00
Kamil Trzcinski c42786021c Merge remote-tracking branch 'origin/38464-k8s-apps' into add-ingress-to-cluster-applications 2017-11-07 17:35:55 +01:00
Alessio Caiazza 8ec618a6ed Add Helm InstallCommand 2017-11-07 17:12:41 +01:00
Kamil Trzcinski 389c9bfc51 Add specs for ingress 2017-11-07 15:10:40 +01:00
Kamil Trzcinski 760a154a03 Fix tests for initial status 2017-11-07 14:52:11 +01:00
Alessio Caiazza 16b9e289fd Do not use RSpec.describe 2017-11-07 14:05:58 +01: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
Kamil Trzciński 5c136f1d71 Merge branch '39649-change-default-size-for-gke-cluster-creation' into 'master'
Resolve "Change default size for GKE cluster creation"

Closes #39649

See merge request gitlab-org/gitlab-ce!15220
2017-11-07 12:52:20 +00:00
Shinya Maeda bbdb0cf051 Merge branch 'master' into 38464-k8s-apps 2017-11-07 21:23:54 +09:00
Rémy Coutable 4338823416 Merge branch '39791-when-reopening-an-issue-the-mattermost-notification-has-no-context-to-the-issue' into 'master'
Resolve "When reopening an issue the Mattermost Notification has no context to the issue"

Closes #39791

See merge request gitlab-org/gitlab-ce!15218
2017-11-07 11:35:26 +00: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
Alessio Caiazza f9364929ba Rename application_helm factory to cluster_application_helm 2017-11-07 10:10:57 +01:00
bikebilly 8d7fbd09dc Change new occurrencies of n1-default-4 2017-11-07 09:46:04 +01:00
Shinya Maeda dab3075a36 Merge branch 'master' into 38464-k8s-apps 2017-11-07 16:52:55 +09:00
Grzegorz Bizon c71cf908cd Merge branch 'refactor-clusters' into 'master'
Refactor Clusters to be consisted from GcpProvider and KubernetesPlatform

See merge request gitlab-org/gitlab-ce!14879
2017-11-06 21:21:27 +00:00
Sean McGivern 045795d0d9 Merge branch 'remove-ensure-ref-fetched-from-controllers' into 'master'
removed the #ensure_ref_fetched from all controllers

Closes #36061

See merge request gitlab-org/gitlab-ce!15129
2017-11-06 17:10:18 +00:00
Sean McGivern ad118080cf Merge branch 'dm-block-group-and-project-creation-when-external-by-default' into 'master'
Make sure group and project creation is blocked for new users that are external by default

Closes #39664

See merge request gitlab-org/gitlab-ce!15212
2017-11-06 15:48:08 +00:00
micael.bergeron d934d6504a updated the ignore_column concern to support multiple columns
This method is an ActiveRecord extension and it should behave
like one. I expected this to work.
2017-11-06 10:20:20 -05:00
Sean McGivern ef2c5e321d Merge branch 'dm-reallow-project-path-ending-in-period' into 'master'
Reallow project paths ending in periods

Closes #39695

See merge request gitlab-org/gitlab-ce!15190
2017-11-06 14:58:14 +00:00
Sean McGivern 5e7d68ef79 Fix issue reopen Mattermost / Slack message
When an issue is reopened, the action is 'reopen', but the state is 'opened' (as
we don't have a separate 'reopened' state any more).

Because we checked the action in one method and the state in another, this lead
to a weird case where the mesage neither linked to the issue, nor contained an
attachment with its details. Just checking the action is fine, as it's the most
granular.
2017-11-06 14:40:13 +00:00
micael.bergeron 5ab3ed7a9a align with the comments 2017-11-06 09:23:41 -05:00
Douwe Maan 634a152760 Make sure group and project creation is blocked for new users that are external by default 2017-11-06 15:19:15 +01: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
Douwe Maan a10925e1c3 Reallow project paths ending in periods 2017-11-06 14:46:53 +01:00
Shinya Maeda 377916ed72 Merge branch 'master' into refactor-clusters 2017-11-06 20:44:38 +09:00
Sean McGivern d4ceec9d47 Merge branch 'ce-gitlab-git-backport' into 'master'
CE repository mirroring changes backport

See merge request gitlab-org/gitlab-ce!15184
2017-11-06 10:39:36 +00:00
Grzegorz Bizon e2828a6067 Use existing pipeline stage if stage already exists 2017-11-06 11:04:09 +01:00
Grzegorz Bizon 503f213670 Make sure that every job has a stage assigned 2017-11-06 11:04:09 +01:00
Markus Koller 1f773a8ef5
Support custom attributes on groups 2017-11-06 10:51:50 +01:00
Markus Koller 6902848a9c
Support custom attributes on projects 2017-11-06 10:51:46 +01:00
Shinya Maeda c1f064cbe3 Remove unique validation from external_url in Environment 2017-11-06 16:00:39 +09:00
Shinya Maeda b737282ac7 Merge branch 'master' into refactor-clusters 2017-11-05 19:36:12 +09:00
Matija Čupić 5423e54649 Harcode project visibility 2017-11-05 01:39:36 +01:00
Matija Čupić 576f0a5a6d Expose project visibility as CI variable 2017-11-04 04:46:29 +01:00
Alessio Caiazza c6c9b37b1d
Add Clusters::Applications::Helm tests 2017-11-03 19:20:29 +01:00
Alejandro Rodríguez 3f0233e5b5 Create a Wiki Repository's raw_repository properly 2017-11-03 14:33:24 -03:00