Commit Graph
4113 Commits
Author SHA1 Message Date
Rémy Coutable 4f66799738 Merge branch 'wiki-fix-reloaded' into 'master'
Use the relative url prefix for links in Wiki

Retry of gitlab-org/gitlab-ce!4026

@rymai !4050 solved all other problems how it looks like. I [tested](https://gitlab.com/artem-forks/gitlab-ce/commit/ff01eca7b559efa7cacf3412aa01cd8ae8a6db7e/builds) this with ruby22

Fixes #17071 



See merge request !4131
2016-05-16 20:30:42 +00:00
Douwe Maan 59e62fc486 Merge branch 'docker-registry' into 'master'
Added authentication service for docker registry

This adds a simple authentication service for docker which uses current user credentials to authenticate pulls and pushes.

I have only one concern. Since the `.docker/config` is unencrypted, thus the password for user stored there is unencrypted, maybe we should from the start implement function to generate/provide a separate password just for the purposes of accessing docker registry?

What do you think @jacobvosmaer @sytses @marin?

cc @marin 

See merge request !3787
2016-05-16 17:20:31 +00:00
Douwe Maan 5dd013f145 Merge branch 'gh-pull-requests' 2016-05-16 12:12:20 -05:00
Pablo Carranza b9306c2e82 Add cache count metrics to rails cache 2016-05-15 19:47:41 +01:00
Kamil Trzcinski f4f9184a01 Rename JWT to JSONWebToken 2016-05-14 18:23:31 -05:00
Kamil Trzcinski df973df8c5 Simplify JWT::RSAToken::kid 2016-05-14 16:04:26 -05:00
Douglas Barbosa Alexandre 290aa75e6f Remove branches that does exist on GitHub after PRs were imported 2016-05-13 17:55:43 -05:00
Douglas Barbosa Alexandre ebaa19c162 Fix validation method for Gitlab::GithubImport::PullRequestFormatter 2016-05-13 17:55:43 -05:00
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
Douwe Maan 7848d54f5b Clean up LegacyDiffNote somewhat 2016-05-13 17:31:58 -05:00
Douwe Maan 99d3e21f19 Extract LegacyDiffNote out of Note 2016-05-13 17:31:43 -05:00
Kamil Trzcinski 0958f331d1 Merge remote-tracking branch 'origin/master' into docker-registry
# Conflicts:
#	config/initializers/1_settings.rb
2016-05-13 17:14:46 -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
Kamil Trzcinski 509654b378 Improve JWT::RSAToken::kid 2016-05-13 16:41:30 -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
Ahmad Sherif 0c22698bd4 Add API endpoints for un/subscribing from/to a label
Closes #15638
2016-05-12 22:48:09 +02:00
Kamil Trzcinski fc2d985bfa Fix CI tests 2016-05-12 12:47:55 -05:00
Jacob Schatz f2303f9df0 Merge branch 'send-incremental-build-log' into 'master'
Update build log incrementally

Proof of concept implementation of incremental sending of build log to browser.

cc @jschatz1 @vsizov @grzesiek @tmaczukin 


See merge request !3737
2016-05-12 16:48:42 +00: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
Timothy Andrew a59ad3936a Add a spec for WikiLinkFilter
- And fix behavior for non-file hierarchical links.
2016-05-12 07:17:07 +05:30
Robert Speicher 24f353edc4 Merge branch '17249-starred' into 'master'
Restrict starred projects to viewable ones

`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.

Closes #17249.

See merge request !4108
2016-05-11 12:49:29 +00: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
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
Robert Speicher 971662e6a4 Merge branch 'stanhu/gitlab-ce-add-eager-load-lib' into 'master'
Add eager load paths to help prevent dependency load issues with Sidekiq workers

_Originally opened at !3545 by @stanhu._

- - -

Relevant resources:

- https://github.com/mperham/sidekiq/wiki/FAQ#why-doesnt-sidekiq-autoload-my-rails-application-code
- https://github.com/mperham/sidekiq/issues/1281#issuecomment-27129904
- http://blog.arkency.com/2014/11/dont-forget-about-eager-load-when-extending-autoload
- https://github.com/rails/rails/blob/52ce6ece8c8f74064bb64e0a0b1ddd83092718e1/railties/lib/rails/engine.rb#L472-L479
- https://github.com/rails/rails/blob/v4.2.6/railties/lib/rails/paths.rb

Attempts to address #3661, #11896, #12769, #13521, #14131, #14589, #14759, #14825.

See merge request !3724
2016-05-10 20:14:40 +00:00
Kamil Trzcinski db25c17036 Merge remote-tracking branch 'origin/master' into send-incremental-build-log 2016-05-10 13:58:10 -05:00
Sean McGivern 97424ea544 Restrict starred projects to viewable ones
`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.
2016-05-10 18:13:52 +01:00
Robert Speicher 0cc8cee6cd Merge branch 'fix/using-uploads-in-global-snippets' into 'master'
Fix using link to uploads in global snippets

Closes #17342, closes #17363

See merge request !4085
2016-05-10 17:07:10 +00:00
Grzegorz Bizon 535be93a77 Do not process upload links if no project context 2016-05-10 13:50:56 +02:00
Grzegorz Bizon 4c506c4498 Fix using link to uploads in global snippets
Closes #17342, closes #17363
2016-05-10 13:46:31 +02:00
Dmitriy Zaporozhets 21f942a5ad Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2016-05-10 12:51:24 +02:00
Rémy Coutable 5589dcf8db Fix a few places where autoloading would fail
- Fix naming of API::CommitStatuses
- Ensure we use require_dependency instead of require
- Ensure the namespace is right in lib/api/api.rb, otherwise, we
  might require Grape::API::Helpers which defines the `#params` method.
  This is to avoid requiring a file multiple times and getting an "Already
  initialized constant" error.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-10 11:51:19 +02:00
Rémy Coutable 3af78b5c53 Merge branch 'revert-4026' into 'master'
Revert "Merge branch 'wiki-fix' into 'master'"

This reverts commit 4cc85a58e8 (!4026), reversing
changes made to 90ae445ba9.

From https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4026#note_11719950:

>  1. On Ruby 2.1.x, the [`uri.path = ::File.join(project_wiki_base_path, uri.path)`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/banzai/filter/wiki_link_filter.rb#L39) raises an `URI::InvalidComponentError: bad component(expected relative path component): http://bar.com/baz` error in `Banzai::Filter::WikiLinkFilter#rebuild_wiki_uri`, which is then rescued in [`Banzai::Filter::WikiLinkFilter#process_link_attr`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/banzai/filter/wiki_link_filter.rb#L34), thus the link is not modified and the tests pass.
1. On Ruby 2.2.x, the same line doesn't raise an error anymore, thus tests are broken on Ruby 2.2 only. I didn't really understand yet why having absolute links in the wiki would break some tests vs having relative links as before, but I think the safest course to action is to revert this MR and to find another fix (probably just prepending `ProjectWiki#wiki_base_path` with the relative URL path component if we are in the case of a relative URL...
/cc @artem-sidorenko

Just a FYI note: no need to pick into `8-7-stable` since the original commit was not picked.

See merge request !4105
2016-05-10 09:47:55 +00:00
Yorick Peterse f96c34ec45 Merge branch 'remove-annotate-gem' into 'master'
Remove the annotate gem and delete old annotations

In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382 

/cc @yorickpeterse 

See merge request !4099
2016-05-10 09:08:30 +00: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
Jeroen van Baarsen 22db5e14f2 Remove the annotate rake task 2016-05-10 07:36:44 +02:00
Benedikt Huss bf0fd3ea1b Links for redmine issue references are generated correctly again 2016-05-10 00:37:15 +02:00
Stan Hu 849cc380d8 Use a case-insensitive comparison in sanitizing URI schemes
Closes #1625
2016-05-09 12:47:53 -07:00
Kamil Trzcinski b180d79cdc Rename DockerAuthenticationService to ContainerRegistryAuthenticationService 2016-05-09 22:04:42 +03:00
Robert Speicher f27fd27413 Merge branch 'cascade_drop' into 'master'
Add if exists to drop command

Add `IF EXISTS` as a precaution. Related to gitlab-org/gitlab-ce!4020

See merge request !4100
2016-05-09 18:17:57 +00:00
Kamil Trzcinski 1dea54c220 Remove unused parts 2016-05-09 20:35:01 +03:00