Commit graph

17 commits

Author SHA1 Message Date
Stan Hu
d4bdcfbf19 Disable project avatar validation if avatar has not changed
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
2018-09-04 12:20:58 -07:00
gfyoung
15b878e27e Enable more frozen string in app/models/**/*.rb
Partially addresses #47424.
2018-08-07 00:37:36 -07:00
Tim Zallmann
fac4f50cf6 Send resize parameters for avatars 2018-08-07 06:04:33 +00:00
Sean McGivern
6ecf819f73 Fix an N+1 in avatar URLs
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.
2018-06-05 14:57:19 +01:00
Micaël Bergeron
741f333d23 Resolve "Avatar URLs are wrong when using a CDN path and Object Storage" 2018-04-23 16:59:53 +00:00
Sean McGivern
835fe4d324 Merge branch '40781-os-to-ce' into 'master'
Bring Object Storage to CE

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

See merge request gitlab-org/gitlab-ce!17358
2018-03-27 08:20:03 +00:00
Fabian Schneider
839589fde3 Change avatar error message to include allowed file formats 2018-03-22 19:01:43 +01:00
Micaël Bergeron
0f1d348d68 port the object storage to CE 2018-03-01 10:34:30 -05:00
Sean McGivern
a7dae52e9d Merge branch '4163-move-uploads-to-object-storage' into 'master'
Move uploads to object storage

Closes #4163

See merge request gitlab-org/gitlab-ee!3867
2018-02-28 20:58:15 +01:00
Micaël Bergeron
2057a6acde port of 594e6a0a625^..f74c90f68c6 2018-02-01 12:14:46 -05:00
Douwe Maan
2fbbba9a29 Always return full avatar URL for private/internal groups/projects when asset host is set 2017-11-09 15:40:41 +00:00
Tim Zallmann
5f41cddf80 Based on MR simplified the logic 2017-10-09 10:45:23 +02:00
Tim Zallmann
d2620faff9 Updates based on MR comments 2017-10-05 16:29:45 +02:00
Tim Zallmann
1b75296875 Fixed Linting errors + tests 2017-10-04 14:27:09 +02:00
Tim Zallmann
892b02e890 Created group_icon and group_icon_url
Tests for these new helper methods
2017-10-04 14:27:09 +02:00
Tim Zallmann
79c80de99d Making private project avatars use local paths + Some Group Icons 2017-10-04 14:26:33 +02:00
blackst0ne
29a3203b3f Use relative paths for group/project/user avatars 2017-05-10 15:26:17 +11:00