Commit Graph

895 Commits

Author SHA1 Message Date
GitLab Bot eca3cd3a9e Add latest changes from gitlab-org/gitlab@master 2019-11-15 18:06:24 +00:00
GitLab Bot 6e3880e2bb Add latest changes from gitlab-org/gitlab@master 2019-11-12 21:06:30 +00:00
GitLab Bot 7801d133b6 Add latest changes from gitlab-org/gitlab@master 2019-11-12 09:06:14 +00:00
GitLab Bot 1ef4b65f55 Add latest changes from gitlab-org/gitlab@master 2019-11-08 06:06:24 +00:00
GitLab Bot 82cef8dd1f Add latest changes from gitlab-org/gitlab@master 2019-11-05 21:07:46 +00:00
GitLab Bot 56d96ad7fa Add latest changes from gitlab-org/gitlab@master 2019-11-01 03:06:26 +00:00
GitLab Bot 29eea410c4 Add latest changes from gitlab-org/gitlab@master 2019-10-28 09:06:04 +00:00
GitLab Bot 33813f993b Add latest changes from gitlab-org/gitlab@master 2019-10-24 12:06:03 +00:00
GitLab Bot c77dd0995c Add latest changes from gitlab-org/gitlab@master 2019-10-24 00:07:18 +00:00
GitLab Bot 11faf8ae72 Add latest changes from gitlab-org/gitlab@master 2019-10-23 21:06:17 +00:00
GitLab Bot 184c2ced07 Add latest changes from gitlab-org/gitlab@master 2019-10-17 18:08:05 +00:00
GitLab Bot 6b75320f52 Add latest changes from gitlab-org/gitlab@master 2019-10-17 12:07:33 +00:00
GitLab Bot 565fa11a26 Add latest changes from gitlab-org/gitlab@master 2019-10-14 21:06:30 +00:00
GitLab Bot e4f5b70718 Add latest changes from gitlab-org/gitlab@master 2019-10-08 03:05:52 +00:00
GitLab Bot 31040b5bfe Add latest changes from gitlab-org/gitlab@master 2019-10-07 15:05:59 +00:00
GitLab Bot 5e5da0f1ee Add latest changes from gitlab-org/gitlab@master 2019-10-04 18:05:55 +00:00
GitLab Bot 1bab0ba591 Add latest changes from gitlab-org/gitlab@master 2019-10-01 09:10:39 +00:00
GitLab Bot 5707f305f4 Add latest changes from gitlab-org/gitlab@master 2019-09-26 12:06:00 +00:00
GitLab Bot 759cd6c298 Add latest changes from gitlab-org/gitlab@master 2019-09-26 09:06:04 +00:00
GitLab Bot 1cfd8874ee Add latest changes from gitlab-org/gitlab@master 2019-09-25 09:06:04 +00:00
GitLab Bot c792263edf Add latest changes from gitlab-org/gitlab@master 2019-09-23 18:06:14 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
GitLab Bot bd860c22f6 Add latest changes from gitlab-org/gitlab@master 2019-09-17 12:06:48 +00:00
GitLab Bot 84727c8209 Add latest changes from gitlab-org/gitlab@master 2019-09-16 15:06:26 +00:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Ash McKenzie d7c1af988d Merge branch 'issue-67127' into 'master'
Expose :protected field for ../tags/:tag_name API endpoint

See merge request gitlab-org/gitlab-ce!32790
2019-09-10 00:49:53 +00:00
Manoj MJ b041321a35 Application Statistics API
This change implements Application
Statistics API
2019-09-09 03:38:42 +00:00
Andrea Leone 26435701bc
Fix after 'static-analysis' job fail 2019-09-07 16:25:53 +02:00
Andrea Leone b807b42aa3
Expose :protected field for ../tags/:tag_name API endpoint 2019-09-07 10:45:52 +02:00
Winnie Hellmann 61515737a5 Add epic_iid to issue API entity
(cherry picked from commit 0bf7fecdee5a200eeb4f27b4888a57ceee63bde9)
2019-09-04 14:44:37 +00:00
Etienne Baqué a43ab8d6a4 Added relationships between Release and Milestone
Modified schema via migrations.
Added one-to-one relationship between the two models.
Added changelog file
2019-09-03 09:38:59 +00:00
Robert Speicher 7698d40550
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-08-29 17:17:37 -05:00
Michael Kozono 50342028aa
Simplify internal post receive messages
Instead of sending varied data to Gitaly, and making Gitaly construct
various messages, build the messages first and have Gitaly print
either basic messages or alert messages, in the order they come.

Depends on https://gitlab.com/gitlab-org/gitaly/merge_requests/1410
2019-08-28 15:18:58 -07:00
Winnie Hellmann 75353242e2 Replace prepend_entity with prepend_if_ee
(cherry picked from commit 897a9d308db46b620b738b98f2b0e5630ac7d2dd)
2019-08-27 15:11:15 +00:00
Brett Walker ad05e48863 Add support for using a Camo proxy server
User images and videos will get proxied through
the Camo server in order to keep malicious
sites from collecting the IP address of users.
2019-08-23 23:44:53 -05:00
Stan Hu ba7c501fef Fix Gitaly N+1 calls with listing issues/MRs via API
In GitLab 9.0,
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9661 removed the
`subscribed` flag from the API when the user requested a list of issues
or merge requests since calculating this value triggers extensive
Markdown processing.

In GitLab 12.0 via a4fbf39e, we accidentally reintroduced this
performance regression by changing `IssueBasic` to `Issue` in
`entities.rb`. This showed up as a Gitaly N+1 issue since the Markdown
processing would attempt to extract a commit if it detected a regex that
matched a commit.

We restore the prior behavior by once again removing the `subscribed`
flag for the bulk list of issues and merge requests and add a test to
ensure they aren't reintroduced.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66202
2019-08-17 20:35:37 -07:00
Rémy Coutable 44065b0138 Merge branch 'speed-up-labels-api' into 'master'
Remove label issue and MR counts from default API responses

See merge request gitlab-org/gitlab-ce!31543
2019-08-09 06:25:29 +00:00
Hordur Freyr Yngvason 5f82ff1469 Bring scoped environment variables to core
As decided in https://gitlab.com/gitlab-org/gitlab-ce/issues/53593
2019-08-08 18:51:52 +00:00
Sean McGivern e6dc5168b8 Remove label issue and MR counts from default API responses
These counts significantly increase the load time for these
requests. Users can now opt in to receiving the counts by setting
`with_counts=true` in requests. This is a breaking change, but hopefully
a fairly minor one.
2019-08-08 17:10:41 +01:00
Camil Staps e8bdcdf0f8
Expose time since starring on project/:id/starrers API endpoint; exclude private profiles here as well 2019-08-07 20:49:16 +02:00
George Koltsov 5e3a208f58 Add backwards compatibility for legacy setting
`allow_local_requests_for_hooks_and_services` was renamed to
`allow_local_requests_for_web_hooks_and_services`.
2019-08-02 15:39:18 +01:00
Nick Thomas 3bb3ac3d53 Merge branch 'add-git-blame-api' into 'master'
Expose git blame in api

Closes #51345

See merge request gitlab-org/gitlab-ce!30675
2019-07-29 11:41:44 +00:00
Oleg Zubchenko 5a8eaef42e Add git blame api 2019-07-26 19:27:32 +03:00
Heinrich Lee Yu 1ce5bcacdb Remove code related to object hierarchy in MySQL
These are not required because MySQL is not
supported anymore
2019-07-25 15:35:06 +08:00
Nick Thomas 4aa76dddec
Remove dead MySQL code
None of this code can be reached any more, so it can all be removed
2019-07-23 16:53:03 +01:00
Imre Farkas 7aa1d17475 CE port of "Move external authorization service API management to EE"
EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14598
2019-07-17 07:20:17 +00:00
Grzegorz Bizon 1def071991 Merge branch '55623-group-cluster-apis' into 'master'
Resolve "API support for group-level clusters"

Closes #55623

See merge request gitlab-org/gitlab-ce!30213
2019-07-12 08:36:24 +00:00
Dylan Griffith 7fb076f5d0 Add API for CRUD group clusters
This is basically a copy of the API for project clusters.
2019-07-11 17:22:58 +10:00
Jan Provaznik 227d8b4445 Merge branch '58275-rename-project-entity' into 'master'
Rename ProjectEntity to IssuableEntity

Closes #58275

See merge request gitlab-org/gitlab-ce!30217
2019-07-10 05:39:44 +00:00
Alexandru Croitor dba5f3aeea Rename ProjectEntity to IssuableEntity 2019-07-09 15:41:45 +03:00
Mathieu Parent 32bbb52c19 Fix API performance problem of auto_devops query 2019-07-03 16:18:05 +02:00
Mathieu Parent e44167004d Add auto_devops_* to project API
The auto_devops object sometimes doesn't exists. We may need to create
it.
2019-07-03 16:18:05 +02:00
Mathieu Parent 5028f5d73d Add auto_cancel_pending_pipelines to project API 2019-07-03 16:18:05 +02:00
Mathieu Parent 5f04d24934 Add build_coverage_regex to project API 2019-07-03 16:18:05 +02:00
Mathieu Parent a7892e7171 Add build_timeout to project API 2019-07-03 16:18:05 +02:00
Mathieu Parent 353e68772c Add build_git_strategy attribute to project API
We map the boolean to the string 'fetch' or 'clone', to be more
explicit.
2019-07-03 16:18:05 +02:00
Mathieu Parent 26b7b47558 Add *_access_level to project API
- issues_access_level
- repository_access_level
- merge_requests_access_level
- builds_access_level
- wiki_access_level
- snippets_access_level
2019-07-03 16:18:05 +02:00
Marin Jankovski c20c9e2940
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2019-07-03 11:55:56 +02:00
Jason Goodman 7ecffe2987 Show upcoming status for releases
Add released_at field to releases API
Add released_at column to releases table
Return releases to the API sorted by released_at
2019-07-03 09:12:15 +00:00
Marin Jankovski fa77293bdc Merge branch 'security-mr-head-pipeline-leak' into 'master'
[master] Fix MR head pipeline leak

See merge request gitlab/gitlabhq!3148
2019-07-02 06:23:28 +00:00
Marin Jankovski f66169b35c Merge branch 'security-59581-related-merge-requests-count' into 'master'
Expose merge requests count based on user access

See merge request gitlab/gitlabhq!3157
2019-07-02 06:19:58 +00:00
charlieablett 426f1c20b1 Remove N+1 query for project and group boards
- Add test for N+1 queries
- Add destroyable lists scope to Board and List
- Preload lists for both project and group boards
2019-06-26 11:47:18 +12:00
Oswaldo Ferreira 3af348b6cf Automatically update MR merge-ref along merge status
This couples the code that transitions the `MergeRequest#merge_status`
and refs/merge-requests/:iid/merge ref update.

In general, instead of directly telling `MergeToRefService` to update
the merge ref, we should rely on `MergeabilityCheckService` to keep
both the merge status and merge ref synced. Now, if the merge_status is
`can_be_merged` it means the merge-ref is also updated to the latest.

We've also updated the logic to be more systematic and less user-based.
2019-06-20 11:48:30 -03:00
Alexandru Croitor 09163e423a Expose merge requests count based on user access
Count issues related merge requests based on user access level. And
issue can have related MRs from projects where user does not have
access so the number of related merge requests should be adjusted
based on user's ability to access the related MRs.

https://gitlab.com/gitlab-org/gitlab-ce/issues/59581
2019-06-18 12:46:46 +03:00
Zsolt Kovari 0a6a0a5280 56737 Expose currently supported events properly on services API 2019-06-16 17:57:38 +02:00
Kamil Trzciński 991976642f Merge branch 'expose-project-git-depth-via-api' into 'master'
Expose default_git_depth via project API

Closes #62908

See merge request gitlab-org/gitlab-ce!29353
2019-06-12 11:02:36 +00:00
Fabio Pitino 3ac527b488 Expose ci_default_git_depth via project API
Enable Get and Update of ci_default_git_depth for
Project API.

Renaming Project#default_git_depth to :ci_default_git_depth
to give more context through the API usage.

Add API documentation
2019-06-12 09:51:45 +01:00
Oswaldo Ferreira 00a273d3a9 Revert "Automatically update MR merge-ref along merge status" 2019-06-11 13:08:25 -03:00
Matija Čupić 5f0687d07a
Gate MR head_pipeline behind read_pipeline ability 2019-06-08 18:13:31 +02:00
Patrick Derichs b70d23c25a Add task count and completed count to responses of Issue and MR
Add spec for task_completion_status

Add test cases for task_completion_status result

Extracted shared samples

Add new spec file for task completion status response

Fix style errors

Add changelog entry

Changed samples to Hashes

Remove test for successful request

Remove not nil expectation

Add task_completion_status to api documentation for issues

Add task_completion_status to api documentation for merge_requests

Refactor spec so it just requests one specific item

Add task_completion_status to Taskable

Simplified task completion status in entities

Refactor spec so it separates status code check and content check

Fix spec description text and field name
2019-06-07 11:15:55 +02:00
Oswaldo Ferreira b965009ddd Automatically update MR merge-ref along merge status
This couples the code that transitions the `MergeRequest#merge_status`
and refs/merge-requests/:iid/merge ref update.

In general, instead of directly telling `MergeToRefService` to update
the merge ref, we should rely on `MergeabilityCheckService` to keep
both the merge status and merge ref synced. Now, if the merge_status is
`can_be_merged` it means the merge-ref is also updated to the latest.

We've also updated the logic to be more systematic and less user-based.
2019-05-31 19:16:01 -03:00
Peter Marko 40490cc492 Add wiki size to project statistics 2019-05-29 16:08:25 +02:00
Denys Mishunov 0d7afb9561 Updated heading for default state in Web IDE
Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/60107
2019-05-29 12:13:27 +00:00
Mathieu Parent 00c851384e API: Allow to get and set "masked" attribute for variables 2019-05-22 07:25:26 +02:00
Fabio Pitino cef8d1d408 Add allow_failure attribute to Job API
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50813
2019-05-21 09:21:53 +00:00
Alexandru Croitor 9ff6edf690 Review updates and cleanup
* 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
2019-05-17 13:56:25 +03:00
Alexandru Croitor a4fbf39eca Move issue details to from IssueBasic to Issue entity
Cleanup IssueBasic entity to keep it basic and move extra attributes
to Issue entity which contains more details
2019-05-15 10:15:17 +03:00
Alexandru Croitor 5ec28dc387 Changes to issues api
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
2019-05-15 10:15:16 +03:00
Heinrich Lee Yu eb88ca7646 Rename methods that conflict in Rails 5.2
Adds suffix to enum methods and changes `in_groups` to
`of_groups`
2019-05-12 23:42:06 -05:00
Krasimir Angelov 85609c117e Implement support for CI variables of type file
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.
2019-05-06 13:11:42 +00:00
Krasimir Angelov 241ba4be79 Allow guests users to access project releases
This is step one of resolving
https://gitlab.com/gitlab-org/gitlab-ce/issues/56838.

Here is what changed:
- Revert the security fix from bdee9e8412.
- 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.
2019-05-03 13:29:20 +00:00
Mayra Cabrera 1dd4a00780 Adds namespace information to project endpoint
- 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
2019-04-18 19:00:48 -05:00
Imre Farkas 9bc5ed14fe Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-09 15:38:58 +00:00
Nick Thomas a6218f1bcd Merge branch 'osw-multi-assignees-merge-requests' into 'master'
[Backport] Support multiple assignees for merge requests

See merge request gitlab-org/gitlab-ce!27089
2019-04-09 15:19:36 +00:00
Krasimir Angelov 724f19ba0a Add new API endpoint to expose single environment
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.
2019-04-09 09:16:57 +00:00
Oswaldo Ferreira ca884980ee [CE] Support multiple assignees for merge requests
Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161
(code out of ee/ folder).
2019-04-08 18:40:00 -03:00
Andreas Brandl 46b1b9c1d6 Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request !26823
2019-04-05 13:02:56 +00:00
Imre Farkas d9d7237d2e Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-05 11:45:47 +00:00
Alexandru Croitor f4adb50ef2 Expose head pipeline in the related merge requests
Expose head pipeline for the MR in the api when requesting
related merge requests for an issue and show a detailed
status for the pipeline, which would include:
details_path, favicon, group, icon, label, text, tooltip.

https://gitlab.com/gitlab-org/gitlab-ce/issues/57662#note_152023412
2019-04-04 09:01:09 +00:00
Francisco Javier López 6ee1d8cf77 Add port section to CI Image object
In order to implement https://gitlab.com/gitlab-org/gitlab-ee/issues/10179
we need several modifications on the CI config file. We are
adding a new ports section in the default Image object.

Each of these ports will accept: number, protocol and name.

By default this new configuration will be only enabled in
the Web IDE config file.
2019-04-03 09:50:54 +00:00
Mayra Cabrera b5e09a26de Include cluster domain into Project Cluster API
Domain was introduced on 11.8 and was not included on the
Project Cluster API. With this change user will be able to include
domain when adding and updating a cluster. Domain will also be included
on the GET calls.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59441
2019-04-01 16:29:05 +00:00
Oswaldo Ferreira 03e0604d5d Prepare suggestion implementation for multi-line
Adds the groundwork needed in order to persist multi-line suggestions,
while providing the parsing strategy which will be reused for the
**Preview** as well.
2019-03-27 12:26:53 -03:00
Peter Marko 12adb2a4bc Show statistics also when repository is disabled 2019-03-23 12:06:50 +01:00
Thiago Presa 538741f230 Add highest_role method to User 2019-03-22 09:54:03 +00: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
Yorick Peterse 59db98a0ca
Merge dev master into GitLab.com master 2019-03-04 19:44:46 +01: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
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
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