Read about our upcoming Code of Conduct on this issue

This instance was upgraded to Heptapod 0.28.0 today

  1. 17 Sep, 2018 1 commit
    • Yorick Peterse's avatar
      Added FromUnion to easily select from a UNION · 84f6b869d148
      Yorick Peterse authored
      This commit adds the module `FromUnion`, which provides the class method
      `from_union`. This simplifies the process of selecting data from the
      result of a UNION, and reduces the likelihood of making mistakes. As a
      result, instead of this:
          union =[foo, bar])
          Foo.from("(#{union.to_sql}) #{Foo.table_name}")
      We can now write this instead:
          Foo.from_union([foo, bar])
      This commit also includes some changes to make this new setup work
      properly. For example, a bug in Rails 4
      ( would break the use of
      `from("sub-query-here").includes(:relation)` in certain cases. There was
      also a CI query which appeared to repeat a lot of conditions from an
      outer query on an inner query, which isn't necessary.
      Finally, we include a RuboCop cop to ensure developers use this new
      module, instead of using Gitlab::SQL::Union directly.
  2. 14 Sep, 2018 1 commit
  3. 11 Sep, 2018 1 commit
  4. 07 Sep, 2018 1 commit
  5. 06 Sep, 2018 1 commit
    • Bob Van Landuyt's avatar
      Port changes for CODEOWNERS to CE · 071eb07b8581
      Bob Van Landuyt authored
      This ports the changes for the CODEOWNERS feature to CE:
      - It adds the CODEOWNERS file.
      - It adds the mention of the `with-codeowners` branch in TestEnv
  6. 21 Aug, 2018 1 commit
  7. 20 Aug, 2018 1 commit
    • Yorick Peterse's avatar
      Refactor AutocompleteController · c8cc17675ba4
      Yorick Peterse authored
      This refactors the AutocompleteController according to the guidelines
      and boundaries discussed in Specifically,
      ActiveRecord logic is moved to different finders, which are then used in
      the controller. View logic in turn is moved to presenters, instead of
      directly using ActiveRecord's "to_json" method.
      The finder MoveToProjectFinder is also adjusted according to the
      abstraction guidelines and boundaries, resulting in a much more simple
      By using finders (and other abstractions) more actively, we can push a
      lot of logic out of the controller. We also remove the need for various
      "before_action" hooks, though this could be achieved without using
      finders as well.
      The various finders related to AutcompleteController have also been
      moved into a namespace. This removes the need for calling everything
      "AutocompleteSmurfFinder", instead you can use
  8. 16 Aug, 2018 1 commit
  9. 06 Aug, 2018 1 commit
  10. 02 Aug, 2018 1 commit
  11. 30 Jul, 2018 1 commit
  12. 29 Jul, 2018 1 commit
  13. 26 Jul, 2018 1 commit
  14. 19 Jul, 2018 1 commit
  15. 11 Jul, 2018 3 commits
  16. 09 Jul, 2018 2 commits
  17. 02 Jul, 2018 1 commit
  18. 26 Jun, 2018 1 commit
  19. 07 Jun, 2018 1 commit
    • Sean McGivern's avatar
      Fix some N+1s when calculating notification recipients · 3516463bc414
      Sean McGivern authored
      First N+1: we may have loaded a user's notification settings already, but not
      have loaded their sources. Because we're iterating through, we'd potentially
      load sources that are completely unrelated, just because they belong to this
      Second N+1: we do a separate query for each user who could be subscribed to or
      unsubcribed from the target. It's actually more efficient in this case to get
      all subscriptions at once, as we will need to check most of them.
      We can fix both by the slightly unpleasant means of checking IDs manually,
      rather than object equality.
  20. 31 May, 2018 1 commit
  21. 22 May, 2018 1 commit
  22. 21 May, 2018 1 commit
  23. 17 May, 2018 1 commit
  24. 16 May, 2018 4 commits
    • Dylan Griffith's avatar
    • Dylan Griffith's avatar
      Allow group runners to be viewed/edited in API · d55e1d6a4062
      Dylan Griffith authored
    • Jan Provaznik's avatar
      Changed order of include · 33c7dfb1ce05
      Jan Provaznik authored
    • Jan Provaznik's avatar
      Delete remote uploads · 9cb2812d4482
      Jan Provaznik authored
      ObjectStore uploader requires presence of associated `uploads` record
      when deleting the upload file (through the carrierwave's after_commit
      hook) because we keep info whether file is LOCAL or REMOTE in `upload`
      For this reason we can not destroy uploads as "dependent: :destroy" hook
      because these would be deleted too soon. Instead we rely on
      carrierwave's hook to destroy `uploads` in after_commit hook.
      But in before_destroy hook we still have to delete not-mounted uploads
      (which don't use carrierwave's destroy hook). This has to be done in
      before_Destroy instead of after_commit because `FileUpload` requires
      existence of model's object on destroy action.
      This is not ideal state of things, in a next step we should investigate
      how to unify model dependencies so we can use same workflow for all
      Related to #45425
  25. 14 May, 2018 1 commit
  26. 10 May, 2018 2 commits
  27. 04 May, 2018 1 commit
  28. 30 Apr, 2018 1 commit
  29. 28 Apr, 2018 1 commit
    • blackst0ne's avatar
      [Rails5] Fix `params` for DeleteUserWorker · 8457742c3619
      blackst0ne authored
      This commit fixes the error:
        1) Admin::UsersController DELETE #user with projects deletes the user and their contributions when hard delete is specified
           Failure/Error:, options.symbolize_keys)
             undefined method `symbolize_keys' for "{\"hard_delete\"=>\"true\"}":String
           # ./app/workers/delete_user_worker.rb:8:in `perform'
           # ./lib/gitlab/sidekiq_status/server_middleware.rb:5:in `call'
           # ./config/initializers/forbid_sidekiq_in_transactions.rb:35:in `block (2 levels) in <module:NoEnqueueingFromTransactions>'
           # ./app/models/user.rb:913:in `delete_async'
           # ./app/controllers/admin/users_controller.rb:148:in `destroy'
           # ./lib/gitlab/i18n.rb:50:in `with_locale'
           # ./lib/gitlab/i18n.rb:56:in `with_user_locale'
           # ./app/controllers/application_controller.rb:327:in `set_locale'
           # ./spec/controllers/admin/users_controller_spec.rb:28:in `block (3 levels) in <top (required)>'
      Finished in 6.81 seconds (files took 13.9 seconds to load)
      1 example, 1 failure
  30. 23 Apr, 2018 1 commit
  31. 19 Apr, 2018 1 commit
    • blackst0ne's avatar
      [Rails5] Fix `User#manageable_groups` · fc7c27524d46
      blackst0ne authored
      In `arel 7.0` (`7.1.4` version is used for rails5) there were introduced
      some changes that break our code in the `User#manageable_groups` method.
      The problem is that `arel_table[:id].in(Arel::Nodes::SqlLiteral)` generates
      wrong `IN ()` construction. The selection for `IN` is missing:
      => "\"namespaces\".\"id\" IN (0)"
      That caused such spec errors for the `rails5` branch:
      4) User groups with child groups #manageable_groups does not include duplicates if a membership was added for the subgroup
          Failure/Error: expect(user.manageable_groups).to contain_exactly(group, subgroup)
            expected collection contained:  [#<Group id:232 @group29>, #<Group id:234 @group29/group30>]
            actual collection contained:    []
            the missing elements were:      [#<Group id:232 @group29>, #<Group id:234 @group29/group30>]
          # ./spec/models/user_spec.rb:699:in `block (5 levels) in <top (required)>'
          # ./spec/spec_helper.rb:188:in `block (2 levels) in <top (required)>'
          # /var/lib/gems/2.3.0/gems/rspec-retry-0.4.6/lib/rspec/retry.rb:112:in `block in run'
          # /var/lib/gems/2.3.0/gems/rspec-retry-0.4.6/lib/rspec/retry.rb:101:in `loop'
          # /var/lib/gems/2.3.0/gems/rspec-retry-0.4.6/lib/rspec/retry.rb:101:in `run'
          # /var/lib/gems/2.3.0/gems/rspec-retry-0.4.6/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
          # /var/lib/gems/2.3.0/gems/rspec-retry-0.4.6/lib/rspec/retry.rb:30:in `block (2 levels) in setup'
      This commit changes `User#manageable_groups` in the way to drop the usage of
      `Arel::Nodes::SqlLiteral` and adds usage of raw SQL query.
      This change should be updated when we're migrated to Rails 5.2 because arel
      was fixed in `9.0.0` (which is used in Rails 5.2).
  32. 18 Apr, 2018 1 commit
    • Yorick Peterse's avatar
      Revert the addition of goldiloader · be0c0cc36a37
      Yorick Peterse authored
      This reverts the addition of the "goldiloader" Gem and all use of it.
      While this Gem is very promising it's causing a variety of problems on due to it eager-loading too much data in places where we
      don't expect/can handle this. At least for the time being this means we
      have to go back to manually fixing N+1 query problems, but at least
      those should not cause a negative impact on availability.
  33. 09 Apr, 2018 1 commit