Commit graph

21 commits

Author SHA1 Message Date
Semyon Pupkov
def3ab2971 Fix rubocop Style/ZeroLengthPredicate 2018-09-18 14:31:17 +05:00
gfyoung
50abbd3e53 Enable frozen string in app/models/*.rb
Partially addresses #47424.
2018-07-26 16:55:41 -07:00
Yorick Peterse
6f292eaa69
Revert the addition of goldiloader
This reverts the addition of the "goldiloader" Gem and all use of it.
While this Gem is very promising it's causing a variety of problems on
GitLab.com due to it eager-loading too much data in places where we
don't expect/can handle this. At least for the time being this means we
have to go back to manually fixing N+1 query problems, but at least
those should not cause a negative impact on availability.
2018-04-18 15:51:39 +02:00
Sean McGivern
4ef3e3491e Add cop for has_many :through without disabled autoloading
Goldiloader is great, but has several issues with has_many :through relations:

* https://github.com/salsify/goldiloader/issues/12
* https://github.com/salsify/goldiloader/issues/14
* https://github.com/salsify/goldiloader/issues/18

Rather than try to figure out which applies in each case, we should just do the
drudge work of manually disabling autoloading for all relations of this type. We
can always use regular preloading for specific cases, but this way we avoid
generating invalid queries through Goldiloader's magic.
2018-04-09 12:47:04 +01:00
Douwe Maan
7bca902a23 Fall back on ghost user when deploy key user is not set 2018-03-28 18:54:15 +02:00
Douwe Maan
536a47b4b7 Merge branch 'sh-migrate-can-push-to-deploy-keys-projects-10-3' into 'security-10-3'
[10.3] Migrate `can_push` column from `keys` to `deploy_keys_project`

See merge request gitlab/gitlabhq!2276

(cherry picked from commit f6ca52d31bac350a23938e0aebf717c767b4710c)

1f2bd3c0 Backport to 10.3
2018-01-16 17:04:51 -08:00
haseeb
cc2daa74d8 created services for keys 2017-09-15 15:35:24 +00:00
Yorick Peterse
8fbbf41e29
Added Cop to blacklist the use of dependent:
This is allowed for existing instances so we don't end up 76 offenses
right away, but for new code one should _only_ use this if they _have_
to remove non database data. Even then it's usually better to do this in
a service class as this gives you more control over how to remove the
data (e.g. in bulk).
2017-07-06 12:01:36 +02:00
Lin Jen-Shin
2489332297 Don't notify user for deploy keys, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18517263
2016-11-18 01:23:04 +08:00
Lin Jen-Shin
a9765fb47f Introduce has_access_to? so that we could reuse it
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18439108
2016-11-16 20:31:23 +08:00
Lin Jen-Shin
71ae01fefe Add more tests and fix write to project check 2016-11-11 21:44:33 +08:00
Jeroen van Baarsen
f1479b56b7
Remove the annotate gem and delete old annotations
In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382
2016-05-09 18:00:28 +02:00
Zeger-Jan van de Weg
47da013cf8 Annotate the models 2016-05-06 08:27:46 +02:00
Stan Hu
a3157626f1 Re-annotate models 2015-05-03 13:38:27 -07:00
Douwe Maan
ed097df627 Clean up code. 2015-04-03 12:28:47 +02:00
Douwe Maan
edc4a56d26 Allow admin to create public deploy keys that are accessible to any project. 2015-04-03 12:23:20 +02:00
Dmitriy Zaporozhets
36f861f1b1
Re-annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-09 15:05:03 +03:00
Dmitriy Zaporozhets
8dd37afe34 Reannotate 2013-08-21 12:34:02 +03:00
Dmitriy Zaporozhets
6e35aceff2 Annotated 2013-06-19 15:40:33 +03:00
Dmitriy Zaporozhets
1882baa1aa Feature: Deploy keys between projects 2013-05-06 15:10:55 +03:00
Dmitriy Zaporozhets
543d86f351 Create DeployKey & DeployKeysProject models. Bulding many to many relation between deploy keys and projects 2013-05-06 12:26:36 +03:00