An error occurred fetching the project authors.
  1. 21 Sep, 2018 1 commit
  2. 17 Sep, 2018 2 commits
    • Yorick Peterse's avatar
      Added FromUnion to easily select from a UNION · d86e25db
      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
      d86e25db
    • 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
      8a72f5c4
  3. 11 Sep, 2018 2 commits
  4. 29 Aug, 2018 2 commits
  5. 25 Aug, 2018 2 commits
    • Bob Van Landuyt's avatar
      Reject ruby interpolation in externalized strings · f613924b
      Bob Van Landuyt authored
      When using ruby interpolation in externalized strings, they can't be
      detected. Which means they will never be presented to be translated.
      
      To mix variables into translations we need to use `sprintf`
      instead.
      
      Instead of:
      
          _("Hello #{subject}")
      
      Use:
      
          _("Hello %{subject}) % { subject: 'world' }
      f613924b
    • Bob Van Landuyt's avatar
      Reject ruby interpolation in externalized strings · 08c0a1b8
      Bob Van Landuyt authored
      When using ruby interpolation in externalized strings, they can't be
      detected. Which means they will never be presented to be translated.
      
      To mix variables into translations we need to use `sprintf`
      instead.
      
      Instead of:
      
          _("Hello #{subject}")
      
      Use:
      
          _("Hello %{subject}) % { subject: 'world' }
      08c0a1b8
  6. 16 Aug, 2018 2 commits
  7. 08 Aug, 2018 1 commit
  8. 20 Jun, 2018 1 commit
    • Bob Van Landuyt's avatar
      Add a cop for `FinderMethods` · f3f1df14
      Bob Van Landuyt authored
      This notifies developers when calling `find(_by!)` chained on
      `execute`. And suggests using the methods from `FinderMethods`. These
      will perform the correct authorization checks on the resource when it
      is found.
      f3f1df14
  9. 18 Apr, 2018 3 commits
    • Yorick Peterse's avatar
      Revert the addition of goldiloader · 5612b60b
      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
      GitLab.com 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.
      5612b60b
    • Yorick Peterse's avatar
      Revert the addition of goldiloader · 6f292eaa
      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
      GitLab.com 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.
      6f292eaa
    • 🙈  jacopo beschi 🙉's avatar
  10. 14 Apr, 2018 2 commits
  11. 09 Apr, 2018 2 commits
  12. 06 Apr, 2018 2 commits
  13. 21 Mar, 2018 2 commits
  14. 08 Mar, 2018 2 commits
  15. 12 Jan, 2018 2 commits
  16. 11 Jan, 2018 2 commits
  17. 26 Dec, 2017 2 commits
  18. 22 Dec, 2017 2 commits
  19. 13 Dec, 2017 2 commits
  20. 11 Dec, 2017 1 commit
    • Sean McGivern's avatar
      Add cop for use of remove_column · 1ab33b15
      Sean McGivern authored
      remove_column should only be used in the up (or change) step of a migration if
      it's a post-deployment migration. Otherwise there will be downtime due to the
      ActiveRecord column cache, which we can avoid by using the IgnorableColumn
      concern in combination with a post-deployment migration.
      1ab33b15
  21. 30 Nov, 2017 1 commit
    • Lin Jen-Shin's avatar
      Merge branch 'no-ivar-in-modules' into tmp · 91756788
      Lin Jen-Shin authored
      * no-ivar-in-modules:
        Cache allowed_ids
        Fix a few layout error
        Make it clear that this is an acceptable use
        Reword Instance variables in views
        Move ModuleWithInstanceVariables to Gitlab namespace
        Explain how to disable it in the doc
        Just define allowed_ids and override it with empty value
        Updates based on feedback
        Remove codes from bad merge
        Allow initialize method and single ivar
        Use StrongMemoize and enable/disable cops properly
        WIP
        Fix grammar: judge -> judgement
        Allow simple ivar ||= form. Update accordingly
        Add cop to make sure we don't use ivar in a module
      91756788
  22. 22 Nov, 2017 1 commit
  23. 17 Nov, 2017 1 commit