Commit Graph

1959 Commits

Author SHA1 Message Date
Douglas Barbosa Alexandre 795a7ca8f1 Extract GitHub branch formatter 2016-05-13 17:55:42 -05:00
Douglas Barbosa Alexandre e001bd5e3d Import PRs where branch names were reused across PRs 2016-05-13 17:55:42 -05:00
Douglas Barbosa Alexandre 7e1f14e215 Preserve commits/diff/comments for PRs that were merged on GitHub 2016-05-13 17:55:42 -05:00
Kamil Trzcinski f4f59d0f13 Merge branch 'docker-registry' into docker-registry-view 2016-05-13 17:15:01 -05:00
Douglas Barbosa Alexandre 3b50867550 Fix spec for Gitlab::GithubImport::PullRequestFormatter 2016-05-13 16:49:27 -05:00
Douglas Barbosa Alexandre 9b4dc552cb Import pull requests from GitHub where the target branch was removed 2016-05-13 16:49:27 -05:00
Douglas Barbosa Alexandre 8532dc0d77 Import pull requests from GitHub where the source branch was removed 2016-05-13 16:49:27 -05:00
Artem Sidorenko e5c9710147 Use the relative url prefix for links in Wiki 2016-05-13 22:42:07 +02:00
Gabriel Mazetto f5a0ac0fc1 Codestyle: make sure we have space around operators 2016-05-13 04:46:56 -03:00
Robert Speicher 4735a75340 Merge branch 'deprecated-class-methods-cop' into 'master'
Enable the Rubocop DeprecatedClassMethods cop

This reports uses of `File.exists?` and `Dir.exists?`, which were both
deprecated in Ruby and will eventually be removed in favor of `.exist?`.
Also fixes all existing uses of the deprecated methods.

See merge request !4087
2016-05-12 22:41:01 +00:00
Yorick Peterse 6a29117793
Removed stray strip_heredoc from migration helpers 2016-05-13 00:11:01 +02:00
James Lopez 6a70c060fa Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/import-data-issue 2016-05-12 18:39:52 +02:00
Yorick Peterse 945c5b3fe6
Removed tracking of total method execution times
Because method call timings are inclusive (that is, they include the
time of any sub method calls) this would lead to the total method
execution time often being far greater than the total transaction time.
Because this is incredibly confusing it's best to simply _not_ track the
total method execution time, after all it's not that useful to begin
with.

Fixes gitlab-org/gitlab-ce#17239
2016-05-12 15:15:45 +02:00
Yorick Peterse 36083b4d0e
Fixed styling per Rubocop pedantics 2016-05-12 13:03:55 +02:00
Yorick Peterse e867099091
Added helper methods for database migrations
These helpers can be used to perform migrations without taking down the
entire application.

For example, the method "add_column_with_default" can be used to add a
new column with a default value without locking the entire table.
2016-05-12 12:59:40 +02:00
Zeger-Jan van de Weg 2f0d89ecff Merge branch 'master' into awardables 2016-05-11 22:34:25 +02:00
James Lopez 1074980abb Merge branches 'fix/import-data-issue' and 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/import-data-issue 2016-05-11 17:54:25 +02:00
Robert Speicher d526cda502 Merge branch '17270-only-generate-email-on-push-once-for-all-recipients' into 'master'
Only generate repository push email once

The repository push email can be very expensive to generate, especially
with syntax-highlighted diffs. Instead of generating the email for each
recipient, generate one email object and reset the Message-Id and To
headers for each recipient. (Cloning would also be expensive in the case
of large emails, although probably not as bad as generating from
scratch.)

Closes #17270.

See merge request !4070
2016-05-11 12:45:39 +00:00
Rémy Coutable e77a9a342e Merge branch 'casecmp-cop' into 'master'
Enable Rubocop Casecmp Performance Cop.

Also fixes the errors caused by enabling the cop.

`casecmp` is more performant than `.downcase` and `==`.

See also: https://github.com/bbatsov/rubocop/blob/master/lib/rubocop/cop/performance/casecmp.rb

See merge request !3957
2016-05-11 08:59:44 +00:00
Rémy Coutable de5ae1bf06 Merge branch 'string-replacement-cop' into 'master'
Enable the StringReplacement cop.

Also fix one use of `gsub` that would be faster as `delete`.

Use `tr` instead of `gsub` when you are replacing the same number of characters. Use `delete` instead of `gsub` when you are deleting characters.

See merge request !3960
2016-05-11 08:58:59 +00:00
Sean McGivern 5f27e26bb4 Only generate repository push email once
The repository push email can be very expensive to generate, especially
with syntax-highlighted diffs. Instead of generating the email for each
recipient, generate one email object and reset the Message-Id and To
headers for each recipient. (Cloning would also be expensive in the case
of large emails, although probably not as bad as generating from
scratch.)
2016-05-11 09:16:01 +01:00
Zeger-Jan van de Weg 7e6dcf9cd0 Merge branch 'master' into awardables 2016-05-11 08:47:04 +02:00
Connor Shea 4995302df6
Enable the StringReplacement cop.
Also fix one use of `gsub` that would be faster as `delete`.

Use `tr` instead of `gsub` when you are replacing the same number of
characters. Use `delete` instead of `gsub` when you are deleting
characters.
2016-05-10 18:34:15 -06:00
Connor Shea 377583a361
Enable Rubocop Casecmp Performance Cop.
Also fixes the errors caused by enabling the cop. casecmp is more performant than `.downcase` and `==`.
2016-05-10 18:23:25 -06:00
James Lopez 1322c981a0 create import data in service 2016-05-10 11:10:51 +02:00
Rémy Coutable f52a15e022
Revert "Merge branch 'wiki-fix' into 'master' "
This reverts commit 4cc85a58e8, reversing
changes made to 90ae445ba9.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-10 10:57:48 +02:00
Kamil Trzcinski 565a5e36fc Merge branch 'docker-registry' into docker-registry-view 2016-05-09 22:12:34 +03:00
Artem Sidorenko 14b36f91d9 Use the proper GitLab URL for links in Wiki 2016-05-09 11:50:23 +02:00
Stan Hu 4be77d0b05 Improve multiple branch push performance by memoizing permission checking
If you attempt to push thousands of branches at once, the 60-second timeout
will occur because GitAccess checking does a lot of work to check if the
user has permission to push to a branch. This changes does two things:

1. Instead of making 1 DB query per branch push, use a memoized list of protected branches to check
2. Memoize what permissions the user has to perform on this project

On a test of 10,000 branch pushes, this prevents gitlab-shell from hitting the 60-second
timeout.

Closes #17225
2016-05-09 01:17:14 -07:00
Connor Shea 9cc0937b3a Enable the Rubocop DeprecatedClassMethods cop
This reports uses of `File.exists?` and `Dir.exists?`, which were both
deprecated in Ruby and will eventually be removed in favor of
`.exist?`. Also fixes all existing uses of the deprecated methods.
2016-05-08 15:33:34 -06:00
Kamil Trzcinski 5196f8e993 WIP 2016-05-08 22:50:30 +02:00
Stan Hu 21d89d0286 Update SVG sanitizer to conform to SVG 1.1
Use a custom Loofah scrubber since sanitize 2.x transformers are inadequate
to handle case-sensitive SVG attributes. sanitize parses documents as HTML
instead of XML, which causes all SVG attribute names (e.g. viewBox) to be downcased.

* SVG element list: https://www.w3.org/TR/SVG/eltindex.html
* SVG attribute list: https://www.w3.org/TR/SVG/attindex.html

Closes #14555
2016-05-06 23:20:24 -07:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00
Robert Speicher 4fce876542 Merge branch 'fix/import-url-issues' into 'master'
Fix importer bug when throwing exceptions

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

See merge request !3941
2016-05-05 22:27:40 +00:00
Yorick Peterse 003671207d
Fix passing nil to protected_tag?
Previously this method would directly receive the output of tag_name().
This method could either return a String or nil. In the previous setup
this would somehow magically work but because Rugged::TagCollection#[]
doesn't accept nil values it started to fail.

To work around this the elsif in change_access_check() assigns the
result of tag_name() to a local and then _only_ calls protected_tag?()
if the tag name is not nil. The extra parenthesis are put in place to
ensure that things are parsed correctly, without these the code would be
parsed as follows:

    elsif tag_ref = (tag_name(ref) && protected_tag(tag_ref))

During runtime this would basically resolve to:

    elsif tag_ref = (tag_name(ref) && protected_tag(nil))

This is because when you refer to the variable you're assigning _in_ the
assignment Ruby returns nil instead of raising an error.
2016-05-05 19:46:26 +02:00
Yorick Peterse 93ce229665
Use tag_exists? in GitAccess#protected_tag?
This removes the need for retrieving the entire list of tags just to
check if a specific one exists.
2016-05-05 19:46:26 +02:00
Douglas Barbosa Alexandre 6fbf6b2936 Fix the line code when importing PR review comments from GitHub
Pull Request Review Comments are comments on a portion of the unified
diff.
2016-05-05 10:45:14 -03:00
Rémy Coutable 1a9d505972 Merge branch 'use-rugged-to-create-tag' into 'master'
Use Rugged's TagCollection#create instead of gitlab-shell's Repository#add_tag for better performance

This was originally opened at !1757 by @pcarranza but I changed it to use Rugged instead of gitlab_git, following @DouweM's request.

Once this is merged, https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/26 will be mergeable too.

See merge request !3745
2016-05-04 16:07:13 +00:00
Douwe Maan 6a8359f3d3 Merge branch 'pacoguzman/gitlab-ce-15001-since-and-until-operators-api-commits'
# Conflicts:
#	Gemfile.lock
2016-05-04 17:27:47 +02:00
Rémy Coutable 44f89eafc0 Use Rugged's TagCollection#create instead of gitlab-shell's Repository#add_tag for better performance
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-04 17:19:13 +02:00
Kamil Trzcinski b0ddbaa07c Added docker registry view 2016-05-04 11:31:35 +02:00
Jacob Vosmaer 3dc276b367 Remove parallel assignment 2016-05-03 11:46:14 +02:00
Jacob Vosmaer 9ce0994299 Rubocop and whitespace 2016-05-02 13:21:59 +02:00
Jacob Vosmaer d1f5019511 Use correct auth finder 2016-05-02 13:19:39 +02:00
Jacob Vosmaer b1ffc9f0fe Make CI/Oauth/rate limiting reusable 2016-04-29 18:58:55 +02:00
Paco Guzman c4b9bd0413 API support for the 'since' and 'until' operators on commit requests
- Parameter validation as ISO8601 format
2016-04-29 09:26:52 +02:00
Zeger-Jan van de Weg ad99404d25 Properly handle bigger files 2016-04-28 21:28:39 +02:00
Rémy Coutable 5addff7e6c Merge branch 'use-remote-ip-for-akismet' into 'master'
Use ActionDispatch Remote IP for Akismet checking

Previously all remote IPs appeared at 127.0.0.1, which made Akismet
not very useful. Using the ActionDispatch Remote IP (http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html)
should provide more reliable results.

Closes #16629

See merge request !3961
2016-04-28 13:09:44 +00:00
Stan Hu e99cf05875 Use ActionDispatch Remote IP for Akismet checking
Previously all remote IPs appeared at 127.0.0.1, which made Akismet
not very useful. Using the ActionDispatch Remote IP (http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html)
should provide more reliable results.

Closes #16629
2016-04-27 22:12:55 -07:00
James Lopez ce9310d63f fix var error 2016-04-27 09:28:08 +02:00
Stan Hu eede032345 Backport GitHub Enterprise import support from EE
These changes were pulled from GitLab EE to support configuring
an alternative API URL than the default https://api.github.com.
In addition, the `verify_ssl` flag allows users to disable SSL cert
checking.

One modification: add a default `args` option if it does not exist
to avoid breaking existing configurations.
2016-04-26 21:00:55 -07:00
Alfredo Sumaran 3b39214f29 Merge remote-tracking branch 'origin/master' into issue_14904 2016-04-21 12:47:32 -05:00
Jacob Vosmaer 103c405339 Use SIGTERM during Sidekiq memory shutdown
This makes the memory killer behave more like 'sidekiqctl stop'.
2016-04-21 14:49:15 +02:00
Jacob Schatz b3f4e8b218 Revert "Merge branch 'sentry-js' into 'master' "
This reverts commit 0f309794e7, reversing
changes made to 1e596fef1c.
2016-04-21 07:27:27 -04:00
Alfredo Sumaran 5c10b29700 Merge remote-tracking branch 'origin/master' into issue_14904
# Conflicts:
#	app/views/shared/issuable/_sidebar.html.haml
2016-04-20 17:26:47 -05:00
Robert Speicher 7e6d59067e Merge branch 'fix-grape-internal-allowed-action' into 'master'
Fix setting of "action" for Grape transactions

After wondering why we're not getting all the data in Grafana that I
wanted I realized I wasn't setting the "action" field properly here.

See merge request !3842
2016-04-20 21:27:43 +00:00
Yorick Peterse a257d117a0
Fix setting of "action" for Grape transactions
Merely setting the "action" tag will only result in the transaction
itself containing a value for this tag. To ensure other metrics also
contain this tag we must set the action using Transaction#action=
instead.
2016-04-20 22:42:52 +02:00
Robert Speicher 0f309794e7 Merge branch 'sentry-js' into 'master'
Add Sentry logging for JavaScript errors

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/12675

See merge request !3795
2016-04-20 19:52:27 +00:00
Alfredo Sumaran a45924348f Merge remote-tracking branch 'origin/master' into issue_14904 2016-04-20 12:24:42 -05:00
Sebastian Klier a88f0a1fd8 add wiki_page helper to url_builder 2016-04-20 08:25:41 +08:00
Arinde Eniola 3e7a8b0789 place the sentry config into a new file, and some changes 2016-04-19 22:04:52 +01:00
Yorick Peterse 229f3ce9ce
Configuring of points per UDP packet
This allows users to configure the number of points stored in a single
UDP packet. This in turn can be used to reduce the number of UDP packets
being sent at the cost of these packets being somewhat larger.

The default setting is 1 point per packet so nothing changes for
existing users.
2016-04-19 14:35:25 +02:00
Gabriel Mazetto 5330af3fa6 Using single builder for push and tag events 2016-04-19 11:00:30 +02:00
Gabriel Mazetto ee1090e2b2 Added System Hooks for push and tag_push
Code is based on Project Webhooks, removing deprecations and without
commits listing.
2016-04-19 11:00:30 +02:00
Douglas Barbosa Alexandre f2fe4af19d Set GitHub milestones to Issue/Merge Request that were imported 2016-04-18 20:07:05 -03:00
Douglas Barbosa Alexandre 06ec511164 Import milestones from GitHub 2016-04-18 20:07:04 -03:00
Douglas Barbosa Alexandre 7462a8f90a Apply GitHub labels to Issue/Merge Request that were imported 2016-04-18 17:14:59 -03:00
Douglas Barbosa Alexandre 05a4f444c3 Import labels from GitHub 2016-04-18 17:14:59 -03:00
Alfredo Sumaran b41ddf9c69 Add shortcut_path to GonHelper module 2016-04-18 15:04:57 -05:00
Jacob Schatz 5f98fdcdc9 Add sentry logger to GitLab 2016-04-18 12:26:32 -04:00
Douglas Barbosa Alexandre d13bba44f0 Use GitHub Issue/PR number as iid to keep references
With these changes we don’t lost the issue/pr references when importing
them to GitLab.
2016-04-18 12:15:50 -03:00
Yorick Peterse 7e6f0ac0e0
Count the number of SQL queries per transaction
Fixes gitlab-org/gitlab-ce#15335
2016-04-18 14:53:13 +02:00
Yorick Peterse 7b6785b3b1
Use Module#prepend for method instrumentation
By using Module#prepend we can define a Module containing all proxy
methods. This removes the need for setting up crazy method alias chains
and in turn prevents us from having to deal with all that madness (e.g.
methods calling each other recursively).

Fixes gitlab-org/gitlab-ce#15281
2016-04-18 11:16:31 +02:00
Robert Speicher 2e4d9c1de6 Merge branch 'fix/project-import_url' into 'master'
Fix for import_url fields on projects containing third-party credentials

Fixes https://dev.gitlab.org/gitlab/gitlabhq/issues/2658 

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

See merge request !3066
2016-04-15 21:52:00 +00:00
Robert Speicher 34b0561560 Merge branch 'pmq20/gitlab-ce-psvr/change-head' into 'master'
Use rugged to change HEAD

_Originally opened at !2850 by @pmq20._

Needless to invoke gitlab_shell here, which is slow.

See merge request !3705
2016-04-15 16:44:21 +00:00
Rémy Coutable 8b7bf2a0e0 Merge branch 'rugged-delete-tag' into 'master'
Delete tags via rugged

Improve the performance by directly using rugged instead of shelling out to a git operation.

See merge request !3748
2016-04-15 14:42:05 +00:00
Robert Schilling 3c704c33e0 Delete tags via rugged 2016-04-15 16:05:04 +02:00
Robert Schilling 106c443e76 Remove unused backend methods 2016-04-15 13:30:33 +02:00
Rémy Coutable f8e8a61c9c
Remove Gitlab::Shell#update_repository_head since it's not used anymore
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-15 11:38:59 +02:00
Jacob Vosmaer 2a9a9e147b Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-http-controller 2016-04-15 11:07:25 +02:00
James Lopez 05985b49a4 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-15 08:49:08 +02:00
Robert Speicher 95a867e0af Merge branch 'auto-fsck' into 'master'
Auto git fsck

Closes https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3232

See merge request !3232
2016-04-14 17:15:58 +00:00
James Lopez e5f7a54530 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-14 18:12:10 +02:00
Rémy Coutable dd9ced0af9 Merge branch 'connorshea/gitlab-ce-revoke-authorized-application' into 'master'
Fix revoking of authorized OAuth applications

Users were not able to revoke access to authorized OAuth applications. Clicking the "Revoke" button would result in a 404 page, and the application would still be authorized.

Added a spec and also found that the `gon` variables were not being set for this view.

Closes #14370

See merge request !3690
2016-04-14 15:26:09 +00:00
Stan Hu e450892f56 Include GonHelper separately and remove created_at in factory 2016-04-14 07:25:27 -07:00
Stan Hu c7e384aab2 Add spec for deletion of authorized OAuth2 application
Closes #14370

Move gon function into its own helper
2016-04-14 07:24:58 -07:00
Rémy Coutable c71cdb194f Merge branch 'simplify-gitlab-url_builder-15202' into 'master'
Refactor and expose only Gitlab::UrlBuilder.build(record)

```
$ git grep Gitlab::UrlBuilder

app/models/commit.rb:      url: Gitlab::UrlBuilder.build(self),
app/services/issues/base_service.rb:      issue_url = Gitlab::UrlBuilder.build(issue)
app/services/merge_requests/base_service.rb:      hook_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(merge_request)
app/views/search/results/_note.html.haml:- note_url = Gitlab::UrlBuilder.build(note)
lib/gitlab/note_data_builder.rb:        base_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(note)
spec/lib/gitlab/note_data_builder_spec.rb:    expect(data[:object_attributes][:url]).to eq(Gitlab::UrlBuilder.build(note))
spec/lib/gitlab/url_builder_spec.rb:describe Gitlab::UrlBuilder, lib: true do
```

Fixes #15202.

See merge request !3696
2016-04-14 10:27:49 +00:00
James Lopez efff7e9e54 updated migration based on testing findings 2016-04-14 12:03:45 +02:00
Valery Sizov c0678f2d28 Merge branch 'redis_config_consistency' into 'master'
Redis configuration consistency

Related cf669551f6

See merge request !3697
2016-04-13 18:34:11 +00:00
Valery Sizov 2244aaf98f Redis configuration consistency 2016-04-13 20:57:19 +03:00
Robert Speicher 2b28fa14b3 Merge branch 'redis_improvements' into 'master'
Clean up ExclusiveLease

See merge request !3695
2016-04-13 16:22:45 +00:00
Jacob Vosmaer f07316f27c Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into auto-fsck 2016-04-13 17:38:59 +02:00
Rémy Coutable 02cfbf0db5
Refactor and expose only Gitlab::UrlBuilder.build(record)
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-13 16:07:04 +02:00
Marin Jankovski c746046992 Merge branch 'external-omniauth-providers' into 'master'
Allow Omniauth providers to be marked as external

Related to #4009 

With this MR we will be able to allow the user to set which Omniauth Providers they would like to have as external. All users login in via these providers will be marked as external, even if they already had an account before. If the provider is removed form the list of external providers, the users will be marked as internal at their next login.

MR for Omnibus: gitlab-org/omnibus-gitlab!727

/cc @dblessing @DouweM 

See merge request !3657
2016-04-13 13:09:47 +00:00
Valery Sizov 33f786b5d3 clean up ExclusiveLease 2016-04-13 13:12:05 +03:00
Yorick Peterse 3240ecfbef
Added ability to add custom tags to transactions
One use case for this is manually setting the "action" tag for Grape API
calls. Due to Grape running blocks there are no human readable method
names that can be used for the "action" tag, thus we have to set these
manually on a case by case basis.
2016-04-13 11:22:37 +02:00
Jacob Vosmaer a1c8fdfbee Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-http-controller 2016-04-12 18:23:42 +02:00
Robert Speicher d75ec6cd46 Merge branch 'fix-missing-saml-error-handling' into 'master'
Add proper nil and error handling to SAML login process

While writing the feature that would allow certain Omniauth providers to be marked as external I noticed that there is a scenario where the `gl_user` method can return `nil` and if this is not properly checked, it will lead to exceptions that will cause 500 errors. It is quite easy to land in this scenario, so I added `nil` checks.

I also noticed that the `saml` method in the `omniauth_callbacks_controller.rb` file lacked a `rescue` for `Gitlab::OAuth::SignupDisabledError`, which can happen if the default configuration from `1_settings.rb` is applied. So I also added this check.

See merge request !3609
2016-04-12 15:46:39 +00:00
Jacob Vosmaer 7b1bb0f4db Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into auto-fsck 2016-04-12 17:44:02 +02:00
Jacob Vosmaer 97f4ffff1e Add a 'circuit breaker' for repo checks 2016-04-12 17:07:54 +02:00
Patricio Cano 61fc9aa87e Better control flow. 2016-04-11 18:01:51 -05:00
Patricio Cano 05a611a091 Better control flow and added guard clause. 2016-04-11 17:25:18 -05:00
Patricio Cano 12e6084667 Allow `external_providers` for Omniauth to be defined to mark these users as external 2016-04-11 10:16:15 -05:00
Yorick Peterse 7eed4608fe
Fixed stubbing for Gitlab::Metrics specs
If the measure method uses Transaction.current directly the SQL
subscriber (Subscribers::ActiveRecord) will add timings of queries
triggered by DB cleaner.
2016-04-11 14:29:38 +02:00
Yorick Peterse d9110a7eca
Track call counts in Gitlab::Metrics.measure_block 2016-04-11 13:27:52 +02:00
Yorick Peterse 16926a676b
Store block timings as transaction values
This makes it easier to query, simplifies the code, and makes it
possible to figure out what transaction the data belongs to (simply
because it's now stored _in_ the transaction).

This new setup keeps track of both the real/wall time _and_ CPU time
spent in a block, both measured using milliseconds (to keep all units
the same).
2016-04-11 13:09:36 +02:00
Robert Speicher 93571c4335 Merge branch 'redis-connection-pool' into 'master'
Redis connection pool

Split from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3232

Having an easily accessible Redis connection pool allows us to do more
cool stuff with Redis in GitLab (instead of having to go through e.g.
the Rails cache).

See merge request !3521
2016-04-08 22:26:53 +00:00
Yorick Peterse 833808d737 Merge branch 'instrument-rails-cache' into 'master'
Instrument Rails cache code

See merge request !3619
2016-04-08 20:52:21 +00:00
Yorick Peterse c56f702ec3
Instrument Rails cache code
This allows us to track how much time of a transaction is spent in
dealing with cached data.
2016-04-08 17:54:52 +02:00
Yorick Peterse aa7cddc4fc
Use more accurate timestamps for InfluxDB.
This changes the timestamp of metrics to be more accurate/unique by
using Time#to_f combined with a small random jitter value. This
combination hopefully reduces the amount of collisions, though there's
no way to fully prevent any from occurring.

Fixes gitlab-com/operations#175
2016-04-08 16:39:44 +02:00
Patricio Cano 1d2429af9b Add missing proper nil and error handling to SAML login process. 2016-04-07 16:45:33 -05:00
Jacob Vosmaer cf669551f6 Put CACHE_NAMESPACE in the Gitlab::Redis module 2016-04-07 15:42:07 +02:00
James Lopez a1a1d1f7de refactored create_or_update_import_data 2016-04-07 15:08:38 +02:00
James Lopez 15044e7d85 refactored a few things based on MR feedback 2016-04-07 15:00:20 +02:00
James Lopez e8b7e37c6d Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-07 14:15:48 +02:00
Rémy Coutable 8eae7b1088 Merge branch 'feature/expose-builds-badge' into 'master'
Expose badges

This MR exposes badge somewhere in visible place.

![expose_badges](/uploads/d2e290d3013d1ef2b1bdeebbbe2c5d8b/expose_badges.png)

Closes #13801

See merge request !3326
2016-04-07 08:40:15 +00:00
Robert Speicher 936be025cd Merge branch 'saml-external-groups' into 'master'
Allow SAML to identify external users and set them as such

Related to #4009

Fixes #14577

This allows SAML to retrieve group information form the `SAML Response`
and match that to a setting that will flag all matching users as external.

See merge request !3530
2016-04-07 00:35:08 +00:00
Patricio Cano 8110e75309 Implemented suggested fixes 2016-04-06 18:12:25 -05:00
Robert Speicher 5bdc18c5b3 Merge branch 'patch/fix-ldap-unblock-user-logic' into 'master'
Unblocks user when active_directory is disabled and it can be found

We implemented a specific block state to handle user blocking that originates from LDAP filtering rules / directory state in !2242. 

That introduced a regression in LDAP authentication when Active Directory support was disabled. You could have a scenario where the user would not be temporarily found (like a filtering rule), that would mark the user as `ldap_blocked`, but will never unblock it automatically when that state changed.

Fixes #14253, #13179, #13259, #13959

See merge request !3550
2016-04-06 21:50:40 +00:00
Patricio Cano eb0f1de36c Added CHANGELOG item 2016-04-06 16:21:58 -05:00
Patricio Cano 3a36fa8957 Fix error that was causing only one group to be returned and corrected specs to use the proper attribute type 2016-04-06 16:03:35 -05:00
Grzegorz Bizon b7fa7c4d59 Extend build status badge, add html/markdown methods 2016-04-06 19:56:34 +02:00
Jacob Vosmaer 91226c2001 Move workhorse protocol code into lib 2016-04-06 17:52:12 +02:00
Jacob Vosmaer 6cc6d9730a Delete dead code 2016-04-06 17:27:52 +02:00
Yorick Peterse 1af6cf28c0 Measure Ruby blocks using Gitlab::Metrics
This allows measuring of timings of arbitrary Ruby blocks, this allows
for more fine grained performance monitoring. Custom values and tags can
also be attached to a block.
2016-04-06 14:31:52 +02:00
Jacob Vosmaer 5cf56e5647 Rename almost all the things 2016-04-06 13:47:05 +02:00
James Lopez b97654393e fix some issues with credentials 2016-04-06 10:36:30 +02:00
Patricio Cano 518ec6b266 Changed config syntax and improved how chaanges in group memberships are handled when external groups is set up 2016-04-05 19:20:18 -05:00
Gabriel Mazetto 5ee6badade Unblocks user when active_directory is disabled and it can be found 2016-04-05 16:34:31 -03:00
James Lopez 5e51fce4dc some refactoring to symbolise keys across importers and left a TODO 2016-04-05 15:41:15 +02:00
Patricio Cano 1a168279fa Prepare SAML for group retrieval 2016-04-04 19:09:12 -05:00
James Lopez 7f7769172e Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url
# Conflicts:
#	db/schema.rb
2016-04-04 20:03:25 +02:00
Jacob Vosmaer bf9526739b Rebase repo check MR 2016-04-04 17:23:43 +02:00
Jacob Vosmaer 213ee62469 Be careful when setting class instance vars 2016-04-04 17:01:56 +02:00
Jacob Vosmaer 0163e27631 Add Gitlab::Redis connection pool 2016-04-04 17:00:09 +02:00
James Lopez ef85c510fa corrected a couple of based on MR review 2016-04-04 09:57:52 +02:00
Robert Speicher 5627542fd4 Merge branch 'routing' into 'master'
Added & use Gitlab::Routing for URL helpers

Extracted from !3389

See merge request !3486
2016-04-01 16:51:20 +00:00
Robert Speicher 64106865df Merge branch 'fix/fogbugz-import' into 'master'
spec and fix for fogbugz lonely user problem

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

I encountered this issue while manually testing all import types for
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3066

This is really due to a horrible API

```
{ 'people' => { 'person' => array_of_people_or_single_person_as_hash } }
```

See merge request !3457
2016-04-01 16:32:00 +00:00
James Lopez 43ee65e173 remove useless var 2016-04-01 17:50:50 +02:00
James Lopez 255cd31652 fixes after more import testing 2016-04-01 17:27:07 +02:00
James Lopez 6aeb753ba8 fix github import issues 2016-04-01 15:51:54 +02:00
James Lopez 6d12d79d29 fix fogbugz import 2016-04-01 12:04:41 +02: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
Douwe Maan 2e3c2a355f Merge branch 'snippets-with-comments-cause-a-500-when-they-show-up-in-search-results-14764' into 'master'
Fix Error 500 when searching for a comment in a project snippet

Closes #14764. /cc @stanhu, and thank you for the spec! ;)

See merge request !3468
2016-04-01 08:38:16 +00:00
Douwe Maan 98df8aab7e Merge branch 'fix/issue-move-rewrite-uploads' into 'master'
Rewrite uploads when moving issue to another project

Closes #14531

See merge request !3382
2016-04-01 07:17:10 +00:00
connorshea 85cc172959 Remove "Congratulations!" tweet button on newly-created project.
I’ve removed everything related to the feature based on this commit:
ce08f919f34fd8849834365

Resolves #10857.
2016-03-31 17:09:36 -06:00
Grzegorz Bizon ed6f524c49 Merge branch 'master' into fix/issue-move-rewrite-uploads
* master: (27 commits)
  Fix commit comment alignment
  minor cleanup in system_hook_spec
  Pre-calculate Emoji digests
  Clear .todo listener
  Change window.location to use turbolinks
  Make entire todo row clickable
  Add 8.6.2 CHANGELOG items
  Ensure uploads dir exists when running backup specs
  Move CarrierWave test env config to separate file
  Remove console logs
  Off the event initially
  Collapsed sidebar opens over instead of pushing content.
  Sidebar collapse update issue
  User selection from collapsed sidebar
  Add json response for user avatar in merge request
  Make changed values visible in minimized sidebar.
  Fixed MergeRequestController spec
  We need `sha` reference from `diff_base_commit` to generate the diff
  Use `diff_base_commit` instead of `target_branch` to generate diffs
  Isolate CarrierWave uploads in test enviroment
  ...
2016-03-31 10:07:13 +02:00
Rémy Coutable e60f034126
Fix view of notes in search results when noteable is a snippet
Also, streamline the view.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-03-31 09:40:57 +02:00
Rémy Coutable 091b8a6ede
Rename Note#for_project_snippet? to #for_snippet?
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-03-31 09:20:27 +02:00
James Lopez 2d544d5445 spec and fix for fogbugz lonely user problem 2016-03-30 18:48:28 +02:00
Douwe Maan c9a7cc4b37 Merge branch '2364-fallback-to-in-reply-to-header' into 'master'
Fall back to In-Reply-To and References headers when sub-addressing is not available

_Originally opened at !3024 by @dabit._

- - -

Fixes #2364 

Summary of the changes:
- No more need to have the `%{key}` placeholder in the `incoming_email.address`
- The fallback message id format is `reply-[key]@[gitlab_host]` (reminder: it doesn't have to be a real email address)
- The fallback message id that includes the reply key is added to both `References` header
- Documentation for the "Reply by email" feature updated

See merge request !3305
2016-03-30 16:16:37 +00:00
Grzegorz Bizon b9f5719285 Remove reduntant `move_to_store` override 2016-03-30 12:50:19 +02:00
Grzegorz Bizon 99ee822857 Add method that returns markdown in file uploader 2016-03-30 10:56:25 +02:00
Grzegorz Bizon e64b1e52a2 Check if GFM rewriters need rewrite internally 2016-03-30 10:44:18 +02:00
Grzegorz Bizon f2674c7b98 Refactor uploads rewriter used when moving issue 2016-03-30 10:44:18 +02:00
Grzegorz Bizon 701976e081 Add uploads rewriter and use it when moving issue 2016-03-30 10:44:18 +02:00
James Lopez 075b56aae2 more fixes after doing more manual testing on importing 2016-03-29 18:43:23 +02:00
James Lopez c93570d8fb fixing a few issues after testing imports 2016-03-29 16:10:35 +02:00
James Lopez 28df200c66 fixed failing specs 2016-03-29 15:23:32 +02:00
Grzegorz Bizon 4cd1b9f4d8 Refactor builds badge, encapsulate inside a class 2016-03-29 09:01:19 +02:00
James Lopez 459ad34493 refactored code based on feedback plus fixed a couple of other issues 2016-03-28 16:35:03 +02:00
James Lopez fcb85381cf Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-03-28 09:37:55 +02:00
Rémy Coutable 9f218fc184 Improve and finish the fallback to the In-Reply-To and References header for the reply-by-email feature
A few things to note:
- The IncomingEmail feature is now enabled even without a
  correctly-formatted sub-address
- Message-ID for new thread mail are kept the same so that subsequent
  notifications to this thread are grouped in the thread by the email
  service that receives the notification
  (i.e. In-Reply-To of the answer == Message-ID of the first thread message)
- To maximize our chance to be able to retrieve the reply key, we look
  for it in the In-Reply-To header and the References header
- The pattern for the fallback reply message id is "reply-[key]@[gitlab_host]"
- Improve docs thanks to Axil
2016-03-25 13:05:15 +01:00
David Padilla 31e76baf61 Fix #2364. Fall back to In-Reply-To header when reply key not available 2016-03-25 13:05:15 +01:00
Jacob Vosmaer be3675c8ac Explain why ExclusiveLease has no #cancel
[ci skip]
2016-03-24 13:51:33 +01:00
James Lopez cc4d04f97f added rest of importers, fixed specs and some issues with the migration 2016-03-23 17:57:10 +01:00
Lin Jen-Shin 9374b7eb0b Avoid using the same name between methods and variables 2016-03-23 20:05:31 +08:00
James Lopez 6967871fc5 fogbugz importer, also refactored migration again to make it easier to add new importers 2016-03-23 12:52:50 +01:00
James Lopez 46346caf5b fix rubocop warning 2016-03-22 18:14:13 +01:00
James Lopez c136edbbe3 fix gitlab import and spec 2016-03-22 18:03:54 +01:00
James Lopez 8aafe68583 first round of fixes and spec fixes 2016-03-22 17:53:53 +01:00
James Lopez 3b78885eac encrypt credentials in project_creator for bitbucket by default 2016-03-22 12:26:50 +01:00
James Lopez 23146fca18 update bitbucket importer 2016-03-22 12:25:28 +01:00
James Lopez 8a26f83688 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-03-22 09:56:56 +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 e937f312cd Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url
# Conflicts:
#	db/schema.rb
2016-03-21 18:41:16 +01:00
James Lopez ced56641bf refactored code based on feedback 2016-03-21 18:09:47 +01:00
James Lopez dff4050f1d fixed some rubocop warnings 2016-03-21 17:29:19 +01:00
James Lopez bd8a77674f fixed few issues with the migration 2016-03-21 17:16:27 +01:00
James Lopez 030b139445 more refactoring 2016-03-21 15:11:05 +01:00
Grzegorz Bizon db8f70d508 Do not rewrite reference if already a cross reference 2016-03-21 14:12:49 +01:00
James Lopez 383cc84047 some refactoring based on feedback 2016-03-21 13:15:51 +01:00
James Lopez 5f86912ef0 Merge branches 'fix/project-import_url' and 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url
# Conflicts:
#	db/schema.rb
2016-03-21 09:20:55 +01:00
Douwe Maan 45e8650c4f Fix specs 2016-03-20 23:26:58 +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
Grzegorz Bizon 6eb3105634 Find referable for each ref found in references rewriter 2016-03-20 10:52:01 +01:00
Grzegorz Bizon 323d328c86 Rename reference unfolder to rewriter, minor refactorings 2016-03-20 10:14:25 +01:00
Grzegorz Bizon 18f25bc942 Update reference unfolder according to recent ability changes
Commit 43d8bdb4f0 introduced additional
checks for permissions to read issue in references extractor.
2016-03-19 18:58:52 +01:00
Grzegorz Bizon 0115ad66d2 Merge branch 'master' into feature/issue-move
* master: (121 commits)
  Dedupe labels in labels selector in Dashboard pages
  Refactor colors and lists
  Add a safeguard in MergeRequest#compute_diverged_commits_count
  Fix an issue when the target branch of a MR had been deleted
  Add avatar to issue and MR pages header
  Cleanup somce css colors
  Re-group scss variables
  Refactor `Todo#target`
  Fixes issue with filter label missing on labels & milestones
  Rename `Todo#to_reference` to `Todo#target_reference`
  Fixed failing tests
  Updated controller with before_action Fixed other issues based on feedback
  Fixes issue on dashboard issues
  Full labels data in JSON
  Fixed issue with labels dropdown getting wrong labels
  Update CHANGELOG
  Use `Note#for_project_snippet?` to skip notes on project snippet
  Use `Commit#short_id` instead of `Commit.truncate_sha`
  Reuse `for_commit?` on conditional validations
  Update schema info comment on todo related files
  ...

Conflicts:
	app/models/issue.rb
	db/schema.rb
	spec/models/issue_spec.rb
2016-03-19 18:50:15 +01:00
Grzegorz Bizon 9b13ce0b7a Improvements in issue move feaure (refactoring)
According to endbosses' suggestions.
2016-03-19 18:46:01 +01:00
Zeger-Jan van de Weg b959ae553b Improve group visibility level feature 2016-03-18 16:58:04 -03:00
Douwe Maan 9813eac56b Merge branch 'confidential-issues' into 'master'
Add confidential issues

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/3678

More information: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/227

See merge request !3282
2016-03-18 12:04:56 +00:00
Yorick Peterse 3f0d780c19 Show a notice for diffs that are too large
This builds on the changes introduced in
https://gitlab.com/gitlab-org/gitlab_git/merge_requests/72 and results
in merge requests with large diffs (e.g. due to them containing minified
CSS) loading much faster.
2016-03-18 12:30:46 +01:00
Douglas Barbosa Alexandre f2ba4e3d36 Restrict access to confidential issues on search results 2016-03-17 20:55:59 -03:00
Felipe Artur 0a7f716119 Code fixes 2016-03-17 19:42:46 -03:00
Grzegorz Bizon 5e3c9475a9 Add minor improvements in code related to issue move 2016-03-17 07:39:16 +01:00
Grzegorz Bizon 4354bfaba5 Add implementation of reference unfolder using banzai 2016-03-17 07:39:16 +01:00
Grzegorz Bizon fd8394faae Move reference unfolder for GFM to separate class 2016-03-17 07:39:15 +01:00
Gabriel Mazetto f54bf00309 Back-porting PostReceive refactor made for EE 🍺 2016-03-17 00:24:12 -03:00
Felipe Artur 44c127447b Merge 4009-external-users into issue_12658 2016-03-16 20:16:42 -03:00
Rubén Dávila 7e03b40221 Return an empty Array when there aren't lines to parse. 2016-03-15 19:51:27 -05:00
Stan Hu 74d7de8196 Revert "Revert "Merge branch 'support-go-subpackages' into 'master' ""
This reverts commit 5a586f364c
2016-03-12 21:05:23 +00:00
Douwe Maan 5a586f364c Revert "Merge branch 'support-go-subpackages' into 'master' "
This reverts merge request !3191
2016-03-12 17:42:51 +00:00
Douwe Maan 826bc72c12 Merge branch 'support-go-subpackages' into 'master'
Support Golang subpackage fetching

Closes #13805

See merge request !3191
2016-03-12 17:38:08 +00:00
Stan Hu 380a67ad4c Ensure PATH_INFO exists for go-get 2016-03-12 08:10:54 -08:00
Stan Hu bb206f947f Simplify code 2016-03-12 07:50:02 -08:00
Douwe Maan ff62e20607 Merge branch 'fix-gh-pr-import' into 'master'
Fix importing PR's from GitHub when the source repo was removed

Closes #13847 
Closes gitlab-com/support-forum#584

See merge request !3172
2016-03-12 14:07:45 +00:00
Stan Hu cc065fbeaa Support Golang subpackage fetching
Closes #13805
2016-03-12 01:09:37 -08:00
Douwe Maan cb81c8a5ef Merge branch 'rs-issue-12944' into 'master'
Use a custom Devise failure app to handle unauthenticated .zip requests

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/12944

See merge request !2828
2016-03-11 22:34:33 +00:00
Yorick Peterse b77b3b16b6 Removed order from sub-query projects for search
There's no need to order queries used as sub-queries and doing so can
add potential overhead.
2016-03-11 15:25:23 -05:00
Yorick Peterse 8c2868e8ea Added ProjectSearchResults#project_ids_relation
This ensures some other methods such as the "issues" method still work.
2016-03-11 15:25:23 -05:00
Yorick Peterse ec349dc1b6 Refactor Gitlab::ProjectSearchResults
Previously this class would be given a project ID which was then used to
retrieve the corresponding Project object. However, in all cases the
Project object was already known as it was used to grab the ID to pass
to ProjectSearchResults. By just passing a Project instead we remove the
need for an extra query as well as the need for some other complexity
in this class.
2016-03-11 15:25:22 -05:00
Yorick Peterse 42fde69d39 Refactor Gitlab::SnippetSearchResults
This removes the need for plucking snippet IDs into memory.
2016-03-11 15:25:22 -05:00
Yorick Peterse 013542965c Refactor Gitlab::SearchResults
Instead of plucking IDs this class now uses ActiveRecord::Relation
objects. Plucking IDs is problematic as searching for projects can lead
to a huge amount of IDs being loaded into memory only to be used as an
argument for another query (instead of just using a sub-query).
2016-03-11 15:25:22 -05:00
Douglas Barbosa Alexandre 37b00b16a5 Fix importing PR's from GitHub when the source repo was removed 2016-03-10 19:29:54 -03:00
ashleys 4cd9a5208c web hooks to webhooks 2016-03-10 14:48:29 -05:00
Jacob Vosmaer 7b2bf4ce75 Typo 2016-03-10 18:41:57 +01:00
Jacob Vosmaer 261214efc2 Make comment less ambivalent 2016-03-10 18:39:50 +01:00
Jacob Vosmaer 3729c0822a Remove unnecessary random key 2016-03-10 17:05:36 +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
Jacob Vosmaer 66d5d9229d Improve comment 2016-03-10 12:58:51 +01:00
Jacob Vosmaer e7df3f51c9 Move method to User 2016-03-10 12:37:14 +01:00
Jacob Vosmaer 0223b58f01 Explain LDAP "lock" behavior 2016-03-10 11:05:59 +01:00
Jacob Vosmaer cda0b7e1b1 Rename ExpiringLock to ExclusiveLease 2016-03-10 10:41:16 +01:00
Jacob Vosmaer acd9bc0213 Acquire lock before LDAP sync 2016-03-09 19:11:24 +01:00
Jacob Vosmaer a12319c111 Always with the newlines 2016-03-09 15:56:44 +01:00
Jacob Vosmaer c46e6eff10 Parse config/resque.yml in one place only 2016-03-09 15:16:46 +01:00
Robert Speicher 5844a21a0a Use a custom Devise failure app to handle unauthenticated .zip requests
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/12944
2016-03-08 23:49:30 -05:00
Iuri de Silvio 591bf92ce7 Fix bug where Bitbucket `closed` issues were imported as `opened` 2016-03-07 19:23:47 +01:00
James Lopez 735563329d refactored a bunch of stuff based on MR feedback 2016-03-07 12:50:35 +01:00
James Lopez 7085850c50 fix specs 2016-03-04 18:37:00 +01:00
James Lopez c2b33d3b71 added import url exposer to construct URL withunencrypted credentials 2016-03-04 16:23:19 +01:00
James Lopez 06b36c00d5 some refactoring in the migration. Also fixed github import issue and updated spec 2016-03-04 12:21:53 +01:00
Jacob Vosmaer 1764e1b7cb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
Kazuki Sawada fc170baf3f Fix import from gitlab.com
Fixes #12652
2016-03-02 10:35:44 +01:00
Patricio Cano bb4fa3a185 Make new `allow_single_sign_on` feature backwards compatible 2016-02-18 17:02:43 -05:00
Patricio Cano 06376be56a Decouple SAML authentication from the default Omniauth logic 2016-02-18 17:01:07 -05:00
Douwe Maan 873b0db220 Revert "Merge branch 'saml-decoupling' into 'master' "
This reverts commit c04e22fba8, reversing
changes made to 0feab326d5.
2016-02-18 22:14:53 +01:00
Patricio Cano f014127e17 Decouple SAML authentication from the default Omniauth logic 2016-02-18 13:22:19 -05:00
Jacob Vosmaer 64d8a38b54 Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor 2016-02-17 15:25:57 +01:00
Douwe Maan 28d42a33f3 Merge branch 'rs-issue-13469' into 'master'
Handle nil commits in Gitlab::PushDataBuilder.build

Closes #13469

See merge request !2825
2016-02-17 14:19:20 +00:00
Jacob Vosmaer a0ccb0731b Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor 2016-02-17 11:30:42 +01:00
Douwe Maan bbbfdba0b9 Merge branch 'bugagazavr/gitlab-ce-extend-hooks' into 'master'
Add new data to project in push, issue, merge-request and note webhooks data

_Originally opened at !2738 by @bugagazavr._

- - -

**What does this MR do?**

Adds more data to hooks, makes repository data in all hook more dry ( use one hook_attrs method for repository data in all hooks )

**Are there points in the code the reviewer needs to double check?**

1. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/app/models/project.rb#L738
2. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/app/models/concerns/issuable.rb#L132
3. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/lib/gitlab/push_data_builder.rb#L52
4. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/lib/gitlab/note_data_builder.rb#L56

**Why was this MR needed?**

More information about user for push events, and more data about repositiry ( project )

**What are the relevant issue numbers?**

No

**Screenshots (if relevant)**

No

See merge request !2788
2016-02-16 13:08:36 +00:00
Robert Speicher 789aef7f26 Handle nil commits in Gitlab::PushDataBuilder.build
Closes #13469
2016-02-15 16:06:45 -05:00
Robert Speicher 447568d15f Fix undefined method `postgresql?` during migration 2016-02-15 14:13:47 -05:00
Ben Boeckel e919b5a4e9 Fix relative links in other markup formats
- Apply the RelativeLinkFilter filter to other formats, e.g.,
  reStructuredText so links from the Files view or the Project view work
- Remove the AsciidocPipeline pipeline

Fixes #3533.
2016-02-12 17:20:59 +01:00
Rubén Dávila 5a5ee6188b Load all blob data when highlighting content for git-blame. 2016-02-11 18:30:05 -05:00
Jacob Vosmaer 34a6f83d3e Fix API 2016-02-11 18:10:14 +01:00
Kirill Zaitsev b123171d3d Add new data to project in push, issue, merge-request and note webhooks data
- Add `avatar_url`, `description`, `git_ssh_url`, `git_http_url`,
  `path_with_namespace` and `default_branch` in `project` in push, issue,
  merge-request and note webhooks data
- Deprecate the `ssh_url` in favor of `git_ssh_url` and `http_url` in
  favor of `git_http_url` in `project` for push, issue, merge-request and
  note webhooks data
- Deprecate the `repository` key in push, issue, merge-request and
  note webhooks data, use `project` instead
2016-02-11 17:22:11 +01:00