Commit Graph

3121 Commits

Author SHA1 Message Date
Sean McGivern ca3e9b9759 Merge branch 'blackst0ne-add-discord-service' into 'master'
Add Discord integration

Closes #21635

See merge request gitlab-org/gitlab-ce!22684
2018-11-12 10:12:48 +00:00
Nick Thomas 9adcd62df3 Merge branch 'rs-cherry-pick-api' into 'master'
Resolve possible cherry pick API race condition

Closes #53773

See merge request gitlab-org/gitlab-ce!22946
2018-11-09 17:29:19 +00:00
Robert Speicher 11dd9d6e1f
Resolve possible cherry pick API race condition
Previously, we just fetched the latest commit for the given branch when
presenting the resulting commit, but because something could have been
committed to that branch between the time we cherry-picked and the time
we render the result, the wrong commit could have been presented.

Now, we fetch the commit object with the commit SHA returned by the
commit change service, which should always be the correct commit.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53773
2018-11-09 16:38:59 +00:00
Robert Speicher 2331d3af63
Add revert to commits API 2018-11-09 15:26:38 +00:00
Sean McGivern 6d8810a64f Merge branch 'fj-41213-api-update-submodule-commit' into 'master'
Add endpoint to update a git submodule reference

Closes #41213

See merge request gitlab-org/gitlab-ce!20949
2018-11-07 15:11:30 +00:00
Sean McGivern fadaa3d181 Merge branch 'dm-api-merge-requests-index-merged-at' into 'master'
Expose {closed,merged}_{at,by} in merge requests API index

Closes #52031

See merge request gitlab-org/gitlab-ce!22806
2018-11-07 14:57:16 +00:00
Francisco Javier López 28cbb2acfe
Add submodule update API endpoint
This new endpoint allow users to update a submodule's reference.

The MR involves adding a new operation RPC operation in gitaly-proto
(see gitlab-org/gitaly-proto!233) and change Gitaly to use this
new version (see gitlab-org/gitaly!936).

See gitlab-org/gitlab-ce!20949
2018-11-07 14:03:30 +01:00
Douwe Maan 1208d55206 Merge branch 'master' into 'refactor-snippets-finder'
# Conflicts:
#   spec/models/project_spec.rb
2018-11-06 15:43:24 +00:00
Yorick Peterse d171ff6016
Rewrite SnippetsFinder to improve performance
This completely rewrites the SnippetsFinder class from the ground up in
order to improve its performance. The old code was beyond salvaging. It
was complex, included various Rails 5 workarounds, comments that
shouldn't be necessary, and most important of all: it produced a really
poorly performing database query.

As a result, I opted for rewriting the finder from scratch, instead of
trying to patch the existing code. Instead of trying to reuse as many
existing methods as possible, I opted for defining new methods
specifically meant for the SnippetsFinder. This requires some extra code
here and there, but allows us to have much more control over the
resulting SQL queries. It is these changes that then allow us to produce
a _much_ more efficient query.

To illustrate how bad the old query was, we will use my own snippets as
an example. Currently I have 52 snippets, most of which are global ones.
To retrieve these, you would run the following Ruby code:

    user = User.find_by(username: 'yorickpeterse')

    SnippetsFinder.new(user, author: user).execute

On GitLab.com the resulting query will take between 10 and 15 seconds to
run, producing the query plan found at
https://explain.depesz.com/s/Y5IX. Apart from the long execution time,
the total number of buffers (the sum of all shared hits) is around 185
GB, though the real number is probably (hopefully) much lower as I doubt
simply summing these numbers produces the true total number of buffers
used.

The new query's plan can be found at https://explain.depesz.com/s/wHdN,
and this query takes between 10 and 100-ish milliseconds to run. The
total number of buffers used is only about 30 MB.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/52639
2018-11-05 14:28:29 +01:00
Sean McGivern c12a4a9ac7 Merge branch 'use_tokenauthenticatable_method_for_token_lookup' into 'master'
Remove PersonalAccessTokensFinder#find_by method

See merge request gitlab-org/gitlab-ce!22617
2018-11-05 13:28:16 +00:00
Douwe Maan 34e8d9726d
Expose {closed,merged}_{at,by} in merge requests API index 2018-11-05 13:49:10 +01:00
Imre Farkas 8d900ade38
Remove PersonalAccessTokensFinder#find_by method
find_by_token is overriden by TokenAuthenticatable which can be easily
missed or confused with #find_by(:token) defined by ActiveRecord. First
step for safer usage is to remove #find_by.
2018-11-05 11:36:45 +01:00
Helmut Januschka 17a7b41132 add related merge request endpoint 2018-11-01 12:36:01 +01:00
Sean McGivern e62168fcae Merge branch 'ce-7927-filter-none-any-weight-issues-api' into 'master'
Split CE and EE params in issues API

See merge request gitlab-org/gitlab-ce!22689
2018-10-31 12:31:26 +00:00
Heinrich Lee Yu d01d1cc8ee Extract EE params in issues API to separate module 2018-10-30 21:37:58 +08:00
blackst0ne 846d84602f Add Discord integration 2018-10-30 22:23:20 +11:00
DJ Mountney 06b6daacb1 Merge remote-tracking branch 'origin/master' into dev-master 2018-10-29 14:37:19 -07:00
Jan Provaznik d3cd569bc6 Merge branch 'sh-fix-wiki-security-issue-53072' into 'master'
[master] Validate Wiki attachments are valid temporary files

See merge request gitlab/gitlabhq!2568
2018-10-29 16:08:08 +00:00
Douwe Maan f2e9148d18 Merge branch '42790-improve-feedback-for-internal-git-access-checks-timeouts' into 'master'
Adds trace of each access check when git push times out

Closes #42790

See merge request gitlab-org/gitlab-ce!22265
2018-10-26 18:03:40 +00:00
J.D. Bean ff89680330 Feature/add license to project API 2018-10-26 15:12:14 +00:00
Sean McGivern 8325a1fc9f Merge branch '52384-api-filter-assignee-none-any' into 'master'
Resolve "Filter by `None`/`Any` for assignee_id in issues/mrs API"

Closes #52384

See merge request gitlab-org/gitlab-ce!22598
2018-10-26 10:42:41 +00:00
Shinya Maeda 0c9ad4826a Support backward compatibility when introduce new failure reason 2018-10-26 08:01:28 +00:00
Heinrich Lee Yu e0f0c29b0c Support lowercase none / any 2018-10-26 10:47:14 +08:00
Heinrich Lee Yu bf1ed85a9d Refactor api validator to separate class 2018-10-26 10:32:14 +08:00
Heinrich Lee Yu 006631f882 Apply similar change to MRs API 2018-10-26 10:32:14 +08:00
Heinrich Lee Yu 227e30f7fe Issues API: Add None/Any option to assignee_id 2018-10-26 10:32:14 +08:00
Tiago Botelho 084a8b6101
Adds tracing messages for slow git pushes
Whenever a git push takes more than 50 seconds the user
will receive a trace from each check performed along with
their timings
2018-10-25 10:10:45 +01:00
Stan Hu a12d25d8a5 Validate Wiki attachments are valid temporary files
A malicious attacker could craft a request to read arbitrary files on
the system. This change adds a Grape validation to ensure that the
tempfile parameter delivered by the Rack multipart uploader is a
Tempfile type to prevent users from being able to specify arbitrary
filenames.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53072
2018-10-23 20:47:38 -07:00
Rémy Coutable 631f4e2f54 Merge branch '52559-applications-api-get-delete' into 'master'
Add Applications API endpoints for listing and deleting entries.

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

See merge request https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22296
2018-10-22 08:52:42 +00:00
Shinya Maeda 1f1b3923ec Rename "scheduled" label/badge of delayed jobs to "delayed" 2018-10-19 16:28:41 +00:00
Sean McGivern ffc505d217 Merge branch 'bvl-remove-forked-project-link' into 'master'
Remove ForkedProjectLink model

Closes #38883

See merge request gitlab-org/gitlab-ce!22226
2018-10-19 11:01:44 +00:00
Bob Van Landuyt f3fba178b9 Remove the `ForkedProjectLink` model
This removes the `ForkedProjectLink` model that has been replaced by
the `ForkNetworkMember` and `ForkNetwork` combination. All existing
relations have been adjusted to use these new models.

The `forked_project_link` table has been dropped.

The "Forks" count on the admin dashboard has been updated to count all
`ForkNetworkMember` rows and deduct the number of `ForkNetwork`
rows. This is because now the "root-project" of a fork network also
has a `ForkNetworkMember` row. This count could become inaccurate when
the root of a fork network is deleted.
2018-10-19 11:57:20 +02:00
William George 1b153d497b Make getting a user by the username case insensitive 2018-10-18 09:06:44 +00:00
Douwe Maan 0602fcb6bf Merge branch 'sh-remove-koding' into 'master'
Remove Koding integration and documentation

Closes #39697

See merge request gitlab-org/gitlab-ce!22334
2018-10-15 16:28:09 +00:00
JB Vasseur 1ae9aefe55 Use application finder for Doorkeeper Applications 2018-10-15 23:03:08 +09:00
Stan Hu 656831e173 Remove Koding integration and documentation
This integration no longer works and does not appear to be supported.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39697
2018-10-12 22:18:51 -07:00
Bob Van Landuyt 71d71afb3a Allow getting the merge base of multiple revisions
As we now support getting the merge base for multiple revisions in
gitaly, we can provide this functionality in our API
2018-10-12 11:41:22 +02:00
JB Vasseur abf7c10b67 Do not return secret from GET /applications !22296 2018-10-12 18:33:58 +09:00
JB Vasseur 1dbbd0b9b0 disable CodeReuse/ActiveRecord 2018-10-12 09:41:36 +09:00
JB Vasseur 23d70f6281 Improve call for retrieving all applications !22296 2018-10-12 09:40:11 +09:00
JB Vasseur 6dd4ae0d87 Support GET /applications and DELETE /applications/:id endpoints #52559 2018-10-11 19:54:15 +09:00
JB Vasseur 3421f1d124 Expose id and name attributes to Applications API 2018-10-11 19:52:42 +09:00
Zeger-Jan van de Weg 30b4ce940d
Remove Git circuit breaker
Was introduced in the time that GitLab still used NFS, which is not
required anymore in most cases. By removing this, the API it calls will
return empty responses. This interface has to be removed in the next
major release, expected to be 12.0.
2018-10-10 09:08:18 +02:00
Bob Van Landuyt ca9b99ffbb Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2018-10-05 19:53:10 +02:00
Bob Van Landuyt 36bd078382 Merge branch 'security-bw-confidential-titles-through-markdown-api' into 'master'
[master] Confidential issue/private snippet titles can be read by unauthenticated user through GFM markdown API

Closes #2706

See merge request gitlab/gitlabhq!2507
2018-10-05 17:47:52 +00:00
Robert Speicher b407061a28 Merge branch 'ce-5987-project-templates-api' into 'master'
Add a new project-specific templates API endpoint

See merge request gitlab-org/gitlab-ce!22118
2018-10-05 17:40:32 +00:00
Shinya Maeda 7542a5d102 Merge branch 'master-ce' into scheduled-manual-jobs 2018-10-05 23:38:02 +09:00
Tuomo Ala-Vannesluoma c84b60b164 Make GitLab pages support access control 2018-10-05 13:41:11 +00:00
Nick Thomas 25bd49e4f5
Backport project template API to CE 2018-10-05 11:34:43 +01:00
Douwe Maan 9fcd903b60 Merge branch 'features/unauth-access-ssh-keys' into 'master'
List public ssh keys by id or username without authentication

See merge request gitlab-org/gitlab-ce!20118
2018-10-05 08:41:04 +00:00