Commit Graph
603 Commits
Author SHA1 Message Date
Robert Speicher 66e6052b93 Merge branch 'check-import-job-status' into 'master'
Check and report import job status to help diagnose issues with forking

There are no functional changes, but adding checks/logs for Sidekiq job IDs to help track down why many users seem to get stuck fork/import jobs.

See merge request !3672
2016-04-12 18:07:33 +00:00
Stan Hu c162e0278c Check and report import job status to help diagnose issues with forking 2016-04-11 23:07:06 -07:00
Douglas Barbosa Alexandre 7afeace354 Merge branch 'master' into decouple-member-notification 2016-04-08 15:48:09 -03:00
Douwe Maan f505c753b0 Merge branch 'fix_remove_fork_link' into 'master'
Remove fork link closes all merge requests opened on source project

Currently, if you:

- create a fork
- open a merge request on the source project
- remove the fork link

The created MR cannot be closed.

With this MR, all pending MR is closed when the fork link is removed.

See merge request !3189
2016-04-04 15:37:08 +00:00
Yorick Peterse 84b0ab7766 Added & use Gitlab::Routing for URL helpers
Rails' "url_helpers" method creates an anonymous Module (which a bunch
of methods) on every call. By caching the output of this method in a
dedicated method we can shave off about 10 seconds of loading time for
an issue with around 200 comments.
2016-04-01 11:13:48 +02:00
Zeger-Jan van de Weg 1e7116b34d Exclude projects pending deletion from all results 2016-03-31 20:20:18 +02:00
Dmitriy Zaporozhets b8f3843790 Update NotificationService to use NotificationSettings instead of membership
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00
Lin Jen-Shin ecc060d701 Make sure we get only two returns 2016-03-23 20:22:09 +08:00
Baldinof fa4126acff Move unlink fork logic to a service 2016-03-22 15:34:35 +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
James Lopez cae864a12e Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/safe-import-url 2016-03-21 18:52:55 +01:00
James Lopez 4196ee0661 update safe_import_url to prevent tokens to be showed by the UI 2016-03-21 18:52:21 +01:00
Douwe Maan b689e2c0e0 Fix spec 2016-03-21 00:42:30 +01:00
Douwe Maan 45e8650c4f Fix specs 2016-03-20 23:26:58 +01:00
Douwe Maan 7c51d5efec Fix some specs 2016-03-20 22:55:08 +01:00
Douwe Maan 8db1292139 Tweaks, refactoring, and specs 2016-03-20 21:04:07 +01:00
Douwe Maan 2eb19ea3ea Merge branch 'master' into issue_12658 2016-03-20 14:57:25 +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
Yorick Peterse cd05d3f78d Cache project avatars stored in Git
The avatar logic has been moved from Project to Repository as this makes
caching easier. The logic itself in turn has been changed so that the
logo file names are cached in Redis. This cache is flushed upon pushing
a commit but _only_ if:

1. The commit was pushed to the default branch
2. The commit actually changes any of the logo files

If no branch or commit is given the cache is flushed anyway, this
ensures that calling Repository#expire_cache without any arguments still
flushes the avatar cache (e.g. this is used when removing a project).

Fixes gitlab-org/gitlab-ce#14363
2016-03-17 18:51:54 +01:00
Felipe Artur 44c127447b Merge 4009-external-users into issue_12658 2016-03-16 20:16:42 -03:00
Zeger-Jan van de Weg 59064aeeef Merge branch 'master' into 4009-external-users 2016-03-15 19:16:16 +01:00
Robert Speicher 178c80a561 Merge branch 'fix-activerecord-join-stupidity' into 'master'
Ignore eager loading in Project.search UNION

This fixes issues such as filtering groups by names on pages such as
https://gitlab.com/dashboard/groups.

See merge request !3229
2016-03-15 16:25:02 +00: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
Kamil Trzcinski c51c901916 Return the external issue tracker even if it's null
This solves the problem with caching the nil value with instance variable.
Without this the every time we ask for external_issue_tracker we built AR and potentially do SQL query
2016-03-15 11:06:50 +01:00
Baldinof 436caf4e8b Merge branch 'master' into fix_remove_fork_link 2016-03-14 21:51:06 +01:00
Zeger-Jan van de Weg 88f8d3a4d6 Merge branch 'master' into 4009-external-users 2016-03-14 20:08:02 +01:00
Dmitriy Zaporozhets d324bf8434 Merge branch 'share-project-ce' into 'master'
Bring from EE: Share Project with Group

- [x] Models and migrations
- [x] Logic, UI
- [x] Tests
- [x] Documentation
- [x] Share with group lock
- [x] Api feature
- [x] Api docs
- [x] Api tests

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

For #12831 

cc @DouweM @rspeicher @vsizov

See merge request !3186
2016-03-14 16:38:52 +00:00
Zeger-Jan van de Weg fc8d64b3a0 Remove Project#publicish 2016-03-13 19:08:04 +01:00
Douwe Maan 34e8c56236 Merge branch 'fix/token-timing-attack' into 'master'
fix token issue - timing attack

Updates token comparisons to use a secure version instead of `==`

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/13617

See merge request !3062
2016-03-12 12:14:32 +00:00
Baldinof e8c723543c Close merge requests when removing fork relation 2016-03-11 21:37:57 +01:00
Yorick PeterseandRobert Speicher d7d5937531 Removed arel_table receiver from search methods
We can just use "arel_table" in these cases instead of
"SomeClass.arel_table".
2016-03-11 15:25:23 -05: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
Dmitriy Zaporozhets 9a95b15552 Add share project from group lock
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-11 19:03:19 +01:00
Dmitriy Zaporozhets 746ac56b6f Add functionality to setup share of project with group via project settings
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-11 18:37:46 +01:00
Dmitriy Zaporozhets ea5f4cae53 Bring ProjectGroupLink model and migrations from EE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-11 17:47:05 +01:00
Yorick Peterse f2992cf343 Optimize Project#ci_service(s)
The method Project#ci_services would load all services into memory
(including _all_ their columns) and then use Enumerable#select to reduce
the list. Project#ci_service in turn would further reduce this list down
to just 1 Service instance.

Instead of doing all this in Ruby we can just offload the work to the
database, reducing the amount of time spent in these methods. These
changes reduce the time of the first call to Project#ci_services from
around 240 ms to around 10 ms, though the final timings will vary based
on database load. Because Project#ci_service is memoized there's no
further overhead introduced by using a database query.

Fixes gitlab-org/gitlab-ce#14186
2016-03-10 15:32:31 +01: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
Felipe Artur 5551ccd720 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
James Lopez fc610c182e add SHA256 to secure_compare 2016-03-08 15:57:45 +01:00
James Lopez ecb1c59665 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/token-timing-attack 2016-03-08 15:55:04 +01:00
Rubén Dávila 95b06a62c0 Updates from last code review. 2016-03-06 23:07:19 -05:00
Rubén Dávila a056dfa9a0 Refactor GlobalMilestone queries.
Make methods return ActiveRecord Relations instead of Arrays.
2016-03-04 22:37:03 -05:00
Rémy Coutable 00cb4a9714 Merge branch 'renaming-repository-caching' into 'master'
Flush repository caches before renaming projects

This should hopefully solve gitlab-org/gitlab-ce#13790. Once I know the exact steps to reproduce the problem I should be able to confirm this.

cc @dblessing @inem 

See merge request !2974
2016-03-03 15:35:11 +00:00
Rubén Dávila 0b86b46a2c Don't list issues from archived projects in Group view. 2016-03-02 12:51:29 -05:00
James Lopez 70623cd423 fix token issue - timing attack 2016-03-02 12:18:43 +01: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