Commit Graph

804 Commits

Author SHA1 Message Date
Valery Sizov 72b7d1f59d emoji aliases problem 2015-12-11 13:17:12 +02:00
Douwe Maan cd97dba2a9 Merge branch 'zj/gitlab-ce-copying-file-seen-as-licence' 2015-12-11 10:33:03 +01:00
Zeger-Jan van de Weg 82d2e5c3c5 Merge branch 'master' into copying-file-seen-as-licence 2015-12-10 16:27:26 +01:00
Zeger-Jan van de Weg 5fd280f3d3 Licence also accepted as license file 2015-12-10 16:26:25 +01:00
Valery Sizov e3ee46a13b Don't allow to edit award emoji comments 2015-12-10 14:39:37 +02:00
Douwe Maan 73c59de062 Merge branch 'master' into split-up-builds 2015-12-09 13:56:26 +01:00
Douwe Maan 1e8d703a85 Tag model specs 2015-12-09 10:50:51 +01:00
Douwe Maan eab086bde1 Merge branch 'master' into merge-if-green
# Conflicts:
#	app/controllers/projects/merge_requests_controller.rb
#	config/routes.rb
2015-12-09 09:00:25 +01:00
Stan Hu 9dbc768db8 Update annotations 2015-12-08 21:00:01 -08:00
Douwe Maan 75486f09c4 Merge branch 'master' into zj/gitlab-ce-merge-if-green 2015-12-08 13:43:45 +01:00
Robert Speicher 9321d382bd Add custom NamespaceValidator 2015-12-07 16:57:26 -05:00
Robert Speicher e48391b813 Add custom ColorValidator 2015-12-07 16:57:26 -05:00
Robert Speicher d5ea93469b Add custom UrlValidator 2015-12-07 16:57:26 -05:00
Dmitriy Zaporozhets 949a7e8e20 Merge branch 'report-ssl-errors' of https://gitlab.com/stanhu/gitlab-ce 2015-12-07 20:17:29 +01:00
Valery Sizov bd5fb1b479 Merge branch 'webhook_payload_with_changes' into 'master'
Add added, modified and removed properties to commit object in webhook

https://gitlab.com/gitlab-org/gitlab-ee/issues/20

See merge request !1988
2015-12-07 14:43:13 +00:00
Valery Sizov 3c97cbc74c fixes after review 2015-12-07 15:13:06 +02:00
Valery Sizov 5df2c4419c fox specs 2015-12-07 14:14:35 +02:00
Douwe Maan 6368717852 Merge branch 'issue_1156' 2015-12-07 12:07:22 +01:00
Zeger-Jan van de Weg 0e96d6eb10 Merge branch 'master' into merge-if-green 2015-12-07 10:06:07 +01:00
Zeger-Jan van de Weg 46278ec7ba Button fix 2015-12-07 09:59:16 +01:00
Zeger-Jan van de Weg 2462a96e45 Incorporate feedback 2015-12-05 15:42:38 +01:00
Stan Hu a120b78940 Handle and report SSL errors in Web hook test. Check for status 200 for success.
If a Web hook test fails due to an SSL error or some other error, report
the result back to the user instead of an Error 500.

Closes #3656

Handle response
2015-12-04 07:13:28 -08:00
Valery Sizov 5c1b49f494 Add added, modified and removed properties to commit object in webhook 2015-12-04 16:23:21 +02:00
Rubén Dávila 338eb2c41e Call update hook from new GitHooksService class. #3069 2015-12-03 09:39:15 -05:00
Rubén Dávila 5145706c82 Run custom Git hooks when creating or deleting branches through the UI. #1156 2015-12-03 09:39:15 -05:00
Douwe Maan 928d131e39 Merge branch 'master' into link-refs 2015-12-03 13:32:42 +01:00
Rubén Dávila f94afdbdb2 Fix broken spec related to MySQL and fractional seconds support. 2015-12-03 09:30:50 +02:00
Zeger-Jan van de Weg a7682f8775 Specs for 'Merge When Build Succeeds' 2015-12-02 13:27:16 +01:00
Douwe Maan 60828ab40e Merge branch 'master' into link-refs 2015-12-02 12:12:03 +01:00
Douwe Maan 62c14ba2ed Render commit reference using short sha, but include full sha in comment. 2015-12-01 12:58:45 +01:00
Douwe Maan 4a0ebccf6b Fix specs 2015-11-30 22:43:54 +01:00
Douwe Maan a7be01cd07 Render commit range reference with short shas, link to full shas. 2015-11-30 21:10:52 +01:00
Valery Sizov e0131c5d07 Merge branch 'rails_update_to_4_2' into 'master'
Rails update to 4.2.4

https://gitlab.com/gitlab-org/gitlab-ce/issues/2694

See merge request !1902
2015-11-30 16:49:09 +00:00
Valery Sizov e92ceb7b57 fix specs 2015-11-30 16:12:31 +02:00
Jose Corcuera b9df1a6355 Strip attributes for Milestone and Issuable. #3428 2015-11-26 10:16:50 -05:00
Yorick Peterse d496a6b919 Handle removed source projects in MR CI commits
When calling MergeRequest#ci_commit the code would previously raise an
error if the source project no longer existed (e.g. because the user
removed their fork).

See #3599 for more information.
2015-11-20 23:43:10 +01: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 22bbb379ae fox tests 2015-11-19 23:00:30 +02:00
Valery Sizov 671a49cfd5 added specs 2015-11-19 14:41:05 +02:00
Valery Sizov 23c5473cc0 added spinach tests 2015-11-19 13:20:09 +02:00
Valery Sizov fd2c0fe446 award emoji 2015-11-19 01:25:27 +02:00
Yorick Peterse e116a356b8 Refactor User#authorized_groups/projects
These methods no longer include public groups/projects (that don't
belong to the actual user) as this is handled by the various finder
classes now. This also removes the need for passing extra arguments.

Note that memoizing was removed _explicitly_. For whatever reason doing
so messes up the users controller to a point where it claims a certain
user does _not_ have access to certain groups/projects when it does have
access. Existing code shouldn't be affected as these methods are only
called in ways that they'd run queries anyway (e.g. a combination of
"any?" and "each" which would run 2 queries regardless of memoizing).
2015-11-18 13:05:45 +01: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
Yorick Peterse a74d6d2043 Group methods for filtering public/visible groups
These methods will be used to get a list of groups, optionally
restricted to only those visible to a given user.
2015-11-18 13:05:45 +01:00
Yorick Peterse 01620dd7e7 Added Event.limit_recent
This will be used to move some querying logic from the users controller
to the Event model (where it belongs).
2015-11-18 13:05:45 +01:00
Yorick Peterse 5fcd9986b8 Refactor getting user groups/projects/contributions
This new setup no longer loads any IDs into memory using "pluck",
instead using SQL UNIONs to merge the various datasets together. This
results in greatly improved query performance as well as a reduction of
memory usage.

The old setup was in particular problematic when requesting the
authorized projects _including_ public/internal projects as this would
result in roughly 65000 project IDs being loaded into memory. These IDs
would in turn be passed to other queries.
2015-11-18 13:05:45 +01:00
Yorick Peterse 054f2f98ed Faster way of obtaining latest event update time
Instead of using MAX(events.updated_at) we can simply sort the events in
descending order by the "id" column and grab the first row. In other
words, instead of this:

    SELECT max(events.updated_at) AS max_id
    FROM events
    LEFT OUTER JOIN projects   ON projects.id   = events.project_id
    LEFT OUTER JOIN namespaces ON namespaces.id = projects.namespace_id
    WHERE events.author_id IS NOT NULL
    AND events.project_id IN (13083);

we can use this:

    SELECT events.updated_at AS max_id
    FROM events
    LEFT OUTER JOIN projects   ON projects.id   = events.project_id
    LEFT OUTER JOIN namespaces ON namespaces.id = projects.namespace_id
    WHERE events.author_id IS NOT NULL
    AND events.project_id IN (13083)
    ORDER BY events.id DESC
    LIMIT 1;

This has the benefit that on PostgreSQL a backwards index scan can be
used, which due to the "LIMIT 1" will at most process only a single row.
This in turn greatly speeds up the process of grabbing the latest update
time. This can be confirmed by looking at the query plans. The first
query produces the following plan:

    Aggregate  (cost=43779.84..43779.85 rows=1 width=12) (actual time=2142.462..2142.462 rows=1 loops=1)
      ->  Index Scan using index_events_on_project_id on events  (cost=0.43..43704.69 rows=30060 width=12) (actual time=0.033..2138.086 rows=32769 loops=1)
            Index Cond: (project_id = 13083)
            Filter: (author_id IS NOT NULL)
    Planning time: 1.248 ms
    Execution time: 2142.548 ms

The second query in turn produces the following plan:

    Limit  (cost=0.43..41.65 rows=1 width=16) (actual time=1.394..1.394 rows=1 loops=1)
      ->  Index Scan Backward using events_pkey on events  (cost=0.43..1238907.96 rows=30060 width=16) (actual time=1.394..1.394 rows=1 loops=1)
            Filter: ((author_id IS NOT NULL) AND (project_id = 13083))
            Rows Removed by Filter: 2104
    Planning time: 0.166 ms
    Execution time: 1.408 ms

According to the above plans the 2nd query is around 1500 times faster.
However, re-running the first query produces timings of around 80 ms,
making the 2nd query "only" around 55 times faster.
2015-11-18 13:02:43 +01:00
Zeger-Jan van de Weg 53b285c9a8 Merge branch 'master' into merge-if-green 2015-11-18 11:58:01 +01:00
Zeger-Jan van de Weg 2f048df4a4 API support, incorporated feedback 2015-11-18 11:17:41 +01:00
Douwe Maan c12d0b4d2a Merge branch 'rs-wiki-touches-project' into 'master'
Make ProjectWiki touch Project#last_activity_at after wiki actions

Closes #3026

See merge request !1803
2015-11-17 08:48:29 +00:00