Commit Graph

3930 Commits

Author SHA1 Message Date
Douglas Barbosa Alexandre aa30088f6e Fix old version warning when viewing wiki latest version via version_id 2016-01-29 14:17:00 -02: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
Douwe Maan 9ae820ad2e Merge branch 'rs-issue-12677' into 'master'
Update text_color_for_bg helper to support RGB triplet color codes

Closes #12677

See merge request !2587
2016-01-26 12:02:42 +00:00
Douwe Maan 28e2d2142c Merge branch 'rs-groups-index' into 'master'
Make the `/groups` route behave as expected

The route is supposed to redirect the Groups#index request based on
whether or not a user was logged in. If they are, we redirect them to
their groups dashboard; if they're not, we redirect them to the public
Explore page.

But due to overly aggressive `before_action`s that weren't excluding (or including) the
`index` action, the request always resulted in a 404, whether a user was
logged in or not.

Closes #12660

See merge request !2580
2016-01-26 11:59:05 +00:00
Grzegorz Bizon 5583b9526b Add specs for build created using generic commit status 2016-01-26 08:34:48 +01:00
Douglas Barbosa Alexandre 6dd88e090e Extract Projects::ImportService service from RepositoryImportWorker 2016-01-25 22:58:30 -02:00
Robert Speicher fd33b2cdc0 Merge branch 'fix-import-redirect-loop' into 'master'
Fix import redirect loop

Fixes #11864 

See merge request !2606
2016-01-26 00:48:56 +00:00
Douglas Barbosa Alexandre cae0929a28 Merge branch 'instrumentation-signature' into 'master'
Correct arity for instrumented methods w/o args

This should fix the problem of imports not working. See https://gitlab.com/gitlab-org/gitlab-ce/issues/12450#note_3380730 for the details/context of these changes.

See merge request !2602
2016-01-26 00:04:09 +00:00
Robert Speicher 5516d2e4ee Merge branch 'rs-rails-security' into 'master'
Update rails, rails-html-sanitizer, and nokogiri for security fixes

See https://dev.gitlab.org/gitlab/gitlabhq/issues/2643

See merge request !2603
2016-01-25 23:22:24 +00:00
Douglas Barbosa Alexandre 46c36e0e01 Fixi import redirect loop 2016-01-25 21:00:23 -02:00
Robert Speicher 47ff1c5608 Add temporary monkey patch to get specs passing on 4.2.5.1 2016-01-25 14:53:28 -08:00
Yorick Peterse b74308c0a7 Correct arity for instrumented methods w/o args
This ensures that an instrumented method that doesn't take arguments
reports an arity of 0, instead of -1.

If Ruby had a proper method for finding out the required arguments of a
method (e.g. Method#required_arguments) this would not have been an
issue. Sadly the only two methods we have are Method#parameters and
Method#arity, and both are equally painful to use.

Fixes gitlab-org/gitlab-ce#12450
2016-01-25 21:28:59 +01:00
Douglas Barbosa Alexandre 1aa82dc459 Prioritize previewable over plain README files 2016-01-25 11:27:07 -02:00
James Lopez ee209cc936 fix rubocop new 2.2 syntax issues 2016-01-25 11:44:25 +01:00
Douwe Maan 0f2a906211 Merge branch 'update-gitlab-git' into 'master'
Update gitlab_git & use new method for counting branches

Corresponding gitlab_git merge request detailing some of the rationale behind this: https://gitlab.com/gitlab-org/gitlab_git/merge_requests/62

Fixes #12418 

See merge request !2535
2016-01-25 09:35:54 +00:00
Robert Speicher 2e911721d2 Update text_color_for_bg helper to support RGB triplet color codes
Closes #12677
2016-01-24 15:06:46 -08:00
Robert Speicher fcab1345da Update wording for 2FA requirement notice 2016-01-23 17:56:18 -08:00
Robert Speicher a7c4d0da8c Make the `/groups` route behave as expected
The route is supposed to redirect the Groups#index request based on
whether or not a user was logged in. If they are, we redirect them to
their groups dashboard; if they're not, we redirect them to the public
Explore page.

But due to overly aggressive `before_action`s that weren't excluding the
`index` action, the request always resulted in a 404, whether a user was
logged in or not.

Closes #12660
2016-01-23 16:10:13 -08:00
Benedict Etzel 6435f78a8c Whitelist raw "abbr" elements when parsing Markdown
Closes #12517
2016-01-23 20:38:06 +01:00
Dmitriy Zaporozhets 56b527093d Merge branch 'fix-comment-on-diff-ajax-loading' 2016-01-22 10:20:19 -08:00
Robert Speicher 3f5e6c6cf6 Merge branch 'ci/recursive-artifacts-entries' into 'master'
Add method to calculate total size of artifacts in subpath

See merge request !2500
2016-01-21 23:23:02 +00:00
Yorick Peterse 0689663487 Use branch_count in Repository#has_visible_content?
Gitlab::Git::Repository#branch_count is a tad faster than the previous
setup. See gitlab-org/gitlab_git!62 for more information.
2016-01-21 18:19:18 +01:00