Commit Graph

45 Commits

Author SHA1 Message Date
GitLab Bot d66f7a4222 Add latest changes from gitlab-org/gitlab@master 2021-04-23 03:09:40 +00:00
GitLab Bot 0a5e00b691 Add latest changes from gitlab-org/gitlab@master 2021-04-22 18:10:13 +00:00
GitLab Bot bac259ea8b Add latest changes from gitlab-org/gitlab@master 2021-03-10 18:09:32 +00:00
GitLab Bot cf0dbcbf10 Add latest changes from gitlab-org/gitlab@master 2021-02-20 00:10:55 +00:00
GitLab Bot 9a14667521 Add latest changes from gitlab-org/gitlab@master 2020-12-22 18:10:05 +00:00
GitLab Bot eba30e2ad8 Add latest changes from gitlab-org/gitlab@master 2020-12-16 00:09:58 +00:00
GitLab Bot 1361891b0a Add latest changes from gitlab-org/gitlab@master 2020-12-09 12:09:42 +00:00
GitLab Bot 39d41e02dc Add latest changes from gitlab-org/gitlab@master 2020-12-07 18:10:36 +00:00
GitLab Bot 839dad17a1 Add latest changes from gitlab-org/gitlab@master 2020-12-04 21:09:29 +00:00
GitLab Bot 73fd5a8973 Add latest changes from gitlab-org/gitlab@master 2020-12-04 00:09:55 +00:00
GitLab Bot f8bb64721a Add latest changes from gitlab-org/gitlab@master 2020-11-26 06:09:20 +00:00
GitLab Bot b58ab6c33c Add latest changes from gitlab-org/gitlab@master 2020-10-16 18:09:04 +00:00
GitLab Bot 34b3acb5a3 Add latest changes from gitlab-org/gitlab@master 2020-09-28 15:09:44 +00:00
GitLab Bot aa33f5d5bb Add latest changes from gitlab-org/gitlab@master 2020-09-16 21:09:52 +00:00
GitLab Bot 06c127aa72 Add latest changes from gitlab-org/gitlab@master 2020-09-15 15:10:08 +00:00
GitLab Bot 11a29f1f02 Add latest changes from gitlab-org/gitlab@master 2020-08-25 15:10:17 +00:00
GitLab Bot 5f4dec4ac3 Add latest changes from gitlab-org/gitlab@master 2020-08-06 15:09:42 +00:00
GitLab Bot 99c01aa686 Add latest changes from gitlab-org/gitlab@master 2020-06-08 18:08:27 +00:00
GitLab Bot e33f87ac0f Add latest changes from gitlab-org/gitlab@master 2020-04-21 15:21:10 +00:00
GitLab Bot 7ea6cb331a Add latest changes from gitlab-org/gitlab@master 2020-04-04 09:09:16 +00:00
GitLab Bot 0d0cddc9ce Add latest changes from gitlab-org/gitlab@master 2020-03-31 12:08:09 +00:00
GitLab Bot bb19d18713 Add latest changes from gitlab-org/gitlab@master 2020-03-04 03:08:50 +00:00
GitLab Bot 47946d47f3 Add latest changes from gitlab-org/gitlab@master 2020-03-02 03:07:58 +00:00
GitLab Bot cfbaef3f1c Add latest changes from gitlab-org/gitlab@master 2020-02-06 03:08:47 +00:00
GitLab Bot 7ec2694360 Add latest changes from gitlab-org/gitlab@master 2020-02-04 03:08:37 +00:00
GitLab Bot 529bc7e23b Add latest changes from gitlab-org/gitlab@master 2019-10-27 06:06:30 +00:00
GitLab Bot e4f5b70718 Add latest changes from gitlab-org/gitlab@master 2019-10-08 03:05:52 +00:00
GitLab Bot 42572f63ea Add latest changes from gitlab-org/gitlab@master 2019-09-30 06:06:02 +00:00
GitLab Bot 4584eb0e07 Add latest changes from gitlab-org/gitlab@master 2019-09-18 15:06:03 +00:00
Matt Penna 2a067bd25d Docs: Clarified note for preferred integration method 2019-09-09 15:01:24 +00:00
Marcel Amirault 73c6477b7e Changing badges to use parentheses not brackets
Previously, we used brackets to denote the tier badges,
but this made Kramdown, the docs site Markdown renderer,
show many warnings when building the site. This is now
fixed by using parentheses instead of square brackets.

This was caused by [PREMIUM] looking like a link to
Kramdown, which couldn't find a URL there.

See:
- https://gitlab.com/gitlab-com/gitlab-docs/merge_requests/484
- https://gitlab.com/gitlab-org/gitlab-ce/issues/63800
2019-07-08 08:50:38 +00:00
Russell Dickenson 59e6012ba7 Add link to import video 2019-06-12 06:32:14 +00:00
Marcel Amirault 469070903d Docs: Change links to relative in /user/project (Part 1) 2019-05-31 11:08:09 +00:00
Evan Read eb86630959 Ensure all lists are surrounded by new lines
Markdown renderers find it easier to determine
where lists start and end when lists are surrounded
by new lines.

For consistency, also ensure entries in the list
are aligned when they span multipls lines.
2019-02-22 13:17:10 +00:00
Evan Read c2c2d04b3a Fix most instances of bare URLs in markdown 2019-01-24 06:52:33 +00:00
Evan Read d98560c1f5 Make unordered lists conform to styleguide
- Also makes other minor Markdown fixes that were near the main fixes.
2019-01-08 12:21:09 +10:00
Cynthia Ng c900d58849 minor: format fix for GH import page 2018-11-16 18:18:32 +00:00
Evan Read 20146580a0 Resolve Markdown ordered lists not conforming to styleguide 2018-11-13 10:53:38 +10:00
Imre Farkas e6d8faf6fa
Update doc for maintaining project visibility during Github import 2018-06-07 13:30:16 +02:00
Achilleas Pipinellis 8197c756b1
Copyedit GitHub importer docs 2018-06-04 12:15:42 +02:00
Mike Lewis 20b04cc07e
Update GitHub import instructions (github.md) 2018-06-04 12:15:42 +02:00
Rory O’Kane a306c1957e Fix spelling of “discrepancy” in GitHub→GitLab project import docs 2018-02-02 23:38:09 +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
Lee Matos cc35c64207 Update github.md importer docs to clarify branches from forks get created in GL 2017-10-05 11:26:21 +00:00
Achilleas Pipinellis bbd627c548 Move workflow/importing/ to user/project/import/ 2017-08-17 17:18:33 +03:00