1. 28 Aug, 2019 1 commit
  2. 31 May, 2019 2 commits
    • Bob Van Landuyt's avatar
      Setup Phabricator import · a6929f88
      Bob Van Landuyt authored
      This sets up all the basics for importing Phabricator tasks into
      GitLab issues.
      
      To import all tasks from a Phabricator instance into GitLab, we'll
      import all of them into a new project that will have its repository
      disabled.
      
      The import is hooked into a regular ProjectImport setup, but similar
      to the GitHub parallel importer takes care of all the imports itself.
      
      In this iteration, we're importing each page of tasks in a separate
      sidekiq job.
      
      The first thing we do when requesting a new page of tasks is schedule
      the next page to be imported. But to avoid deadlocks, we only allow a
      single job per worker type to run at the same time.
      
      For now we're only importing basic Issue information, this should be
      extended to richer information.
      a6929f88
    • Bob Van Landuyt's avatar
      Setup Phabricator import · 589b2db0
      Bob Van Landuyt authored
      This sets up all the basics for importing Phabricator tasks into
      GitLab issues.
      
      To import all tasks from a Phabricator instance into GitLab, we'll
      import all of them into a new project that will have its repository
      disabled.
      
      The import is hooked into a regular ProjectImport setup, but similar
      to the GitHub parallel importer takes care of all the imports itself.
      
      In this iteration, we're importing each page of tasks in a separate
      sidekiq job.
      
      The first thing we do when requesting a new page of tasks is schedule
      the next page to be imported. But to avoid deadlocks, we only allow a
      single job per worker type to run at the same time.
      
      For now we're only importing basic Issue information, this should be
      extended to richer information.
      589b2db0
  3. 16 Jan, 2019 1 commit
  4. 12 Dec, 2018 1 commit
    • Yorick Peterse's avatar
      Reinstate changes lost due to automatic merging · 749ebc1c
      Yorick Peterse authored
      The automatic merging code used `--strategy=ours`, which turned out to
      be incorrect; instead we wanted `--strategy=recursive
      --strategy-option=ours`. This small difference results in merging
      throwing away _all_ EE changes in favour of CE changes, instead of only
      doing this for conflicts.
      
      This commit ensures that EE has all the appropriate changes. The diff
      was generated by cherry picking all merge commits made since two days
      ago, picking them with `--strategy=recursive --strategy-option=ours`.
      749ebc1c
  5. 09 Dec, 2018 1 commit
  6. 22 Oct, 2018 1 commit
  7. 02 Aug, 2018 1 commit
  8. 01 Aug, 2018 1 commit
  9. 20 Jul, 2018 1 commit
  10. 11 Jul, 2018 6 commits
  11. 25 Jun, 2018 1 commit
  12. 03 Jan, 2018 1 commit
  13. 08 Nov, 2017 2 commits
    • Yorick Peterse's avatar
      94b8336b
    • Yorick Peterse's avatar
      Rewrite the GitHub importer from scratch · d6ceb5e5
      Yorick Peterse authored
      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.
      d6ceb5e5
  14. 07 Nov, 2017 2 commits
    • Yorick Peterse's avatar
      6e242e82
    • Yorick Peterse's avatar
      Rewrite the GitHub importer from scratch · 4dfe26cd
      Yorick Peterse authored
      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.
      4dfe26cd
  15. 07 Aug, 2017 1 commit
  16. 23 Jan, 2017 2 commits
  17. 19 Dec, 2016 3 commits
  18. 25 Aug, 2016 1 commit
  19. 01 Jul, 2016 1 commit
  20. 16 Jun, 2016 1 commit
  21. 15 Jun, 2016 1 commit
  22. 05 May, 2016 1 commit
  23. 22 Apr, 2016 1 commit
  24. 09 Sep, 2015 1 commit
  25. 20 Aug, 2015 1 commit