Commit Graph
3950 Commits
Author SHA1 Message Date
Douglas Barbosa Alexandre eefc46e0d5 Fix rubocop offenses 2016-02-02 11:25:44 -02:00
Douglas Barbosa Alexandre 718b1dddfe Refactor Admin::SpamLogsController to block user before destroying 2016-02-02 11:25:44 -02:00
Douglas Barbosa Alexandre a2bbf00477 Refactor spam filtering on issues API 2016-02-02 11:25:44 -02:00
Douglas Barbosa Alexandre e38a1fc83e Fix typo on User model 2016-02-02 11:25:44 -02:00
Douglas Barbosa Alexandre 80d0a2a6d8 Add model spec for SpamLog 2016-02-02 11:25:44 -02:00
Douglas Barbosa Alexandre 64c9768bd6 Use truncate helper on spam logs list 2016-02-02 11:25:44 -02:00
Stan HuandDouglas Barbosa Alexandre d20e75a8d8 Support Akismet spam checking for creation of issues via API
Currently any spam detected by Akismet by non-members via API will be logged
in a separate table in the admin page.

Closes #5612
2016-02-02 11:25:44 -02:00
Douwe Maan 6cffcb0588 Merge branch 'allow-@' into 'master'
Allow "@" in file names and path

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

See merge request !2665
2016-02-02 12:30:57 +00:00
Robert Speicher 933834c4a6 Allow manual resize of js-autosize textareas
First, the autosize library was being too controlling and removed the
`resize` property from any elements to which it was attached, removing
the drag handle.

Second, we detect when the user manually resizes an autosize textarea,
and then remove the autosize behavior from it and increase its
max-height.

This should allow for the best of both worlds.

Closes #12832
2016-02-01 17:00:03 -05:00
Robert Speicher f8052310ad Merge branch 'merge-request-closes-issues-performance' into 'master'
Optimize fetching issues closed by a merge request

Related issue: #12419

See merge request !2625
2016-02-01 15:32:58 -05:00
Stan HuandRémy Coutable f86ddfd365 Render sanitized SVG images
Closes https://github.com/gitlabhq/gitlabhq/issues/9265
2016-02-01 18:25:32 +01:00
Jacob Vosmaer 72bd004b31 Allow "@" in file names and path 2016-02-01 16:20:49 +01:00
Yorick Peterse 99492d6b8d Optimize fetching issues closed by a merge request
Instead of running ClosingIssueExtractor for every commit in a merge
request we can gather all the commit messages (and the merge request
description), concatenate all this together and then run
ClosingIssueExtractor only once.

The result of this is that MergeRequest#closes_issues is now between
3.5x and 4x faster than the old setup. Using a merge request with 10
commits (each referencing a number of issues to close) this reduced the
call duration from around 200 milliseconds to around 50 milliseconds.

As a result of these changes the Jira related tests for
MergeRequest#closes_issues have been removed. These tests stubbed
Commit#closes_issues meaning that the only code that was really tested
was the call to Array#uniq to filter out duplicate issues. As this code
is no longer used (nor present) the corresponding tests were removed.

Related: gitlab-org/gitlab-ce#12419
2016-02-01 11:04:05 +01:00
Robert Speicher 5d4f8012f6 Merge branch 'rename-inline-diff' into 'master'
Mark inline difference between old and new paths when a file is renamed

See merge request !2652
2016-01-31 03:04:33 +00:00
Douwe Maan d240876aba Merge branch 'rs-issue-12706' into 'master'
Increase the minimum length for commit SHA matching to 7

This is the git default and will help to prevent false positive matches.

Closes #12706

See merge request !2655
2016-01-30 12:00:36 +00:00
Douwe Maan fa0cbb1399 Fix specs and add a new one 2016-01-30 12:53:12 +01:00
Dmitriy Zaporozhets f862b4ae0f Merge remote-tracking branch 'origin/background-delete-process' 2016-01-30 12:14:48 +01:00
Robert Speicher d97742570f Increase the minimum length for commit SHA matching to 7
This is the git default and will help to prevent false positive matches.

Closes #12706
2016-01-29 19:52:29 -05:00
Douwe Maan 677b4db9e6 Mark inline difference between old and new paths when a file is renamed 2016-01-29 19:37:17 +01:00
Douglas Barbosa Alexandre aa30088f6e Fix old version warning when viewing wiki latest version via version_id 2016-01-29 14:17:00 -02:00
Josh Frye 91b9cbff8d First pass at deleting projects in the background. 2016-01-29 09:14:16 -05:00
Dmitriy Zaporozhets 227728712e Merge branch 'note-background-job' into 'master'
Background process note logic for #3948

Quick and dirty way to get *most* of the note processing out of band and into the background. Seeing some pretty nice speed bumps. Keep in mind that doing this in process results in slower and slower responses as more notes are added and more participants exist.

```
without background processing
  Completed 200 OK in 627ms (Views: 0.5ms | ActiveRecord: 32.3ms)
  Completed 200 OK in 478ms (Views: 0.8ms | ActiveRecord: 28.3ms)
  Completed 200 OK in 1107ms (Views: 0.6ms | ActiveRecord: 36.6ms)

with background processing
  Completed 200 OK in 108ms (Views: 0.6ms | ActiveRecord: 4.7ms)
  Completed 200 OK in 78ms (Views: 0.5ms | ActiveRecord: 4.5ms)
  Completed 200 OK in 164ms (Views: 0.5ms | ActiveRecord: 8.3ms)
```

As you can see, speeds are consistent when doing the harder work out of process. I'm not sure the number of sql queries we're saving, but based on the logs alone it's a pretty good amount.

@dzaporozhets @yorickpeterse I would love some input on this.

See merge request !2631
2016-01-29 13:51:34 +00:00
Dmitriy Zaporozhets e221990eba Merge branch 'rs-remove-ip-blocking' into 'master'
Partially revert "Add IP check against DNSBLs at account sign-up"

This partially reverts 6a5cd3ca - we keep the migration and add a new
migration that reverts it in order to keep migration history intact.

See merge request !2643
2016-01-29 13:31:33 +00:00
Dmitriy Zaporozhets f5860ce646 Merge branch 'rs-transient-capybara-timeout' into 'master'
Prevent transient Capybara timeouts during feature tests

The problem occurred because asset compilation takes a long time, so
when the asset cache didn't exist and the first test ran, it would often
(randomly) time out during the generation before the actual test even
had a chance to run.

Now we check if the cache exists before the suite runs, and if not, we
manually fire a request to the root URL in order to generate it. This
should allow subsequent tests to use the cached assets.

See merge request !2646
2016-01-29 09:53:04 +00:00
Marin Jankovski 9d0065f054 Merge branch 'hotfix/ruby-21-broken-update' into 'master'
fix syntax error on 2.1 and rubocop on 2.2

Background:

Hashes `{:'key': 'value'}` are not valid in 2.1 but are recommended by Rubocop on 2.2. We only use those when we have a key such as `weird-key`, `weird.key`, etc... 

We could disable Rubocop but it wouldn't warn us about the recommended syntax since `Ruby 1.9`: `{key: 'value'}`, which is valid for `Ruby 1.9+`.

Workaround 1 could be disabling `Style/HashSyntax:` in `rubocop.yml`. 

Workaround 2 (tried in this MR) is to trick Rubocop using `.to_sym` which is effectively the same as adding the `:`. This would allow to keep the warning in place.

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

See merge request !2637
2016-01-29 08:12:18 +00:00
Robert Speicher bbe0fa91d0 Prevent transient Capybara timeouts during feature tests
The problem occurred because asset compilation takes a long time, so
when the asset cache didn't exist and the first test ran, it would often
(randomly) time out during the generation before the actual test even
had a chance to run.

Now we check if the cache exists before the suite runs, and if not, we
manually fire a request to the root URL in order to generate it. This
should allow subsequent tests to use the cached assets.
2016-01-28 20:56:49 -05:00
Robert Speicher ca05054ea2 Partially revert "Add IP check against DNSBLs at account sign-up"
This partially reverts 6a5cd3ca - we keep the migration and add a new
migration that reverts it in order to keep migration history intact.
2016-01-28 16:28:19 -05:00
Robert Speicher 2b1ddb0f80 Merge branch 'mr-merge-base' into 'master'
Correctly determine MR diff base when MR has merge conflicts

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

See merge request !2632
2016-01-28 21:08:41 +00:00
Robert Speicher 0e79b5f396 Merge branch 'highlight-blame' into 'master'
Fix highlighting in blame view.

See merge request !2630
2016-01-28 20:30:21 +00:00
Josh Frye f3d4f2eac7 Fix Rubocop error 2016-01-28 14:44:45 -05:00
Josh Frye c95bc65519 Update tests 2016-01-28 13:04:42 -05:00
James Lopez 69c4e0a119 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into hotfix/ruby-21-broken-update 2016-01-28 18:14:28 +01:00
Dmitriy Zaporozhets 88e16c3d19 Merge branch 'issue_2406' into 'master'
Show list of forks for a given Project

Closes #2406

See merge request !2376
2016-01-28 16:58:38 +00:00
Douwe Maan b7ec476205 Merge branch 'master' into mr-merge-base 2016-01-28 15:12:24 +01:00
Douwe Maan 30b0d06e9f Fix specs 2016-01-28 15:10:48 +01:00
Douwe Maan 590e237d55 Merge branch 'master' into highlight-blame 2016-01-28 14:49:34 +01:00
Douwe Maan b636f83e59 Move blame group logic to dedicated class 2016-01-28 14:49:21 +01:00
Dmitriy Zaporozhets dfb8803c1c Improve consistency and duplication for Merge Request API
* Follow REST for merge request API route
* Remove repeating comments API for MR

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-01-28 14:26:12 +01:00
James Lopez 902baa2e1c trick rubocop and temporarily add ruby 2.1 images for any branch 2016-01-28 11:41:58 +01:00
Douwe Maan f025f80d5c Merge branch 'update-ruby-2.2.4' into 'master'
Update Ruby version to 2.2.4 (latest previous stable) and update docs

Tests and issues added to https://github.com/gitlabhq/gitlabhq/issues/8696 were all fine after the upgrade. 

Main issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/3340

See merge request !2534
2016-01-27 21:39:08 +00:00
Robert Speicher bba7e786a6 Merge branch 'events-performance' into 'master'
Improve performance of retrieving last update times for events

See 75195eefcca4cb3961986c90c8e837da02f30134 and
https://gitlab.com/gitlab-org/gitlab-ce/issues/12415#note_3387317
for the juicy details.

Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/12415

See merge request !2613
2016-01-27 21:20:16 +00:00
Robert Speicher 40403c78ef Merge branch 'fix-ci-runners-version-update' into 'master'
Fix CI runner version not being properly updated when asked for a build

Due to broken implementation of attribute_for_keys the runner information was not updated correctly.

This MR adds test to check that such scenario will never happen again.

See merge request !2618
2016-01-27 20:50:24 +00:00
Dmitriy Zaporozhets 7e6da7b91a Merge branch 'rs-2fa-requirement-wording' into 'master'
Update wording for 2FA requirement notice



See merge request !2582
2016-01-27 19:04:44 +00:00
James Lopez 683770f35d Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into update-ruby-2.2.4 2016-01-27 15:42:35 +01:00
Kamil Trzcinski 95d2f0fb51 Fix CI runner version not being properly updated when asking for a build
Due to broken implementation of attribute_for_keys the runner information was not updated correctly.

This MR adds test to check that such scenario will never happen again.
2016-01-27 12:04:54 +01:00
Yorick Peterse de7c9c7ab1 Use Atom update times of the first event
By simply loading the first event from the already sorted set we save
ourselves extra (slow) queries just to get the latest update timestamp.
This removes the need for Event.latest_update_time and significantly
reduces the time needed to build an Atom feed.

Fixes gitlab-org/gitlab-ce#12415
2016-01-27 10:33:33 +01:00
Kamil Trzciński 5e0ee54c6c Merge branch 'fix/commit-status-artifacts' into 'master'
Use generic method to checks if artifacts are available

Closes #12626

See merge request !2576
2016-01-27 09:07:47 +00:00
Blake Hitchcock 4be65c3231 Update ExternalIssue regex for JIRA integration
The pattern in the `::reference_pattern` class method in the
ExternalIssue model does not match all valid forms of JIRA project
names. I have updated the regex to match JIRA project names with numbers
and underscores. More information on valid JIRA project names can be
found here:
https://confluence.atlassian.com/jira/changing-the-project-key-format-192534.html

* The first character must be a letter,
* All letters used in the project key must be from the Modern Roman Alphabet and upper case, and
* Only letters, numbers or the underscore character can be used.
2016-01-26 15:55:40 -05:00
Grzegorz Bizon 9661765127 Update commit status factory to reflect recent changes 2016-01-26 15:23:57 +01:00
Douwe Maan b6eb416389 Merge branch 'track-project-import-failure' into 'master'
Track project import failure

Fixes #12512 

This also help us on identify why the import process is returning the wrong status when the project was successfully imported. Like mentioned in the issue #12450 

See merge request !2538
2016-01-26 13:33:47 +00:00