summaryrefslogtreecommitdiff
path: root/lib/api
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge branch ↵revert-47e5eedcKerri Miller2019-05-201-4/+0
| | | | | '55127-add-delay-after-mr-creation-for-async-tasks-to-complete' into 'master'" This reverts merge request !27978
* CE port of Move EE specific lines in API::GroupsImre Farkas2019-05-202-14/+19
|
* Added filtering jobs by age to jobs/request API endpointDmitry Chepurovskiy2019-05-201-0/+1
|
* Merge branch 'ce-57402-add-issues-statistics-api-endpoints' into 'master'Rémy Coutable2019-05-204-38/+147
|\ | | | | | | | | Add issues_statistics api endpoints See merge request gitlab-org/gitlab-ce!27366
| * Review updates and cleanupce-57402-add-issues-statistics-api-endpointsAlexandru Croitor2019-05-174-40/+24
| | | | | | | | | | | | | | * Cleaned issues and issues_statistics docs * Renamed param with_labels_data to with_labels_details * Added spec for N+1 check when retrieving labels from issue * Refactoed CheckAssigneesCount validation class
| * Add params validations and remove extra params supportAlexandru Croitor2019-05-153-19/+63
| | | | | | | | | | | | | | | | | | Remove label_name and milestone_title params support Add mutually_exclusive validation for author_id and author_username Add mutually_exclusive validation for assignee_id and assignee_username Add validation to allow single value for asignee_username on CE Add separate issue_stats_params helper for statistics params and reuse in issues_params.
| * Move issue details to from IssueBasic to Issue entityAlexandru Croitor2019-05-153-14/+26
| | | | | | | | | | Cleanup IssueBasic entity to keep it basic and move extra attributes to Issue entity which contains more details
| * Changes to issues apiAlexandru Croitor2019-05-153-28/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When issues_controller endpoint was used for search, the parameters passed to the controller were slightly different then the ones passed to API. Because the searchbar UI is reused in different places and builds the parameters passed to request in same way we need to account for old parameter names. Add issues_statistics api endpoints Adds issue_statistics api endpoints for issue lists and returns counts of issues for all, closed and opened states. Expose more label attributes based on a param When requesting issues list through API expose more attributes for labels, like color, description if with_labels_data param is being passed, avoiding this way to change response schema for users that already use API. https://gitlab.com/gitlab-org/gitlab-ce/issues/57402
* | #46469 - Added ref querystring parameter to project search to allow ↵Lee Tickett2019-05-171-1/+2
|/ | | | searching on branches other than master
* Rename methods that conflict in Rails 5.255583-rename-method-conflictsHeinrich Lee Yu2019-05-121-1/+1
| | | | | Adds suffix to enum methods and changes `in_groups` to `of_groups`
* Confirm existence of head_pipeline if pipeline success requiredKerri Miller2019-05-071-0/+4
| | | | | | | | | Pipelines are created by an async worker, so a rapid sequence of API calls can trigger a state where the pipeline, whose existence is part of determining if we wait for the pipeline to successfully complete before merging, can trigger the MR to be immediately merged instead. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55127
* Use a path for the related merge requests endpointsh-fix-related-merge-requests-pathStan Hu2019-05-071-0/+4
| | | | | | | | | | Hosts using a non-standard configuration may have a different hostname/port/scheme than what may be configured on the GitLab server. While expose_url should generate a proper URL, there are cases where it may not work. Since we don't need the full URL, we can use the relative path. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/61280
* Allow replying to an individual note in the APIallow-replying-to-individual-notes-from-apiSean McGivern2019-05-061-1/+5
| | | | | | If you can do this in the UI, you should be able to do it in the API. If a discussion is not a single note discussion, or it is replyable, you can reply to it.
* Implement support for CI variables of type fileKrasimir Angelov2019-05-064-1/+7
| | | | | | | | | Add env_var and file as supported types for CI variables. Variables of type file expose to users existing gitlab-runner behaviour - save variable value into a temp file and set the path to this file in an ENV var named after the variable key. Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/46806.
* Merge branch 'ce-11225-es_limited_namespaces_removal' into 'master'Nick Thomas2019-05-061-0/+6
|\ | | | | | | | | Backport "Fix namespace/project removal elasticsearch limit" to CE See merge request gitlab-org/gitlab-ce!27933
| * Backport of 328-versioned-es-schemace-11225-es_limited_namespaces_removalMario de la Ossa2019-05-021-0/+6
| |
* | Run rubocop -a on CE filessh-upgrade-rubocop-0.68.0-ceStan Hu2019-05-051-1/+1
| |
* | Allow guests users to access project releasesKrasimir Angelov2019-05-032-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is step one of resolving https://gitlab.com/gitlab-org/gitlab-ce/issues/56838. Here is what changed: - Revert the security fix from bdee9e8412d. - Do not leak repository information (tag name, commit) to guests in API responses. - Do not include links to source code in API responses for users that do not have download_code access. - Show Releases in sidebar for guests. - Do not display links to source code under Assets for users that do not have download_code access. GET ':id/releases/:tag_name' still do not allow guests to access releases. This is to prevent guessing tag existence.
* | Whitelist query limits for internal APIStan Hu2019-05-031-0/+2
| | | | | | | | | | | | | | | | | | When creating a merge request for push options, there may be over 100 queries that are run to create a merge request. Even after we reduce the number of queries by disabling the Sidekiq jobs, it appears we still hover near this limit. Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/11450
* | Add gitlab-managed option to clusters formMayra Cabrera2019-05-031-0/+1
|/ | | | | | | | When this option is enabled, GitLab will create namespaces and service accounts as usual. When disabled, GitLab wont create any project specific kubernetes resources Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56557
* Merge branch 'secure-disallow-read-user-scope-to-read-project-events' into ↵GitLab Release Tools Bot2019-04-294-47/+63
|\ | | | | | | | | | | | | 'master' Disallow read user scope to read project events See merge request gitlab/gitlabhq!3067
| * Add new api class for projects eventsMałgorzata Ksionek2019-04-244-47/+63
| | | | | | | | | | | | | | | | | | | | | | | | Refactor api events class to use external helper Move specs from old class Add changelog and magic string Refactor events class to be more explicit Remove blank line
* | Merge branch 'get-rid-of-user-namespace-method' into 'master'Dmitriy Zaporozhets2019-04-252-4/+2
|\ \ | | | | | | | | | | | | Get rid of the user_namespace API helper method See merge request gitlab-org/gitlab-ce!27636
| * | Get rid of the user_namespace API helper methodRémy Coutable2019-04-242-4/+2
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Added list_pages method to avoid loading all wiki pages contentFrancisco Javier López2019-04-251-1/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Inside a wiki, when we show the sidebar or browse to the `pages`, all page contents are retrieved from Gitaly and that is a waste of resources, since no content from that pages are going to be showed. This MR introduces the method `ProjectWiki#list_pages`, which uses new wiki_list_pages RPC call to retrieve pages without content Also in the `WikisController` we're using the method to show pages in the sidebar and also on the `pages` page.
* | Introduce ServiceResponse to wrap around responseLin Jen-Shin2019-04-221-2/+2
| | | | | | | | See https://gitlab.com/gitlab-org/gitlab-ce/issues/60730
* | Merge branch '39858-add-group-owned-info-to-projects-api' into 'master'Douwe Maan2019-04-191-1/+9
|\ \ | | | | | | | | | | | | | | | | | | Return group information on Project endpoint Closes #39858 See merge request gitlab-org/gitlab-ce!27427
| * | Adds namespace information to project endpoint39858-add-group-owned-info-to-projects-apiMayra Cabrera2019-04-181-1/+9
| |/ | | | | | | | | | | | | | | | | | | | | - Namespace now return avatar_url and web_url - NamespaceBasic entity was modified to include avatar_url and web_url, information is fetched differently depending if the Namespace is a user or a group Includes documentation changes Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39858
* | Add configuration of access_level for runners on registration via APIzelin-l2019-04-181-1/+3
| | | | | | | | | | Allow setting access_level of new runner to not_protected (default) or ref_protected Minor update to relevant docs and tests
* | Set correct timestamps when creating past issues58361-issue-create-system-note-timestampHeinrich Lee Yu2019-04-161-0/+1
|/ | | | Sets `system_note_timestamp` from `created_at`
* Fix remove_source_branch merge request API handlingsh-fix-merge-requests-api-remove-branch-paramStan Hu2019-04-151-1/+1
| | | | | | | | | Users attempting to set merge requests to `remove_source_branch` to `false` would encounter an Error 500 because the UpdateService and API checked `present?`, which would always return `false`. We now just use `has_key?` to decide whether the parameter is present. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60530
* Forbid the use of `#reload` and prefer `#reset`forbid-the-usage-of-reloadKamil Trzciński2019-04-152-4/+4
| | | | | | | The `#reload` makes to load all objects into memory, and the main purpose of `#reload` is to drop the association cache. The `#reset` seems to solve exactly that case.
* Merge branch 'patch-31' into 'master'Stan Hu2019-04-111-0/+4
|\ | | | | | | | | | | | | Add missing provider_unauthorized method to import_github.rb Closes #60347 See merge request gitlab-org/gitlab-ce!27218
| * Return a `401` error codeBen2019-04-111-1/+1
| |
| * Fix trailing white spaceBen2019-04-101-1/+1
| |
| * Add missing provider_unauthroized method to import_github.rb Ben2019-04-101-0/+4
| |
* | Revert "Remove HipChat integration from GitLab"Sean McGivern2019-04-101-0/+40
|/ | | | This reverts commit a5378665a1dc0b9c8dc3a4fa279a0eb78aac5aac.
* Move Contribution Analytics related spec in ↵Imre Farkas2019-04-093-3/+9
| | | | spec/features/groups/group_page_with_external_authorization_service_spec to EE
* Merge branch 'osw-multi-assignees-merge-requests' into 'master'Nick Thomas2019-04-092-1/+9
|\ | | | | | | | | [Backport] Support multiple assignees for merge requests See merge request gitlab-org/gitlab-ce!27089
| * [CE] Support multiple assignees for merge requestsosw-multi-assignees-merge-requestsOswaldo Ferreira2019-04-082-1/+9
| | | | | | | | | | Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161 (code out of ee/ folder).
* | Add new permission model `read-pipeline-variable`Agustin Henze2019-04-091-0/+13
| | | | | | | | | | | | | | Used to get the variables via the API endpoint `/projects/:id/pipelines/:pipeline_id/variables` Signed-off-by: Agustin Henze <tin@redhat.com>
* | Merge branch '43263-git-push-option-to-create-mr' into 'master'Nick Thomas2019-04-092-8/+38
|\ \ | | | | | | | | | | | | | | | | | | Git push options to create a merge request, set target_branch and set merge when pipeline succeeds Closes #53198 and #43263 See merge request gitlab-org/gitlab-ce!26752
| * | Feature flag for merge requestion push optionsLuke Duncalfe2019-04-091-2/+4
| | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/43263 https://gitlab.com/gitlab-org/gitlab-ce/issues/53198
| * | Refactor PushOptionsHandlerService from reviewLuke Duncalfe2019-04-092-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exceptions are no longer raised, instead all errors encountered are added to the errors property. MergeRequests::BuildService is used to generate attributes of a new merge request. Code moved from Api::Internal to Api::Helpers::InternalHelpers.
| * | Use Gitlab::PushOptions for `ci.skip` push optionLuke Duncalfe2019-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the raw push option Array was sent to Pipeline::Chain::Skip. This commit updates this class (and the chain of classes that pass the push option parameters from the API internal `post_receive` endpoint to that class) to treat push options as a Hash of options parsed by GitLab::PushOptions. The GitLab::PushOptions class takes options like this: -o ci.skip -o merge_request.create -o merge_request.target=branch and turns them into a Hash like this: { ci: { skip: true }, merge_request: { create: true, target: 'branch' } } This now how Pipeline::Chain::Skip is determining if the `ci.skip` push option was used.
| * | Support merge request create with push optionsLuke Duncalfe2019-04-092-7/+34
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To create a new merge request: git push -u origin -o merge_request.create To create a new merge request setting target branch: git push -u origin -o merge_request.create \ -o merge_request.target=123 To update an existing merge request with a new target branch: git push -u origin -o merge_request.target=123 A new Gitlab::PushOptions class handles parsing and validating the push options array. This can be the start of the standard of GitLab accepting push options that follow namespacing rules. Rules are discussed in issue https://gitlab.com/gitlab-org/gitlab-ce/issues/43263. E.g. these push options: -o merge_request.create -o merge_request.target=123 Become parsed as: { merge_request: { create: true, target: '123', } } And are fetched with the class via: push_options.get(:merge_request) push_options.get(:merge_request, :create) push_options.get(:merge_request, :target) A new MergeRequests::PushOptionsHandlerService takes the `merge_request` namespaced push options and handles creating and updating merge requests. Any errors encountered are passed to the existing `output` Hash in Api::Internal's `post_receive` endpoint, and passed to gitlab-shell where they're output to the user. Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/43263
* | Add new API endpoint to expose single environmentKrasimir Angelov2019-04-092-4/+20
|/ | | | | | | | This is resolving https://gitlab.com/gitlab-org/gitlab-ce/issues/30157. Implement new API endpoint `/projects/:id/environments/:environment_id` to expose single environment. Include information for environment's last deployment if there is one.
* Fix `updated_at` doesn't apply to `state_event` updates of issues via APISean McGivern2019-04-081-3/+7
|
* Merge branch 'duplicate-related-mrs' into 'master'Michael Kozono2019-04-051-1/+1
|\ | | | | | | | | Remove duplicates from issue related merge requests See merge request gitlab-org/gitlab-ce!27067
| * Remove duplicates from issue related merge requestsduplicate-related-mrsAlexandru Croitor2019-04-051-1/+1
| | | | | | | | | | | | | | | | Remove duplicates returned by Issues#related_merge_requests API that relies on ReferencedMergeRequestsService which returns 2 arrays one of related MRs and one of related MRs that close the issue(i.e. a subset of first one). We only need related MRs in this case so just pick the first array.