Commit Graph

3380 Commits

Author SHA1 Message Date
Thiago Presa 538741f230 Add highest_role method to User 2019-03-22 09:54:03 +00:00
Alexis Reigel 27ac48c394
Apply suggestion to lib/api/search.rb 2019-03-15 21:03:49 +01:00
Alexis Reigel fcf90d051b
un-dry the search api scope
due to the usage in EE this attempt to more DRYness is not worth it.
2019-03-14 18:39:54 +01:00
Alexis Reigel b0981097c3
return 400 on users search and feature is disabled
as the params block is evaluated when loading the class and the db
connection is not available yet we can't use the feature toggle inside
that block.
2019-03-14 18:39:54 +01:00
Alexis Reigel 55629a2e4d
add feature flag for users search 2019-03-14 18:30:30 +01:00
Alexis Reigel c36d98501b
extract helper for search scope api param 2019-03-14 18:30:29 +01:00
Alexis Reigel 0592233a1a
add users search to search api 2019-03-14 18:21:01 +01:00
Nick Thomas 9f05e97aad
Run rubocop -a 2019-03-13 13:42:43 +00:00
Robert Speicher ccbbc1000d Merge branch 'resolve-lib-differences' into 'master'
Resolve CE to EE differences in the lib/api directory

See merge request gitlab-org/gitlab-ce!25430
2019-03-12 17:03:50 +00:00
Fabio Papa 91ebfcb6cc Remove fake repository_path response
The repository_path is no longer needed since
https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/231, which closes
https://gitlab.com/gitlab-org/gitlab-shell/issues/135.
2019-03-12 16:27:26 +00:00
Bob Van Landuyt b0fac091ec Authenticate the internal API using a header
Instead of mixing in the shared secret into the querystring or body,
we could also specify it in a header.
2019-03-11 16:46:04 +01:00
Igor 9745d0de2f Provide EE backports for filtering by approver feature
Adds custom validator for ArrayNoneAny param
Extracts some logic in js into separate files
2019-03-07 23:55:45 +00:00
Igor e779477e8c Revert "Merge branch 'id-1951-filter-merge-requests-by-approvers' into 'master'"
This reverts merge request !24982
2019-03-07 14:59:43 +00:00
Sean McGivern 3781cbe0c3 Merge branch 'sh-optimize-todos-api' into 'master'
Significantly reduce N+1 queries in /api/v4/todos endpoint

Closes #40378

See merge request gitlab-org/gitlab-ce!25711
2019-03-07 10:29:04 +00:00
Igor 572e3f2254 Provide EE backports for filtering by approver feature
Adds custom validator for ArrayNoneAny param
Extracts some logic in js into separate files
2019-03-07 07:06:54 +00:00
Robert Speicher 12818c2043 Merge branch '41888-access-personal-snippets-by-api' into 'master'
Allow all snippets to be accessed by API

Closes #41888

See merge request gitlab-org/gitlab-ce!25772
2019-03-06 19:47:05 +00:00
Andrew Newdigate 3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02:00
Stan Hu 062efe4f7a Significantly reduce N+1 queries in /api/v4/todos endpoint
By preloading associations and batching issuable metadata lookups,
we can significantly cut the number of SQL queries needed to load
the Todos API endpoint.

On GitLab.com, my own tests showed my user's SQL queries went
from 365 to under 60 SQL queries.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40378
2019-03-06 07:03:46 -08:00
Sean McGivern f1185520b9 Merge branch 'api-mr-put-labels' into 'master'
PUT MergeRequest API endpoint - accept labels as an array

See merge request gitlab-org/gitlab-ce!19914
2019-03-06 14:13:22 +00:00
Alexandru Croitor be3578d245 Add array support for labels
* Support label parameter as comma separated and array of strings
for merge requests and issues api endpoints
2019-03-06 13:28:42 +02:00
Roger Rüttimann 4db8336786 API: delete job_artifacts of a single job 2019-03-06 11:06:21 +00:00
Mario de la Ossa ee8cb2d1b3 PUT MergeRequest API endpoint - accept labels as an array 2019-03-06 12:56:29 +02:00
Patrick Bajao de5aef3bbd Accept force option on commit via API
When `force` is set to `true` and `start_branch` is set, the
branch will be ovewritten with the new commit based on the
`HEAD` of the `start_branch`.

This commit includes changes to update the `gitaly-proto` gem.
2019-03-06 10:44:59 +00:00
Nick Thomas e05a86cecd
Allow all personal snippets to be accessed by API
Previously, you could only access personal snippets in the API if you
had authored them. The documentation doesn't state that this is the
case, and it's quite surprising.
2019-03-06 09:05:03 +00:00
Nick Thomas 21779d0018
Add metadata about the GitLab server to GraphQL 2019-03-05 15:00:32 +00:00
Yorick Peterse 59db98a0ca
Merge dev master into GitLab.com master 2019-03-04 19:44:46 +01:00
Yorick Peterse 6683298fe6 Merge branch 'security-commit-private-related-mr' into 'master'
Don't allow non-members to see private related MRs

Closes #2787

See merge request gitlab/gitlabhq!2866
2019-03-04 18:37:10 +00:00
Igor Drozdov 5169dafccf Forbid creating discussions for users with restricted access 2019-03-04 18:37:08 +00:00
Yorick Peterse 9faf957bd3 Merge branch 'security-protect-private-repo-information' into 'master'
Fix leaking private repository information in API

See merge request gitlab/gitlabhq!2881
2019-03-04 18:37:03 +00:00
Yorick Peterse d8b4e585a1 Merge branch 'security-tags-oracle' into 'master'
Prevent Releases links API to leak tag existence

Closes #2795

See merge request gitlab/gitlabhq!2893
2019-03-04 18:37:01 +00:00
Yorick Peterse b50ad88460 Merge branch '2802-security-add-public-internal-groups-as-members-to-your-project-idor' into 'master'
Add public/internal groups as members to your Project(IDOR)

See merge request gitlab/gitlabhq!2898
2019-03-04 18:36:52 +00:00
Yorick Peterse a7004e2825
Add method to API::Variables for filtering params
This allows EE to customize the parameters used in two places, without
having to modify the source code directly.
2019-03-04 17:44:57 +01:00
Yorick Peterse 3f629b8d14
Update Triggers documentation per EE
This backports a line from EE so that both the CE and EE code are
identical.
2019-03-04 17:44:57 +01:00
Yorick Peterse 85f11eff9b
Refactor API::Settings for EE
This refactors API::Settings so that EE can more easily extend its
behaviour, without having to modify the CE source code directly.
2019-03-04 17:44:57 +01:00
Yorick Peterse 3156db3293
Move API::Services constants to a helper
This moves various constants previously defined in API::Services to the
API::Helpers::ServicesHelpers module, using class methods instead of
constants. This allows EE to extend the returned values, without having
to modify the CE source code directly.
2019-03-04 17:44:57 +01:00
Yorick Peterse 712148518b
Refactor API::Search for EE
This refactors API::Search so that Enterprise Edition can more easily
extend its functionality, without having to modify the file directly.
2019-03-04 17:44:57 +01:00
Yorick Peterse 6c9e26a2a0
Move eventable types constant to a helper
This moves API::ResourceLabelEventsHelpers::EVENTABLE_TYPES to a class
method in a separate helper module, allowing EE to redefine it without
having to directly modify the source code.
2019-03-04 17:44:56 +01:00
Yorick Peterse 6402880c70
Move LFS HTTP URL to a separate method
This adds a method to API::Internal that returns the URL to use for LFS
authentication tokens. This makes it possible for EE to redefine this
behaviour, without having to directly modify the source code.
2019-03-04 17:44:56 +01:00
Yorick Peterse 88abe1ec55
Use a method for updating groups in the API
Similar to creating groups in the groups API, EE injects custom code
just before we update an existing group. Moving the update logic to a
separate method in CE allows EE to more easily extend it.
2019-03-04 17:44:56 +01:00
Yorick Peterse 890ffac61b
Use a method for creating groups in the API
EE has some custom behaviour that needs to run before and after creating
a group in the API. By moving the group creation logic to a separate
method, EE can easily extend this behaviour; without having to directly
modify the API source code.
2019-03-04 17:44:56 +01:00
Yorick Peterse 654c4dd922
Refactor API noteable types constants
This replaces API::Notes::NOTEABLE_TYPES and
API::Discussions::NOTEABLE_TYPES with class methods defined in a
separate helper modules. This allows EE to extend the list of noteable
types, without having to modify the constant in-place. We can't define
these methods directly in the API classes, as they would be used before
we're able to extend them in EE.
2019-03-04 17:44:56 +01:00
Alexis Reigel d3accd36a0
add tag_list param to runners api 2019-02-27 20:19:49 +01:00
Nick Thomas a5174cf0fc Merge branch '42086-project-fetch-statistics-api-http-only' into 'master'
Resolve "Project fetch statistics API (HTTP only)"

Closes #42086

See merge request gitlab-org/gitlab-ce!23596
2019-02-27 12:07:05 +00:00
Douwe Maan 7ebe264779 Merge branch 'osw-merge-refs-refreshing-api' into 'master'
API support for MR merge to temporary merge ref path

Closes #57252

See merge request gitlab-org/gitlab-ce!24918
2019-02-27 10:59:06 +00:00
Jacopo 5ae9a44aa1 Add project http fetch statistics API
The API get projects/:id/traffic/fetches allows user with write
access to the repository to get the number of clones for the
last 30 days.
2019-02-27 11:52:35 +01:00
Alexander Koval 1874aa9a3b Reduce code duplication
Move logic of obtaining Issuable data to separate method
2019-02-27 10:28:53 +00:00
Nermin Vehabovic f9e38cd39f Added: Documentation for the API
Added: Specs for the API action
2019-02-26 23:18:40 +00:00
Heinrich Lee Yu f4be2d4e1b Revert "Merge branch '56726-fix-n+1-in-issues-and-merge-requests-api' into 'master'"
This reverts merge request !25042
2019-02-26 17:59:26 +00:00
Alexander Koval 35c1092282 Reduce code duplication
Move logic of obtaining Issuable data to separate method
2019-02-26 17:13:45 +00:00
Lin Jen-Shin 13c723f1dd Merge branch 'ce-revert-d5ce84fd' into 'master'
Revert "Merge branch 'revert-82d7b5a0-ce' into 'master'"

Closes #57857 and #50747

See merge request gitlab-org/gitlab-ce!25559
2019-02-26 16:02:28 +00:00