<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/app/models/concerns/avatarable.rb, branch docs-pages-force-https</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>Disable method replacement in avatar loading</title>
<updated>2019-04-30T04:29:25+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2019-04-30T00:07:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=25818bd7ae765422c934d0a32efb4ba353d11183'/>
<id>25818bd7ae765422c934d0a32efb4ba353d11183</id>
<content type='text'>
We've seen a significant performance penalty when using
`BatchLoader#__replace_with!`. This defines methods on the batch loader
that proxy to the 'real' object using send. The alternative is
`method_missing`, which is slower.  However, we've noticed that
`method_missing` can be faster if:

1. The objects being loaded have a large interface.
2. We don't call too many methods on the loaded object.

Avatar uploads meet both criteria above, so let's use the newly-released
feature in https://github.com/exAspArk/batch-loader/pull/45.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60903
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We've seen a significant performance penalty when using
`BatchLoader#__replace_with!`. This defines methods on the batch loader
that proxy to the 'real' object using send. The alternative is
`method_missing`, which is slower.  However, we've noticed that
`method_missing` can be faster if:

1. The objects being loaded have a large interface.
2. We don't call too many methods on the loaded object.

Avatar uploads meet both criteria above, so let's use the newly-released
feature in https://github.com/exAspArk/batch-loader/pull/45.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60903
</pre>
</div>
</content>
</entry>
<entry>
<title>Cache avatar URLs and paths within a request</title>
<updated>2018-12-19T23:34:29+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2018-12-19T23:18:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=52fdddbd2d1e89a6a41a59a41adf0820cc98c435'/>
<id>52fdddbd2d1e89a6a41a59a41adf0820cc98c435</id>
<content type='text'>
In a merge request with many discussions, the avatar URL can be called
thousands of times, inflicting a significant performance penalty
especially when avatars are stored in object storage. To mitigate this
problem, we can just cache the generated path any time it is requested.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55355
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a merge request with many discussions, the avatar URL can be called
thousands of times, inflicting a significant performance penalty
especially when avatars are stored in object storage. To mitigate this
problem, we can just cache the generated path any time it is requested.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55355
</pre>
</div>
</content>
</entry>
<entry>
<title>Rails5: Passing a class as a value in an Active Record query is deprecated</title>
<updated>2018-11-17T15:14:36+00:00</updated>
<author>
<name>Jasper Maes</name>
<email>jaspermaes.jm@gmail.com</email>
</author>
<published>2018-11-17T15:14:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=5d5481519deb304243ed1c09171ccf8a45052d46'/>
<id>5d5481519deb304243ed1c09171ccf8a45052d46</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Disable project avatar validation if avatar has not changed</title>
<updated>2018-09-04T19:20:58+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2018-09-04T18:57:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=d4bdcfbf19b594646d597bae5eb6d0c0f7354362'/>
<id>d4bdcfbf19b594646d597bae5eb6d0c0f7354362</id>
<content type='text'>
Every time a column in the projects table is changed, the Avatarable concern
would validate that the avatar file size was under 200K.  This not only delays
the database changes, but it also can lead to unrelated failures if the HTTP
request fails for some reason.

Closes #51053
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Every time a column in the projects table is changed, the Avatarable concern
would validate that the avatar file size was under 200K.  This not only delays
the database changes, but it also can lead to unrelated failures if the HTTP
request fails for some reason.

Closes #51053
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable more frozen string in app/models/**/*.rb</title>
<updated>2018-08-07T07:37:36+00:00</updated>
<author>
<name>gfyoung</name>
<email>gfyoung17@gmail.com</email>
</author>
<published>2018-08-03T17:22:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=15b878e27e8188e9d22755fd648f75de313f012f'/>
<id>15b878e27e8188e9d22755fd648f75de313f012f</id>
<content type='text'>
Partially addresses #47424.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Partially addresses #47424.
</pre>
</div>
</content>
</entry>
<entry>
<title>Send resize parameters for avatars</title>
<updated>2018-08-07T06:04:33+00:00</updated>
<author>
<name>Tim Zallmann</name>
<email>tzallmann@gitlab.com</email>
</author>
<published>2018-08-07T06:04:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=fac4f50cf6bd923cbf6c5b7a9a69c39e5b2d9181'/>
<id>fac4f50cf6bd923cbf6c5b7a9a69c39e5b2d9181</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix an N+1 in avatar URLs</title>
<updated>2018-06-05T13:57:19+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@gitlab.com</email>
</author>
<published>2018-04-19T16:22:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=6ecf819f73ae28547e1b816780de0d85c3a653cf'/>
<id>6ecf819f73ae28547e1b816780de0d85c3a653cf</id>
<content type='text'>
This is tricky: the query was being run in
`ObjectStorage::Extension::RecordsUploads#retrieve_from_store!`, but we can't
just add batch loading there, because the `#upload=` method there would use the
result immediately, making the batch only have one item.

Instead, we can pre-emptively add an item to the batch whenever an avatarable
object is initialized, and then reuse that batch item in
`#retrieve_from_store!`. However, this also has problems:

1. There is a lot of logic in `Avatarable#retrieve_upload_from_batch`.
2. Some of that logic constructs a 'fake' model for the batch key. This should
   be fine, because of ActiveRecord's override of `#==`, but it relies on that
   staying the same.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is tricky: the query was being run in
`ObjectStorage::Extension::RecordsUploads#retrieve_from_store!`, but we can't
just add batch loading there, because the `#upload=` method there would use the
result immediately, making the batch only have one item.

Instead, we can pre-emptively add an item to the batch whenever an avatarable
object is initialized, and then reuse that batch item in
`#retrieve_from_store!`. However, this also has problems:

1. There is a lot of logic in `Avatarable#retrieve_upload_from_batch`.
2. Some of that logic constructs a 'fake' model for the batch key. This should
   be fine, because of ActiveRecord's override of `#==`, but it relies on that
   staying the same.
</pre>
</div>
</content>
</entry>
<entry>
<title>Resolve "Avatar URLs are wrong when using a CDN path and Object Storage"</title>
<updated>2018-04-23T16:59:53+00:00</updated>
<author>
<name>Micaël Bergeron</name>
<email>mbergeron@gitlab.com</email>
</author>
<published>2018-04-23T16:59:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=741f333d23cd09de328c9f4035c16210cb97aa10'/>
<id>741f333d23cd09de328c9f4035c16210cb97aa10</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '40781-os-to-ce' into 'master'</title>
<updated>2018-03-27T08:20:03+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@mcgivern.me.uk</email>
</author>
<published>2018-03-27T08:20:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=835fe4d324b5a89c09f06d74d5ddc73a2c41a38b'/>
<id>835fe4d324b5a89c09f06d74d5ddc73a2c41a38b</id>
<content type='text'>
Bring Object Storage to CE

Closes #4171, #4163, #3370, #2841, and #29203

See merge request gitlab-org/gitlab-ce!17358</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bring Object Storage to CE

Closes #4171, #4163, #3370, #2841, and #29203

See merge request gitlab-org/gitlab-ce!17358</pre>
</div>
</content>
</entry>
<entry>
<title>Change avatar error message to include allowed file formats</title>
<updated>2018-03-22T18:01:43+00:00</updated>
<author>
<name>Fabian Schneider</name>
<email>fabbbbbi+git@googlemail.com</email>
</author>
<published>2018-03-11T19:56:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=839589fde30cff9ecf963dab775bfd9b9b2fe17b'/>
<id>839589fde30cff9ecf963dab775bfd9b9b2fe17b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
