<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/app/models/todo.rb, branch update-docs-spotbugs-java-11</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>Create an event on epic actions</title>
<updated>2019-09-03T21:29:55+00:00</updated>
<author>
<name>Jan Provaznik</name>
<email>jprovaznik@gitlab.com</email>
</author>
<published>2019-09-03T21:29:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=243bd0202fe3373a997f5ed37c027ab8cfdfcb35'/>
<id>243bd0202fe3373a997f5ed37c027ab8cfdfcb35</id>
<content type='text'>
Creates new event when an epic is created, closed, reopened or
commented.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Creates new event when an epic is created, closed, reopened or
commented.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Issue and Merge Request titles to Todo items</title>
<updated>2019-08-28T01:09:24+00:00</updated>
<author>
<name>Arun Kumar Mohan</name>
<email>arunmohandm@gmail.com</email>
</author>
<published>2019-06-27T05:56:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=4ca32c2b55519aa2b7852c879ad700e8fa290f80'/>
<id>4ca32c2b55519aa2b7852c879ad700e8fa290f80</id>
<content type='text'>
Only displays the todo body if the todo has a note.
This is to avoid redundant Issue or Merge Request titles
displayed both in the Todo title and body.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only displays the todo body if the todo has a note.
This is to avoid redundant Issue or Merge Request titles
displayed both in the Todo title and body.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename Todos.with_api_entity_associations to with_entity_associations</title>
<updated>2019-06-24T17:49:13+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2019-06-24T17:48:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=f2d932268d1b30929e45d7503ef90b325a85e314'/>
<id>f2d932268d1b30929e45d7503ef90b325a85e314</id>
<content type='text'>
Since this scope is used in both the controller and the API, we rename
it to make it clear that it's used for both.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since this scope is used in both the controller and the API, we rename
it to make it clear that it's used for both.
</pre>
</div>
</content>
</entry>
<entry>
<title>Delete unauthorized Todos when project is private</title>
<updated>2019-06-05T13:51:52+00:00</updated>
<author>
<name>Felipe Artur</name>
<email>felipefac@gmail.com</email>
</author>
<published>2019-05-21T19:20:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=be339468192c656bf9de0bb77d7e487f338902bf'/>
<id>be339468192c656bf9de0bb77d7e487f338902bf</id>
<content type='text'>
Delete Todos for guest users when project visibility
level is updated to private.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Delete Todos for guest users when project visibility
level is updated to private.
</pre>
</div>
</content>
</entry>
<entry>
<title>Inherit from ApplicationRecord instead of ActiveRecord::Base</title>
<updated>2019-03-28T16:18:23+00:00</updated>
<author>
<name>Nick Thomas</name>
<email>nick@gitlab.com</email>
</author>
<published>2019-03-28T13:17:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=013f7cd24c4359d5d704b719d85b6df7ca1fdd55'/>
<id>013f7cd24c4359d5d704b719d85b6df7ca1fdd55</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Significantly reduce N+1 queries in /api/v4/todos endpoint</title>
<updated>2019-03-06T15:03:46+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2019-03-02T17:31:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=062efe4f7a83fb2b6d951b314692cca9ee8731cd'/>
<id>062efe4f7a83fb2b6d951b314692cca9ee8731cd</id>
<content type='text'>
By preloading associations and batching issuable metadata lookups,
we can significantly cut the number of SQL queries needed to load
the Todos API endpoint.

On GitLab.com, my own tests showed my user's SQL queries went
from 365 to under 60 SQL queries.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40378
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By preloading associations and batching issuable metadata lookups,
we can significantly cut the number of SQL queries needed to load
the Todos API endpoint.

On GitLab.com, my own tests showed my user's SQL queries went
from 365 to under 60 SQL queries.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40378
</pre>
</div>
</content>
</entry>
<entry>
<title>Delete confidential issue todos for guests</title>
<updated>2018-12-14T12:38:52+00:00</updated>
<author>
<name>Felipe Artur</name>
<email>felipefac@gmail.com</email>
</author>
<published>2018-12-11T18:15:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=1653f7b1c68b2ea7da8df84ed459b9578e3dff8f'/>
<id>1653f7b1c68b2ea7da8df84ed459b9578e3dff8f</id>
<content type='text'>
Fix leaking information of confidential issues on TODOs
when user is downgraded to guest access.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix leaking information of confidential issues on TODOs
when user is downgraded to guest access.
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up ActiveRecord code in TodoService</title>
<updated>2018-10-08T13:19:12+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2018-09-20T15:05:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=38b8ae641fcfd7bbc5958556c5976d9ed872784c'/>
<id>38b8ae641fcfd7bbc5958556c5976d9ed872784c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up ActiveRecord code in TodosFinder</title>
<updated>2018-10-08T13:19:12+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2018-09-20T13:18:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=4c1dc31051fb741bbd6daff4b5c1dcb166d85eeb'/>
<id>4c1dc31051fb741bbd6daff4b5c1dcb166d85eeb</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Added FromUnion to easily select from a UNION</title>
<updated>2018-09-17T10:39:43+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2018-09-11T15:31:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=8a72f5c427426a3f90a14b2711ee1ecec4e8ca40'/>
<id>8a72f5c427426a3f90a14b2711ee1ecec4e8ca40</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
</feed>
