Skip to content
Snippets Groups Projects
  1. Aug 01, 2018
    • Zeger-Jan van de Weg's avatar
      Add repository languages for projects · 79a5d768
      Zeger-Jan van de Weg authored
      Our friends at GitHub show the programming languages for a long time,
      and inspired by that this commit means to create about the same
      functionality.
      
      Language detection is done through Linguist, as before, where the
      difference is that we cache the result in the database. Also, Gitaly can
      incrementaly scan a repository. This is done through a shell out, which
      creates overhead of about 3s each run. For now this won't be improved.
      
      Scans are triggered by pushed to the default branch, usually `master`.
      However, one exception to this rule the charts page. If we're requesting
      this expensive data anyway, we just cache it in the database.
      
      Edge cases where there is no repository, or its empty are caught in the
      Repository model. This makes use of Redis caching, which is probably
      already loaded.
      
      The added model is called RepositoryLanguage, which will make it harder
      if/when GitLab supports multiple repositories per project. However, for
      now I think this shouldn't be a concern. Also, Language could be
      confused with the i18n languages and felt like the current name was
      suiteable too.
      
      Design of the Project#Show page is done with help from @dimitrieh. This
      change is not visible to the end user unless detections are done.
      Unverified
      79a5d768
  2. Jul 30, 2018
  3. Jul 18, 2018
  4. Jun 24, 2018
  5. May 24, 2018
    • Oswaldo Ferreir's avatar
      Persist truncated note diffs on a new table · bb8f2520
      Oswaldo Ferreir authored
      We request Gitaly in a N+1 manner to build discussion diffs. Once the diffs are from different revisions, it's hard to make a single request to the service in order to build the whole response.
      With this change we solve this problem and simplify a lot fetching this piece of info.
      bb8f2520
  6. May 07, 2018
  7. Mar 30, 2018
    • Sean McGivern's avatar
      Send emails for issues due tomorrow · 2db218f8
      Sean McGivern authored
      Also, refactor the mail sending slightly: instead of one worker sending all
      emails, create a worker per project with issues due, which will send all emails
      for that project.
      2db218f8
  8. Mar 26, 2018
  9. Mar 22, 2018
  10. Mar 06, 2018
  11. Mar 01, 2018
  12. Feb 28, 2018
  13. Feb 26, 2018
  14. Feb 23, 2018
  15. Jan 06, 2018
  16. Dec 16, 2017
  17. Dec 13, 2017
  18. Dec 12, 2017
  19. Nov 28, 2017
  20. Nov 07, 2017
    • 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.
      Verified
      4dfe26cd
  21. Oct 03, 2017
  22. Sep 30, 2017
  23. Sep 28, 2017
  24. Sep 20, 2017
    • Yorick Peterse's avatar
      Stop using Sidekiq for updating Key#last_used_at · b3566a01
      Yorick Peterse authored
      This makes things simpler as no scheduling is involved. Further we
      remove the need for running a SELECT + UPDATE just to get the key and
      update it, whereas we only need an UPDATE when setting last_used_at
      directly in a request.
      
      The added service class takes care of updating Key#last_used_at without
      using Sidekiq. Further it makes sure we only try to obtain a Redis lease
      if we're confident that we actually need to do so, instead of always
      obtaining it. We also make sure to _only_ update last_used_at instead of
      also updating updated_at.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36663
      Verified
      b3566a01
  25. Aug 21, 2017
  26. Aug 07, 2017
  27. Jul 27, 2017
  28. Jun 12, 2017
  29. May 25, 2017
    • Alexander Randa's avatar
      Implement web hooks logging · 330789c2
      Alexander Randa authored
      * implemented logging of project and system web hooks
      * implemented UI for user area (project hooks)
      * implemented UI for admin area (system hooks)
      * implemented retry of logged webhook
      * NOT imeplemented log remover
      330789c2
  30. May 10, 2017
    • Toon Claes's avatar
      Use worker to destroy namespaceless projects in post-deploy · 0ad80cab
      Toon Claes authored
      Destroying projects can be very time consuming. So instead of destroying them in
      the post-deploy, just schedule them and make Sidekiq do the hard work.
      
      They are scheduled in batches of 5000 records. This way the number of database
      requests is limited while also the amount data read to memory is limited.
      0ad80cab
  31. May 05, 2017
Loading