1. 01 Feb, 2018 1 commit
  2. 29 Jan, 2018 1 commit
  3. 07 Dec, 2017 1 commit
  4. 05 Dec, 2017 1 commit
  5. 23 Nov, 2017 1 commit
    • Sean McGivern's avatar
      Use latest_merge_request_diff association · 8f7f03910539
      Sean McGivern authored
      Compared to the merge_request_diff association:
      
      1. It's simpler to query. The query uses a foreign key to the
         merge_request_diffs table, so no ordering is necessary.
      2. It's faster for preloading. The merge_request_diff association has to load
         every diff for the MRs in the set, then discard all but the most recent for
         each. This association means that Rails can just query for N diffs from N
         MRs.
      3. It's more complicated to update. This is a bidirectional foreign key, so we
         need to update two tables when adding a diff record. This also means we need
         to handle this as a special case when importing a GitLab project.
      
      There is some juggling with this association in the merge request model:
      
      * `MergeRequest#latest_merge_request_diff` is _always_ the latest diff.
      * `MergeRequest#merge_request_diff` reuses
        `MergeRequest#latest_merge_request_diff` unless:
          * Arguments are passed. These are typically to force-reload the association.
          * It doesn't exist. That means we might be trying to implicitly create a
            diff. This only seems to happen in specs.
          * The association is already loaded. This is important for the reasons
            explained in the comment, which I'll reiterate here: if we a) load a
            non-latest diff, then b) get its `merge_request`, then c) get that MR's
            `merge_request_diff`, we should get the diff we loaded in c), even though
            that's not the latest diff.
      
      Basically, `MergeRequest#merge_request_diff` is the latest diff in most cases,
      but not quite all.
      8f7f03910539
  6. 09 Oct, 2017 1 commit
  7. 07 Jul, 2017 1 commit
    • Sean McGivern's avatar
      Don't mark empty MRs as merged on push to the target branch · 64cdf801cef8
      Sean McGivern authored
      When we push to an MR's target branch, we check if the MR's HEAD commit is
      contained in the push. This lets us mark MRs as merged if they were merged
      manually.
      
      However, we also added a feature where you can create an empty MR from an
      issue. If that MR is created around the time of a merge to the default branch,
      we would process the push after creating the MR, and consider it to be a manual
      merge.
      
      To fix that, we exclude empty MRs from this process. If they are empty, they
      were empty before the push we're processing, so we shouldn't touch them!
      64cdf801cef8
  8. 06 Jul, 2017 1 commit
    • Sean McGivern's avatar
      Add table for merge request commits · b5835ae8e372
      Sean McGivern authored
      This is an ID-less table with just three columns: an association to the merge
      request diff the commit belongs to, the relative order of the commit within the
      merge request diff, and the commit SHA itself.
      
      Previously we stored much more information about the commits, so that we could
      display them even when they were deleted from the repo. Since 8.0, we ensure
      that those commits are kept around for as long as the target repo itself is, so
      we don't need to duplicate that data in the database.
      b5835ae8e372
  9. 21 Jun, 2017 1 commit
  10. 23 May, 2017 1 commit
  11. 01 Mar, 2017 1 commit
    • James Lopez's avatar
      Update occurrences of MWBS to MWPS · 060ee4e63884
      James Lopez authored
       Rename column in the database
       Rename fields related to import/export feature
       Rename API endpoints
       Rename documentation links
       Rename the rest of occurrences in the code
       Replace the images that contain the words "build succeeds" and docs referencing to them
       Make sure pipeline is green and nothing is missing.
      
      updated doc images
      
      renamed only_allow_merge_if_build_succeeds in projects and fixed references
      
      more updates
      
      fix some spec failures
      
      fix rubocop offences
      
      fix v3 api spec
      
      fix MR  specs
      
      fixed issues with partials
      
      fix MR spec
      
      fix alignment
      
      add missing v3 to v4 doc
      
      wip - refactor v3 endpoints
      
      fix specs
      
      fix a few typos
      
      fix project specs
      
      copy entities fully to V3
      
      fix  entity error
      
      more fixes
      
      fix failing specs
      
      fixed missing entities in V3 API
      
      remove comment
      
      updated code based on feedback
      
      typo
      
      fix spec
      060ee4e63884
  12. 23 Feb, 2017 4 commits
  13. 13 Feb, 2017 1 commit
  14. 23 Jan, 2017 1 commit
  15. 19 Jan, 2017 1 commit
  16. 09 Dec, 2016 1 commit
  17. 01 Dec, 2016 1 commit
  18. 21 Nov, 2016 1 commit
  19. 16 Nov, 2016 1 commit
  20. 20 Sep, 2016 1 commit
  21. 15 Sep, 2016 1 commit
    • Timothy Andrew's avatar
      Improve performance of the cycle analytics page. · 52e536c75ee6
      Timothy Andrew authored
      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.
      52e536c75ee6
  22. 01 Aug, 2016 1 commit
  23. 18 Jul, 2016 1 commit
  24. 13 Jul, 2016 2 commits
  25. 08 Jul, 2016 1 commit
  26. 06 Jul, 2016 2 commits
  27. 03 Jun, 2016 2 commits
  28. 17 May, 2016 1 commit
    • Sean McGivern's avatar
      Create a todo on failing MR build · aee97853446d
      Sean McGivern authored
      When a build fails for a commit, create a todo for the author of the
      merge request that commit is the HEAD of. If the commit isn't the HEAD
      commit of any MR, don't do anything. If there already is a todo for that
      user and MR, don't do anything.
      
      Current limitations:
      - This isn't configurable by project.
      - The author of a merge request might not be the person who pushed the
        breaking commit.
      aee97853446d
  29. 15 Dec, 2015 1 commit
  30. 18 Nov, 2015 1 commit
  31. 06 Nov, 2015 1 commit
  32. 02 Nov, 2015 1 commit
  33. 21 Oct, 2015 2 commits