1. 01 11月, 2018 1 次提交
  2. 30 10月, 2018 1 次提交
  3. 26 10月, 2018 3 次提交
  4. 23 10月, 2018 1 次提交
  5. 19 10月, 2018 1 次提交
  6. 18 10月, 2018 2 次提交
  7. 15 10月, 2018 1 次提交
  8. 12 10月, 2018 1 次提交
  9. 11 10月, 2018 1 次提交
  10. 08 10月, 2018 2 次提交
    • Y
      Clean up ActiveRecord code in TodoService · 38b8ae64
      Yorick Peterse 提交于
      This refactors the TodoService class according to our code reuse
      guidelines. The resulting code is a wee bit more verbose, but it allows
      us to decouple the column names from the input, resulting in fewer
      changes being necessary when we change the schema.
      
      One particular noteworthy line in TodoService is the following:
      
          todos_ids = todos.update_state(state)
      
      Technically this is a violation of the guidelines, because
      `update_state` is a class method, which services are not supposed to use
      (safe for a few allowed ones). I decided to keep this, since there is no
      alternative. `update_state` doesn't produce a relation so it doesn't
      belong in a Finder, and we can't move it to another Service either. As
      such I opted to just use the method directly.
      
      Cases like this may happen more frequently, at which point we should
      update our documentation with some sort of recommendation. For now, I
      want to refrain from doing so until we have a few more examples.
      38b8ae64
    • Y
      Clean up ActiveRecord code in TodosFinder · 4c1dc310
      Yorick Peterse 提交于
      This refactors the TodosFinder finder according to the new code reuse
      rules, as enforced by the CodeReuse cops. I also changed some of the
      methods to use regular if statements, instead of assignments and/or
      early returns. This results in a more natural flow when reading the
      code, and it makes it harder to accidentally return the wrong result.
      4c1dc310
  11. 05 10月, 2018 4 次提交
  12. 04 10月, 2018 3 次提交
  13. 03 10月, 2018 2 次提交
  14. 02 10月, 2018 1 次提交
  15. 01 10月, 2018 1 次提交
  16. 24 9月, 2018 2 次提交
  17. 21 9月, 2018 2 次提交
  18. 17 9月, 2018 1 次提交
    • Y
      Added FromUnion to easily select from a UNION · 8a72f5c4
      Yorick Peterse 提交于
      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
  19. 14 9月, 2018 1 次提交
    • Y
      Cleaned up CI runner administration code · f0e7b5e7
      Yorick Peterse 提交于
      In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19625 some
      changes were introduced that do not meet our abstraction reuse rules.
      This commit cleans up some of these changes so the requirements are met.
      
      Most notably, sorting of the runners in Admin::RunnersFinder has been
      delegated to Ci::Runner.order_by, similar to how we order data in
      models that include the Sortable module. If we need more sort orders in
      the future we can include Sortable and have Ci::Runner.order_by call
      `super` to delegate to Sortable.order_by.
      f0e7b5e7
  20. 13 9月, 2018 1 次提交
  21. 12 9月, 2018 1 次提交
  22. 11 9月, 2018 1 次提交
  23. 10 9月, 2018 1 次提交
  24. 07 9月, 2018 2 次提交
  25. 05 9月, 2018 2 次提交
  26. 29 8月, 2018 1 次提交