Commit Graph

1721 Commits

Author SHA1 Message Date
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
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
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
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
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
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