Commit Graph
188 Commits
Author SHA1 Message Date
Zeger-Jan van de Weg 1e7116b34d Exclude projects pending deletion from all results 2016-03-31 20:20:18 +02:00
Stan Hu 506878970b Don't attempt to look up an avatar in repo if repo directory does not exist
Closes #14580
2016-03-25 06:30:51 -07:00
Douwe Maan 31266c5be4 Address feedback 2016-03-22 00:09:20 +01:00
Douwe Maan ae7b2ef62c Merge branch 'master' into issue_12658
# Conflicts:
#	app/models/issue.rb
#	app/views/projects/_home_panel.html.haml
#	app/views/shared/projects/_project.html.haml
#	db/schema.rb
#	spec/models/project_spec.rb
2016-03-21 23:22:21 +01:00
Yorick Peterse 68a4c98f50 Cache output of Repository#exists?
This caches the output of Repository#exists? in Redis while making sure
it's flushed properly when creating new repositories, deleting them,
etc.

For the ProjectWiki tests to work I had to make ProjectWiki#create_repo!
public as testing private methods in RSpec is a bit of a pain.
2016-03-19 21:54:08 +01:00
Felipe Artur 8b830b8c3b Fix specs 2016-03-18 21:04:53 -03:00
Zeger-Jan van de WegandFelipe Artur b959ae553b Improve group visibility level feature 2016-03-18 16:58:04 -03:00
Felipe Artur 44c127447b Merge 4009-external-users into issue_12658 2016-03-16 20:16:42 -03:00
Yorick Peterse c742760289 Ignore eager loading in Project.search UNION
The queries that are UNION'd together don't need any eager loading
(since we really only use the resulting SQL instead of having
ActiveRecord actually run the queries). By dropping any eager loaded
associations queries such as the following work instead of producing a
SQL error:

    Project.all.includes(:namespace).search('foo')
2016-03-15 16:46:17 +01:00
Yorick PeterseandRobert Speicher db615d0a79 Use ILIKE in Project.search_by_title
Similar to the changes made to Project.search the method
Project.search_by_title now also uses Arel so it can automatically use
ILIKE/LIKE instead of the lower() function.
2016-03-11 15:25:21 -05:00
Yorick PeterseandRobert Speicher 135659a751 Use ILIKE/LIKE + UNION in Project.search
This chance is broken up in two steps:

1. Use ILIKE on PostgreSQL and LIKE on MySQL, instead of using
   "WHERE lower(x) LIKE lower(y)" as ILIKE is significantly faster than
   using lower(). In many cases the use of lower() will force a slow
   sequence scan.

2. Instead of using 1 query that searches both projects and namespaces
   using a JOIN we're using 2 separate queries that are UNION'd
   together. Using a JOIN would force a slow sequence scan, using a
   UNION avoids this.

This method now uses Arel as Arel automatically uses ILIKE on PostgreSQL
and LIKE on MySQL, removing the need to handle this manually.
2016-03-11 15:25:21 -05:00
Felipe Artur c3e70280df Prevent projects to have higher visibility than groups
Prevent Groups to have smaller visibility than projects
Add default_group_visibility_level to configuration
Code improvements
2016-03-10 10:38:36 -03:00
Douglas Barbosa Alexandre 9e342fb00a Destroy all related todos when removing a project 2016-03-09 11:06:58 -03:00
Robert Speicher b900304c38 Make better use of the visibility_level factory traits 2016-03-08 16:40:45 -05:00
Yorick Peterse 1dfef90a87 Flush repository caches before renaming projects
This ensures that if a project is later re-created using the old path it
doesn't end up re-using the old cache. This also ensures we don't keep
the cache around until its expired by Redis itself.

Fixes gitlab-org/gitlab-ce#13790
2016-02-26 12:36:52 +01:00
Tomasz Maczukin 49d5c35b69 Fix old usages of ci_runner factory 2016-02-19 13:18:49 +01:00
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Tomasz Maczukin c301ab0404 Add some specs for forked project visibility_level cases 2015-12-24 10:33:26 +01:00
Dmitriy Zaporozhets b8570576e8 Merge branch 'add-open-issues-count-to-api' of https://gitlab.com/stanhu/gitlab-ce
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-16 16:08:35 +01:00
Stan Hu 3efae53bd7 Add open_issues_count to project API
This is needed to support Huboard and a generally useful value.
2015-12-11 23:17:36 -08:00
Kamil Trzcinski 513d551c8f Fix after column rename 2015-12-11 18:02:10 +01:00
Kamil Trzcinski 64bfd9d71a Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
Kamil Trzcinski 8cdd54cc06 Add runners token 2015-12-11 18:02:09 +01:00
Kamil Trzcinski e80e3f5372 Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
Douwe Maan 1e8d703a85 Tag model specs 2015-12-09 10:50:51 +01:00
Stan Hu 9dbc768db8 Update annotations 2015-12-08 21:00:01 -08:00
Rubén DávilaandValery Sizov f94afdbdb2 Fix broken spec related to MySQL and fractional seconds support. 2015-12-03 09:30:50 +02:00
Dmitriy Zaporozhets 68d4ab2381 Merge branch 'emoji_votes' into 'master'
Award Emoji

This it first iteration of award emoji feature.
We have plan to extend emoji picker by the next release.

For now, you can add award by clicking to the emoji picker or posting a regular comment with emoji like "👍" and any other. You can post not only emoji that listed in the emoji picker.

See merge request !1825
2015-11-19 21:34:38 +00:00
Valery Sizov fd2c0fe446 award emoji 2015-11-19 01:25:27 +02:00
Yorick Peterse a4fc8112df Added Project.visible_to_user
This method can be used to filter projects to those visible to a given
user.
2015-11-18 13:05:45 +01:00
Kamil Trzcinski 6384c757b7 Expose CI enable option in project features
- Enable CI by default for all new projects
2015-11-13 10:52:50 +01:00
Yorick Peterse b7abba0ca0 Revamp trending projects query
This changes the query to use a COUNT nested in an INNER JOIN, instead
of a COUNT plus a GROUP BY. There are two reasons for this:

1. Using a COUNT in an INNER JOIN can be quite a bit faster.
2. The use of a GROUP BY means that method calls such as "any?"
   (and everything else that calls "count") operate on a Hash that
   counts the amount of notes on a per project basis, instead of just
   counting the total amount of projects.

The query has been moved into Project.trending as its logic is simple
enough. As a result of this testing the TrendingProjectsFinder class
simply involves testing if the right methods are called, removing the
need for setting up database records.
2015-10-06 17:26:32 +02:00
Guilherme Garnier 1cfb48ddd0 Merge remote-tracking branch 'upstream/master' 2015-10-03 11:46:29 -05:00
Guilherme Garnier 848d7b2a2b Fix rubocop warnings in spec/models 2015-10-03 01:48:54 -05:00
Dmitriy Zaporozhets 5de0b07844 Prevent creating 2 Ci::Project entities when enable CI
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-02 10:08:16 +02:00
Douwe Maan 7c7b664c01 Merge branch 'master' into flevour/gitlab-ce-project-path-insensitive-lookup 2015-10-01 12:33:51 +02:00
Kamil Trzcinski 0d877d91e7 Make ensure_gitlab_ci_project return ci_project or create a new one 2015-09-29 10:47:04 +02:00
Kamil Trzcinski 0f3deac362 Fix tests 2015-09-29 10:47:04 +02:00
Dmitriy Zaporozhets 2eb9a20f36 Enable CI for gitlab when .gitlab-ci.yml is pushed
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-23 13:11:40 +02:00
Dmitriy Zaporozhets 21dfaa000d Show CI status on all pages where commits list is rendered
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-23 12:23:04 +02:00
Francesco Levorato 69cb5fba59 Make Project#find_with_namespace case-insensitive 2015-09-18 16:37:21 +02:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 9f10943c1a Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41, reversing
changes made to 6b9dbe9f5a.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:28:42 +02:00
Dmitriy Zaporozhets b48b07044b Merge branch 'master' into drop-satellites
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-04 16:42:36 +02:00
Atsushi Ishida f33898ecfb Re-annotate models 2015-08-03 01:52:54 +09:00
Douwe Maan 72c552c2d4 Fix specs 2015-07-29 13:23:28 +02:00
Dmitriy Zaporozhets a87989fb7d Remove satellites 2015-07-15 15:45:57 +02:00
Robert SpeicherandDmitriy Zaporozhets 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Robert Speicher 47251b85e0 ensure_length_of -> validate_length_of 2015-06-10 01:31:26 -04:00
Robert Speicher c0faf91ff2 Add to_reference for models that support references
Now there is a single source of information for which attribute a model
uses to be referenced, and its special character.
2015-05-26 15:48:30 -04:00