- Sep 04, 2019
-
-
dineshpanda authored
-
- Oct 08, 2018
-
-
Yorick Peterse authored
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.
-
Yorick Peterse authored
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.
-
- Sep 17, 2018
-
-
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
-
- Sep 11, 2018
-
-
gfyoung authored
Partially addresses #47424.
-
Yorick Peterse authored
This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
-
- Aug 06, 2018
-
-
Jarka Kadlecova authored
-
- Aug 02, 2018
-
-
Jarka Kadlecova authored
-
Jarka Kadlecova authored
This reverts commit 8717c7da.
-
- Jul 11, 2018
-
-
Jarka Kadlecova authored
This reverts commit 4d9a3f42, reversing changes made to ecf9c145.
-
- Jul 03, 2018
-
-
Jarka Kadlecova authored
-
* Group filtering now includes also issues/MRs from subgroups/subprojects * fixed due_date * Also DRYed todo controller specs
-
Jarka Kadlecova authored
-
- Apr 04, 2018
-
-
blackst0ne authored
-
- Mar 05, 2018
-
-
Sean McGivern authored
This was causing todo priority sorting to fail.
-
- Mar 02, 2018
-
-
Yorick Peterse authored
Using ProjectsFinder in TodosFinder to limit todos to the right projects leads to overly complicated and slow database queries. This commit removes the use of ProjectsFinder in favour of using Project.public_or_visible_to_current_user directly. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/43767
-
- Feb 22, 2018
-
-
Bob Van Landuyt authored
-
- Sep 07, 2017
-
-
Tiago Botelho authored
-
- Aug 03, 2017
-
-
Toon Claes authored
When trying to run an UPDATE, this query is ran: ```sql UPDATE `todos` INNER JOIN `projects` ON `projects`.`id` = `todos`.`project_id` SET `todos`.`state` = 'done' WHERE `todos`.`user_id` = 4 AND (`todos`.`state` IN ('pending')) AND (EXISTS (SELECT 1 FROM `project_authorizations` WHERE `project_authorizations`.`user_id` = 4 AND (project_authorizations.project_id = projects.id)) OR projects.visibility_level IN (10, 20)) AND `projects`.`id` IN (SELECT `todos`.`project_id` FROM `todos` WHERE `todos`.`user_id` = 4 AND (`todos`.`state` IN ('pending'))) AND (`todos`.`state` != 'done') ``` But MySQL does not like the subquery used to filter on `projects.id IN (SELECT ...` Because the subquery queries from the same table: > Error: You can’t specify target table ‘todos’ for update in FROM clause So as workaround, wrap it in another subquery, where the original subquery is aliased using the `AS` statement. Mostly inspired by https://stackoverflow.com/a/43610081/89376
-
- Jun 28, 2017
-
-
Tiago Botelho authored
-
Tiago Botelho authored
-
- Jun 02, 2017
-
-
Rémy Coutable authored
Signed-off-by:
Rémy Coutable <remy@rymai.me>
-
- Apr 06, 2017
-
-
Jacopo authored
Extended ProjectFinder in order to handle the following options: - current_user - which user use - project_ids_relation: int[] - project ids to use - params: - trending: boolean - non_public: boolean - starred: boolean - sort: string - visibility_level: int - tags: string[] - personal: boolean - search: string - non_archived: boolean GroupProjectsFinder now inherits from ProjectsFinder. Changed the code in order to use the new available options.
-
- Mar 21, 2017
-
-
Sean McGivern authored
This reverts merge request !10076
-
- Mar 20, 2017
-
-
Jarka Kadlecova authored
-
- Feb 23, 2017
-
-
Douwe Maan authored
-
Douwe Maan authored
-
- Aug 30, 2016
-
-
http://jneen.net/ authored
-
- Aug 19, 2016
-
-
Felipe Artur authored
-
- Aug 15, 2016
-
-
Ahmad Sherif authored
-
Ahmad Sherif authored
Closes #20828
-
- Aug 12, 2016
-
-
Rémy Coutable authored
Some important things to note: - commands are removed from noteable.description / note.note - commands are translated to params so that they are treated as normal params in noteable Creation services - the logic is not in the models but in the Creation services, which is the right place for advanced logic that has nothing to do with what models should be responsible of! - UI/JS needs to be updated to handle notes which consist of commands only - the `/merge` command is not handled yet Other improvements: - Don't process commands in commit notes and display a flash is note is only commands - Add autocomplete for slash commands - Add description and params to slash command DSL methods - Ensure replying by email with a commands-only note works - Use :subscription_event instead of calling noteable.subscribe - Support :todo_event in IssuableBaseService Signed-off-by:
Rémy Coutable <remy@rymai.me>
-
- Jul 12, 2016
-
-
Sean McGivern authored
-
Paco Guzman authored
-
- Jul 01, 2016
-
-
Robert Schilling authored
-
- Jun 17, 2016
-
-
Douglas Barbosa Alexandre authored
-
- Jun 16, 2016
-
-
James Lopez authored
This reverts commit 13e37a3e.
-
James Lopez authored
-
- Jun 14, 2016
-
-
Phil Hughes authored
Added a button into the sidebar for issues & merge requests to allow users to manually create todo items Closes #15045
-
- Jun 03, 2016
-
-
James Lopez authored
This reverts commit 3e991230.
-