1. 23 12月, 2016 1 次提交
  2. 21 12月, 2016 1 次提交
    • M
      Add more storage statistics · 3ef4f74b
      Markus Koller 提交于
      This adds counters for build artifacts and LFS objects, and moves
      the preexisting repository_size and commit_count from the projects
      table into a new project_statistics table.
      
      The counters are displayed in the administration area for projects
      and groups, and also available through the API for admins (on */all)
      and normal users (on */owned)
      
      The statistics are updated through ProjectCacheWorker, which can now
      do more granular updates with the new :statistics argument.
      3ef4f74b
  3. 01 12月, 2016 1 次提交
    • Y
      Pass commit data to ProcessCommitWorker · 6b4d3356
      Yorick Peterse 提交于
      By passing commit data to this worker we remove the need for querying
      the Git repository for every job. This in turn reduces the time spent
      processing each job.
      
      The migration included migrates jobs from the old format to the new
      format. For this to work properly it requires downtime as otherwise
      workers may start producing errors until they're using a newer version
      of the worker code.
      6b4d3356
  4. 21 11月, 2016 1 次提交
    • Y
      Refactor cache refreshing/expiring · ffb9b3ef
      Yorick Peterse 提交于
      This refactors repository caching so it's possible to selectively
      refresh certain caches, instead of just expiring and refreshing
      everything.
      
      To allow this the various methods that were cached (e.g. "tag_count" and
      "readme") use a similar pattern that makes expiring and refreshing
      their data much easier.
      
      In this new setup caches are refreshed as follows:
      
      1. After a commit (but before running ProjectCacheWorker) we expire some
         basic caches such as the commit count and repository size.
      
      2. ProjectCacheWorker will recalculate the commit count, repository
         size, then refresh a specific set of caches based on the list of
         files changed in a push payload.
      
      This requires a bunch of changes to the various methods that may be
      cached. For one, data should not be cached if a branch used or the
      entire repository does not exist. To prevent all these methods from
      handling this manually this is taken care of in
      Repository#cache_method_output. Some methods still manually check for
      the existence of a repository but this result is also cached.
      
      With selective flushing implemented ProjectCacheWorker no longer uses an
      exclusive lease for all of its work. Instead this worker only uses a
      lease to limit the number of times the repository size is updated as
      this is a fairly expensive operation.
      ffb9b3ef
  5. 11 11月, 2016 2 次提交
  6. 09 11月, 2016 1 次提交
  7. 07 11月, 2016 1 次提交
    • Y
      Process commits in a separate worker · 509910b8
      Yorick Peterse 提交于
      This moves the code used for processing commits from GitPushService to
      its own Sidekiq worker: ProcessCommitWorker.
      
      Using a Sidekiq worker allows us to process multiple commits in
      parallel. This in turn will lead to issues being closed faster and cross
      references being created faster. Furthermore by isolating this code into
      a separate class it's easier to test and maintain the code.
      
      The new worker also ensures it can efficiently check which issues can be
      closed, without having to run numerous SQL queries for every issue.
      509910b8
  8. 13 10月, 2016 1 次提交
  9. 20 9月, 2016 1 次提交
    • T
      Implement review comments from @yorickpeterse · 8957293d
      Timothy Andrew 提交于
      1. Change multiple updates to a single `update_all`
      
      2. Use cascading deletes
      
      3. Extract an average function for the database median.
      
      4. Move database median to `lib/gitlab/database`
      
      5. Use `delete_all` instead of `destroy_all`
      
      6. Minor refactoring
      8957293d
  10. 19 9月, 2016 1 次提交
    • T
      Test all cycle analytics pre-calculation code. · 8f620851
      Timothy Andrew 提交于
      All the code that pre-calculates metrics for use in the cycle analytics
      page.
      
      - Ci::Pipeline -> build start/finish
      - Ci::Pipeline#merge_requests
      - Issue -> record default metrics after save
      - MergeRequest -> record default metrics after save
      - Deployment -> Update "first_deployed_to_production_at" for MR metrics
      - Git Push -> Update "first commit mention" for issue metrics
      - Merge request create/update/refresh -> Update "merge requests closing issues"
      8f620851
  11. 18 9月, 2016 1 次提交
  12. 15 9月, 2016 1 次提交
    • T
      Improve performance of the cycle analytics page. · ba25e2f1
      Timothy Andrew 提交于
      1. These changes bring down page load time for 100 issues from more than
         a minute to about 1.5 seconds.
      
      2. This entire commit is composed of these types of performance
         enhancements:
      
           - Cache relevant data in `IssueMetrics` wherever possible.
           - Cache relevant data in `MergeRequestMetrics` wherever possible.
           - Preload metrics
      
      3. Given these improvements, we now only need to make 4 SQL calls:
      
          - Load all issues
          - Load all merge requests
          - Load all metrics for the issues
          - Load all metrics for the merge requests
      
      4. A list of all the data points that are now being pre-calculated:
      
          a. The first time an issue is mentioned in a commit
      
            - In `GitPushService`, find all issues mentioned by the given commit
              using `ReferenceExtractor`. Set the `first_mentioned_in_commit_at`
              flag for each of them.
      
            - There seems to be a (pre-existing) bug here - files (and
              therefore commits) created using the Web CI don't have
              cross-references created, and issues are not closed even when
              the commit title is "Fixes #xx".
      
          b. The first time a merge request is deployed to production
      
            When a `Deployment` is created, find all merge requests that
            were merged in before the deployment, and set the
            `first_deployed_to_production_at` flag for each of them.
      
          c. The start / end time for a merge request pipeline
      
            Hook into the `Pipeline` state machine. When the `status` moves to
            `running`, find the merge requests whose tip commit matches the
            pipeline, and record the `latest_build_started_at` time for each
            of them. When the `status` moves to `success`, record the
            `latest_build_finished_at` time.
      
          d. The merge requests that close an issue
      
            - This was a big cause of the performance problems we were having
              with Cycle Analytics. We need to use `ReferenceExtractor` to make
              this calculation, which is slow when we have to run it on a large
              number of merge requests.
      
            - When a merge request is created, updated, or refreshed, find the
              issues it closes, and create an instance of
              `MergeRequestsClosingIssues`, which acts as a join model between
              merge requests and issues.
      
            - If a `MergeRequestsClosingIssues` instance links a merge request
              and an issue, that issue closes that merge request.
      
      5. The `Queries` module was changed into a class, so we can cache the
         results of `issues` and `merge_requests_closing_issues` across
         various cycle analytics stages.
      
      6. The code added in this commit is untested. Tests will be added in the
         next commit.
      ba25e2f1
  13. 16 8月, 2016 1 次提交
    • T
      Fix failing tests relating to backporting ee!581. · dd3b738d
      Timothy Andrew 提交于
      1. `GitPushService` was still using `{merge,push}_access_level_attributes` instead
         of `{merge,push}_access_levels_attributes`.
      
      2. The branches API creates access levels regardless of the state of the
         `developers_can_{push,merge}` parameters. This is in line with the UI,
         where Master access is the default for a new protected branch.
      
      3. Use `after(:build)` to create access levels in the
         `protected_branches` factory, so that `factories_spec` passes. It
         only builds records, so we need to create access levels on `build` as
         well.
      dd3b738d
  14. 12 8月, 2016 1 次提交
  15. 11 8月, 2016 1 次提交
    • K
      Pre-create all builds for Pipeline when a trigger is received · 39203f1a
      Kamil Trzcinski 提交于
      This change simplifies a Pipeline processing by introducing a special new status: created.
      This status is used for all builds that are created for a pipeline.
      We are then processing next stages and queueing some of the builds (created -> pending) or skipping them (created -> skipped).
      This makes it possible to simplify and solve a few ordering problems with how previously builds were scheduled.
      This also allows us to visualise a full pipeline (with created builds).
      
      This also removes an after_touch used for updating a pipeline state parameters.
      Right now in various places we explicitly call a reload_status! on pipeline to force it to be updated and saved.
      39203f1a
  16. 04 8月, 2016 1 次提交
  17. 29 7月, 2016 2 次提交
    • T
      Use `Gitlab::Access` to protected branch access levels. · 0a8aeb46
      Timothy Andrew 提交于
      1. It makes sense to reuse these constants since we had them duplicated
         in the previous enum implementation. This also simplifies our
         `check_access` implementation, because we can use
         `project.team.max_member_access` directly.
      
      2. Use `accepts_nested_attributes_for` to create push/merge access
         levels. This was a bit fiddly to set up, but this simplifies our code
         by quite a large amount. We can even get rid of
         `ProtectedBranches::BaseService`.
      
      3. Move API handling back into the API (previously in
         `ProtectedBranches::BaseService#translate_api_params`.
      
      4. The protected branch services now return a `ProtectedBranch` rather
         than `true/false`.
      
      5. Run `load_protected_branches` on-demand in the `create` action, to
         prevent it being called unneccessarily.
      
      6. "Masters" is pre-selected as the default option for "Allowed to Push"
         and "Allowed to Merge".
      
      7. These changes were based on a review from @rymai in !5081.
      0a8aeb46
    • T
      Fix default branch protection. · a9958ddc
      Timothy Andrew 提交于
      1. So it works with the new data model for protected branch access levels.
      a9958ddc
  18. 18 7月, 2016 1 次提交
  19. 14 7月, 2016 1 次提交
  20. 13 7月, 2016 1 次提交
  21. 03 6月, 2016 2 次提交
  22. 26 5月, 2016 1 次提交
  23. 05 5月, 2016 1 次提交
  24. 29 4月, 2016 1 次提交
  25. 19 4月, 2016 2 次提交
  26. 07 4月, 2016 1 次提交
  27. 05 4月, 2016 2 次提交
  28. 18 3月, 2016 1 次提交
    • Y
      Cache project avatars stored in Git · cd05d3f7
      Yorick Peterse 提交于
      The avatar logic has been moved from Project to Repository as this makes
      caching easier. The logic itself in turn has been changed so that the
      logo file names are cached in Redis. This cache is flushed upon pushing
      a commit but _only_ if:
      
      1. The commit was pushed to the default branch
      2. The commit actually changes any of the logo files
      
      If no branch or commit is given the cache is flushed anyway, this
      ensures that calling Repository#expire_cache without any arguments still
      flushes the avatar cache (e.g. this is used when removing a project).
      
      Fixes gitlab-org/gitlab-ce#14363
      cd05d3f7
  29. 17 3月, 2016 1 次提交
  30. 16 3月, 2016 1 次提交
  31. 15 3月, 2016 1 次提交
  32. 14 3月, 2016 1 次提交
  33. 11 3月, 2016 1 次提交
  34. 08 3月, 2016 2 次提交