Skip to content
Snippets Groups Projects
  1. Sep 04, 2019
  2. Sep 03, 2019
    • Andreas Brandl's avatar
      Preload routes information · 53801b12
      Andreas Brandl authored
      This fixes a high frequency N+1 issue:
      
      `RoutableActions#find_routable!` is used across many controllers to
      retrieve e.g. the Project or Namespace by path. The `#find_routable!`
      method calls `#ensure_canonical_path` which in turn retrieves
      `#full_path` from the given Routable.
      
      This in turn triggers a lookup on `routes`, leading to a high frequency
      of these queries:
      
      ```sql
      SELECT  "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND
      "routes"."source_type" = $2 LIMIT $3
      ```
      
      This is unnecessary as we already join `routes` in
      `Routable#find_by_full_path` anyways.
      Unverified
      53801b12
    • Etienne Baqué's avatar
      Added relationships between Release and Milestone · a43ab8d6
      Etienne Baqué authored and Andreas Brandl's avatar Andreas Brandl committed
      Modified schema via migrations.
      Added one-to-one relationship between the two models.
      Added changelog file
      a43ab8d6
    • Shinya Maeda's avatar
      Add pipeline.type key to PipelineEntity · 8c21610c
      Shinya Maeda authored
      This commit adds pipeline.type key to PipelineEntity.
      This key will be used in MR widget in the next iteration.
      8c21610c
  3. Sep 02, 2019
  4. Aug 30, 2019
    • Manoj M J's avatar
      Limit access request email to 10 most recently active owners/maintainers · b943baa4
      Manoj M J authored and Mayra Cabrera's avatar Mayra Cabrera committed
      This change limits the number of emails
      for new access requests notifications to
      10 most recently active owners/maintainers
      b943baa4
    • James Fargher's avatar
      Install cert-manager v0.9.1 · 5142bd73
      James Fargher authored
      This does not support upgrading from earlier versions
      5142bd73
    • Andreas Brandl's avatar
      Perform two-step Routable lookup by path · 739d6a5a
      Andreas Brandl authored
      In order to lookup a Project or Namespace by path, we prefer an exact
      match (case-sensitive) but in absence of that, we'd also take a
      case-insensitive match.
      
      The case-insensitive matching with preference for the exact match is a
      bit more involved in SQL as the exact lookup. Yet, the majority of cases
      will be an exact match. The thinking here is that we can optimize the
      lookup by performing an exact match first and only if there is no
      result, we perform the case-insensitive lookup.
      
      Data for GitLab.com:
      * We have about 15M records in routes table
      * About 2,500 routes exist where there's more than one record
        with the same `lower(path)`
      
      It is possible for a user to craft requests that would always trigger
      the 2-step search (e.g. we have a route for `/foo/bar`, the request is
      always for `/FOO/bar`). In this case, the change at hand is not
      beneficial as it would run an additional query.
      
      However, based on the data, it is highly likely that the vast majority
      of requests can be satisfied with an exact match only.
      
      The context for this change is
      https://gitlab.com/gitlab-org/gitlab-ce/issues/64590#note_208156463.
      Unverified
      739d6a5a
    • Ash McKenzie's avatar
      Replace rails_helper.rb with spec_helper.rb · 19ff9d98
      Ash McKenzie authored
      rails_helper.rb's only logic was to require
      spec_helper.rb.
      Unverified
      19ff9d98
  5. Aug 29, 2019
  6. Aug 28, 2019
  7. Aug 27, 2019
  8. Aug 26, 2019
  9. Aug 24, 2019
  10. Aug 23, 2019
    • Adam Hegyi's avatar
      Implement validation logic to ProjectStage · 60e33885
      Adam Hegyi authored and Mayra Cabrera's avatar Mayra Cabrera committed
      - Introducting StageEvents to define the available events
      - Define the event pairing rules, since some events are not compatible
      - Express default Cycle Analytics stages with the event structure
      60e33885
  11. Aug 22, 2019
  12. Aug 21, 2019
  13. Aug 20, 2019
    • Luke Duncalfe's avatar
      Add service classes for mutating AwardEmoji · 37b17fa6
      Luke Duncalfe authored
      Adding, destroying and toggling emoji previously lacked services and
      instead were performed through methods called on Awardable models.
      
      This led to inconsistencies where relevant todos would be marked as done
      only when emoji were awarded through our controllers, but not through
      the API. Todos could also be marked as done when an emoji was being
      removed.
      
      Behaviour changes
      
      - Awarding emoji through the API will now mark a relevant Todo as done
      - Toggling an emoji off (destroying it) through our controllers will no
        longer mark a relevant Todo as done
      
      Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63372
      37b17fa6
    • Thong Kuah's avatar
      Override hostname when connecting via Kubeclient · e0826b0c
      Thong Kuah authored
      Kubeclient uses rest-client. We hack into to access the net/http object
      so that we can patch to connect to the resolved IP + set
      hostname_override.
      
      Add specs for discord. The discord integration also uses rest-client, so
      since we patched rest-client, spec that the DNS rebinding protection
      works
      e0826b0c
  14. Aug 16, 2019
    • Stan Hu's avatar
      Expire project caches once per push instead of once per ref · f14647fd
      Stan Hu authored and Douwe Maan's avatar Douwe Maan committed
      Previously `ProjectCacheWorker` would be scheduled once per ref, which
      would generate unnecessary I/O and load on Sidekiq, especially if many
      tags or branches were pushed at once. `ProjectCacheWorker` would expire
      three items:
      
      1. Repository size: This only needs to be updated once per push.
      2. Commit count: This only needs to be updated if the default branch
         is updated.
      3. Project method caches: This only needs to be updated if the default
         branch changes, but only if certain files change (e.g. README,
         CHANGELOG, etc.).
      
      Because the third item requires looking at the actual changes in the
      commit deltas, we schedule one `ProjectCacheWorker` to handle the first
      two cases, and schedule a separate `ProjectCacheWorker` for the third
      case if it is needed. As a result, this brings down the number of
      `ProjectCacheWorker` jobs from N to 2.
      
      Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52046
      f14647fd
    • Nick Thomas's avatar
      Cache branch and tag names as Redis sets · 0eff75fa
      Nick Thomas authored
      This allows us to check inclusion for the *_exists? methods without
      downloading the full list of branch names, which is over 100KiB in size
      for gitlab-ce at the moment.
      Verified
      0eff75fa
  15. Aug 15, 2019
    • Adam Hegyi's avatar
      Migrations for Cycle Analytics backend · ca6cfde5
      Adam Hegyi authored and Mayra Cabrera's avatar Mayra Cabrera committed
      This change lays the foundation for customizable cycle analytics stages.
      The main reason for the change is to extract the event definitions to
      separate objects (start_event, end_event) so that it could be easily
      customized later on.
      ca6cfde5
    • Nick Thomas's avatar
      Only read rebase status from the model · d31b733f
      Nick Thomas authored and Mayra Cabrera's avatar Mayra Cabrera committed
      Prior to 12.1, rebase status was looked up directly from Gitaly. In
      https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14417 , a DB
      column was added to track the status instead. However, we couldn't stop
      looking at the gitaly status immediately, since some rebases may been
      running across the upgrade.
      
      Now that we're in 12.3, it is safe to remove the direct-to-gitaly
      lookup. This also happens to fix a 500 error that is seen when viewing
      an MR for a fork where the source project has been removed.
      
      We still look at the Gitaly status in the service, just in case Gitaly
      and Sidekiq get out of sync - I assume this is possible, and it's a
      relatively cheap check.
      
      Since we atomically check and set `merge_requests.rebase_jid`, we
      should never enqueue two `RebaseWorker` jobs in parallel.
      d31b733f
    • Brett Walker's avatar
      Allow disabling group/project email notifications · 3489dc3d
      Brett Walker authored
      - Adds UI to configure in group and project settings
      - Removes notification configuration for users when
      disabled at group or project level
      3489dc3d
  16. Aug 13, 2019
    • Bob Van Landuyt :neckbeard:'s avatar
      Rework retry strategy for remote mirrors · 452bc36d
      Bob Van Landuyt :neckbeard: authored and Douwe Maan's avatar Douwe Maan committed
      **Prevention of running 2 simultaneous updates**
      
      Instead of using `RemoteMirror#update_status` and raise an error if
      it's already running to prevent the same mirror being updated at the
      same time we now use `Gitlab::ExclusiveLease` for that.
      
      When we fail to obtain a lease in 3 tries, 30 seconds apart, we bail
      and reschedule. We'll reschedule faster for the protected branches.
      
      If the mirror already ran since it was scheduled, the job will be
      skipped.
      
      **Error handling: Remote side**
      
      When an update fails because of a `Gitlab::Git::CommandError`, we
      won't track this error in sentry, this could be on the remote side:
      for example when branches have diverged.
      
      In this case, we'll try 3 times scheduled 1 or 5 minutes apart.
      
      In between, the mirror is marked as "to_retry", the error would be
      visible to the user when they visit the settings page.
      
      After 3 tries we'll mark the mirror as failed and notify the user.
      
      We won't track this error in sentry, as it's not likely we can help
      it.
      
      The next event that would trigger a new refresh.
      
      **Error handling: our side**
      
      If an unexpected error occurs, we mark the mirror as failed, but we'd
      still retry the job based on the regular sidekiq retries with
      backoff. Same as we used to
      
      The error would be reported in sentry, since its likely we need to do
      something about it.
      452bc36d
    • Nathan Friend's avatar
      Fix project image in Slack pipeline notifications · 5112d92c
      Nathan Friend authored
      This commit fixes the project avatar images that are rendered in the
      footer of Slack pipeline notifications.  Previously, the image URLs
      provided to Slack were relative URLs; now they are absolute.
      Unverified
      5112d92c
    • Stan Hu's avatar
      Only expire tag cache once per push · e658f960
      Stan Hu authored
      Previously each tag in a push would invoke the Gitaly `FindAllTags` RPC
      since the tag cache would be invalidated with every tag.
      
      We can eliminate those extraneous calls by expiring the tag cache once
      in `PostReceive` and taking advantage of the cached tags.
      
      Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/65795
      e658f960
Loading