Skip to content
Snippets Groups Projects
  1. Jan 31, 2020
  2. Jul 29, 2019
  3. Jul 12, 2019
  4. Nov 07, 2018
    • gfyoung's avatar
      Enable even more frozen string in lib/gitlab · 7e6f6e16
      gfyoung authored
      Enables frozens string for the following:
      
      * lib/gitlab/conflict/**/*.rb
      * lib/gitlab/cross_project_access/**/*.rb
      * lib/gitlab/cycle_analytics/**/*.rb
      * lib/gitlab/data_builder/**/*.rb
      * lib/gitlab/database/**/*.rb
      * lib/gitlab/dependency_linker/**/*.rb
      * lib/gitlab/diff/**/*.rb
      * lib/gitlab/downtime_check/**/*.rb
      * lib/gitlab/email/**/*.rb
      * lib/gitlab/etag_caching/**/*.rb
      
      Partially addresses gitlab-org/gitlab-ce#47424.
      7e6f6e16
  5. Sep 17, 2018
    • Yorick Peterse's avatar
      Added FromUnion to easily select from a UNION · 8a72f5c4
      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 = Gitlab::SQL::Union.new([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
      (https://github.com/rails/rails/issues/24193) 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.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
      Verified
      8a72f5c4
  6. Jan 22, 2018
  7. Nov 06, 2017
  8. Aug 29, 2017
    • Yorick Peterse's avatar
      Improve migrations using triggers · 5eab624d
      Yorick Peterse authored
      This adds a bunch of checks to migrations that may create or drop
      triggers. Dropping triggers/functions is done using "IF EXISTS" so we
      don't throw an error if the object in question has already been dropped.
      We now also raise a custom error (message) when the user does not have
      TRIGGER privileges. This should prevent the schema from entering an
      inconsistent state while also providing the user with enough information
      on how to solve the problem.
      
      The recommendation of using SUPERUSER permissions is a bit extreme but
      we require this anyway (Omnibus also configures users with this
      permission).
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
      Verified
      5eab624d
Loading