Commit Graph

3236 Commits

Author SHA1 Message Date
Rémy Coutable 8028a59d7a Merge branch '51913-api-getting-projects-for-users-with-dot-gets-404' into 'master'
API: Support username with dots

Closes #51913

See merge request gitlab-org/gitlab-ce!24395
2019-02-01 14:35:46 +00:00
Kamil Trzciński d4c7214799
[master] Pipelines section is available to unauthorized users 2019-01-31 16:52:50 +01:00
Grzegorz Bizon 7327fb4aa7
Present all pipeline triggers using trigger presenter 2019-01-31 16:51:17 +01:00
Grzegorz Bizon 084b7edb17
Do not expose trigger token when user should not see it 2019-01-31 16:51:17 +01:00
Robert Schilling a612bd0708 Unify user requirements for API slugs 2019-01-31 11:13:23 +01:00
Grzegorz Bizon dc6091876d Merge branch 'container-repository-cleanup-api' into 'master'
Container repository cleanup API

Closes #55978

See merge request gitlab-org/gitlab-ce!24303
2019-01-25 13:24:35 +00:00
Kamil Trzciński 045d07bab3 Add Container Registry API
This includes a set of APIs to manipulate container registry.
This includes also an ability to delete tags based on requested
criteria, like keep-last-n, matching-name, older-than.
2019-01-25 13:13:48 +01:00
Lin Jen-Shin 61c51d3b6e Merge branch '56392-enable-the-layout-extraspacing-cop' into 'master'
Enable the Layout/ExtraSpacing cop

Closes #56392

See merge request gitlab-org/gitlab-ce!24423
2019-01-24 15:09:52 +00:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
Steve Azzopardi cb67423d48
Get remote address for runner
Check if `X-Forwarded-For` is set before getting the IP of the request,
with this the real IP address of the runner is shown if it's behind a
proxy.

closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53676
2019-01-24 09:03:14 +01:00
Nick Thomas f40e769211 Merge branch '52674-api-v4-projects-project_id-jobs-endpoint-hits-statement-timeout' into 'master'
[API] Omit `X-Total` and `X-Total-Pages` headers when items count is more than 10,000

Closes #42194 and #52674

See merge request gitlab-org/gitlab-ce!23931
2019-01-23 19:27:09 +00:00
Filipa Lacerda 3ed8078507 Merge branch '25569-changing-wording-to-delete-when-referring-to-removing-a-branch' into 'master'
Resolve "Changing wording to "Delete" when referring to removing a branch"

Closes #25569

See merge request gitlab-org/gitlab-ce!23966
2019-01-23 11:02:22 +00:00
Sam Bigelow c607b35824 Use 'delete' instead of 'remove' for source branch
This is to match `git branch -D <branchname>`
2019-01-22 12:57:01 -05:00
Rémy Coutable 26978cb270
[API] Omit X-Total{,-Pages} when count > 10k
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-22 18:13:04 +01:00
Douwe Maan 10d421be3f Merge branch 'sh-preload-associations-for-group-api' into 'master'
Eliminate N+1 queries in /api/groups/:id

Closes #49845

See merge request gitlab-org/gitlab-ce!24513
2019-01-21 11:25:26 +00:00
Robert Schilling 9519890700 Search project tags via API 2019-01-21 10:01:00 +00:00
Stan Hu f9e217872d Eliminate N+1 queries in /api/groups/:id
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15475/diffs, a
significant amount of work went into eliminating N+1 queries in the
/api/groups/:id/projects endpoint. We can reuse the
`Entities::Project.prepare_relation` call on the projects.

In a group with 2,573 projects on GitLab.com, this change significantly
improves performance:

* 18019 SQL queries down to 21
* Time spent in DB: 70 s down to 384 ms

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/49845
2019-01-19 22:17:29 -08:00
Nick Thomas 41ae26d9ea Merge branch 'api-nested-group-permission' into 'master'
Return the maximum group access level in the projects API

Closes #43684

See merge request gitlab-org/gitlab-ce!24403
2019-01-18 15:36:58 +00:00
Ben 1e2bd85333 API for importing external repos 2019-01-17 10:37:08 +00:00
Alejandro Rodríguez ab94a5a537 Return max group access level in the projects API
Currently if a project is inside a nested group and a user doesn't have
specific permissions for that group but does have permissions on a
parent group the `GET /projects/:id` API call will return the following
permissions:

```json
permissions: { project_access: null, group_access: null }
```

It could also happen that the group specific permissions are of lower
level than the ones the user has in parent groups. This patch makes it
so that the permission returned for `group_access` is the highest from
amongst the hierarchy, which is (ostensibly) the information that the
API user is interested in for that field.
2019-01-16 14:54:05 -03:00
Nick Thomas e9a4f2ddd0 Merge branch 'shared_with_group_path' into 'master'
Add group ful path to project's shared_with_groups

See merge request gitlab-org/gitlab-ce!24052
2019-01-16 11:49:05 +00:00
Kamil Trzciński 28ca155be9 Merge branch 'zj-feature-gate-set-project-path' into 'master'
Allow setting of feature gates per project

See merge request gitlab-org/gitlab-ce!24184
2019-01-16 09:51:21 +00:00
Mathieu Parent 542e26fec0 Add group full path to project's shared_with_groups 2019-01-15 21:09:05 +01:00
Robert Schilling 7be192803c API: Fix default branch protection setting for Admin API 2019-01-15 19:05:39 +00:00
Robert Schilling 2190704c61 API: Support username with dots 2019-01-15 17:16:03 +01:00
Robert Schilling 96a49c79aa API: Support dots in wiki slugs 2019-01-15 09:02:00 +01:00
Zeger-Jan van de Weg 5396594a83
Allow setting of feature gates per project
For features the feature gates are sometimes projects, not groups or
users. For example for git object pools:
https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5872

This commit allows for setting feature group gates based on projects, by its
path as that seems most convenient.
2019-01-14 14:29:51 +01:00
Kamil Trzciński b98f6e53f6 Merge branch '56110-cluster-kubernetes-api-500-error-on-post-request' into 'master'
Improves restriction of multiple Kubernetes clusters via API

Closes #56110

See merge request gitlab-org/gitlab-ce!24251
2019-01-11 10:46:41 +00:00
Shinya Maeda 9b823af4fd Remove releases_page feature flag
We introduced releases_page feature flag.
Given this feature is deemed stable, we should remove
this flag before 19th.
2019-01-11 13:26:09 +09:00
Mayra Cabrera 8b2fe985dd Restrict multiple clusters through API
Modifies authorize! method to accept a third param, and then use it in
combination with 'add_cluster' policy to appropriately restrict adding
multiple clusters

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56110
2019-01-10 18:20:04 -06:00
Francisco Javier López 40887a94bd Fix files/blob api endpoint content disposition 2019-01-10 12:30:19 +00:00
Grzegorz Bizon f7efb2e090 Merge branch 'refactor-artifact-api-endpoint' into 'master'
Refactor artifact api endpoint

Closes #55445

See merge request gitlab-org/gitlab-ce!23582
2019-01-09 08:21:07 +00:00
Robert Speicher 0986039896 Merge branch 'sh-switch-rack-request-to-actionpack' into 'master'
Switch use of Rack::Request to ActionDispatch::Request

See merge request gitlab-org/gitlab-ce!24199
2019-01-09 02:01:39 +00:00
Douwe Maan cfa7108210 Merge branch '49231-import-issues-csv' into 'master'
Import issues from CSV

Closes #49231

See merge request gitlab-org/gitlab-ce!23532
2019-01-07 23:15:53 +00:00
Steve Azzopardi 7ac32ae282
Refactor project.latest_successful_builds_for def
`project.latest_successful_builds_for(ref)` is being used to find a
single job all the time. This results into us having to call `find_by`
inside of the controller which violates our CodeReuse/ActiveRecord
rubocop rule.

Refactor `project.latest_successful_builds_for(ref)` to
`project.latest_successful_build_for(job_name, ref)` which will execute
the `find_by` inside of the model.

Also create `project.latest_successful_build_for!(job_name, ref)` which
raises an exception instead of returning nil.
2019-01-07 17:29:26 +01:00
Grzegorz Bizon 604073ffc3 Merge branch 'include-project' into 'master'
Allow to include another project files

Closes #53903

See merge request gitlab-org/gitlab-ce!24101
2019-01-07 09:19:36 +00:00
Kamil Trzciński c4d615c9dc Allow to include files from another projects
This adds `project:, file:, ref:` specification support.
2019-01-07 09:38:05 +01:00
Stan Hu aff2b6e4eb Switch use of Rack::Request to ActionDispatch::Request
As mentioned in
https://gitlab.com/gitlab-org/gitlab-ee/issues/9035#note_129093444,
Rails 5 switched ActionDispatch::Request so that it no longer inherits
Rack::Request directly. A middleware that uses Rack::Request to
read the environment may see stale request parameters if
another middleware modifies the environment via ActionDispatch::Request.
To be safe, we should be using ActionDispatch::Request everywhere.
2019-01-07 00:35:53 -08:00
Shinya Maeda 6bd7e1b876 Add tests for Release Link API
Add tests for the API and add a couple of tests

Add

revert

revert
2019-01-07 14:07:05 +09:00
Shinya Maeda 124905e23b Add API for release asset links
Authorize against release not project
2019-01-07 14:07:05 +09:00
Heinrich Lee Yu 63e9969ca3 Refactor upload service to return uploader
Also changes old calls to the service
2019-01-07 11:16:58 +08:00
Kamil Trzciński 647271c9fc Merge branch '40473-api-support-for-kubernetes-integration' into 'master'
Add API Support for Kubernetes integration

Closes #40473

See merge request gitlab-org/gitlab-ce!23922
2019-01-05 14:44:37 +00:00
Mayra Cabrera 013d262266 Include CRUD endpoints for Cluster API
Adds the following initial CRUD endpoints for Clusters API:

- GET list of clusters
- GET specific cluster
- POST add existing cluster (mimic of "Add cluster")
- PUT update cluser
- DELETE destroy cluster

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40473
2019-01-04 15:12:44 -06:00
Douwe Maan 303f049358 Merge branch 'feature/gb/expose-ci-api-url-variable' into 'master'
Expose `CI_API_V4_URL` CI/CD variable

Closes #54621

See merge request gitlab-org/gitlab-ce!23936
2019-01-04 17:29:01 +00:00
Grzegorz Bizon 8707827d39 Improve readablity of CI_API_V4_URL related code 2019-01-04 15:32:40 +01:00
Shinya Maeda df7ed9eef2 Add unique constraint to release and url
Fix coding style

Improve coding style

Decouple UPDATE and DELETE operations of asset links

Rename links_attributes to assets:links

Rename exposed param and updated spec
2019-01-04 22:17:03 +09:00
Shinya Maeda 66755c9ed5 Support CURD operation for release asset links
- Add Releases::Links model
- Expose it in release API
- Add integration tests
2019-01-04 22:17:02 +09:00
Grzegorz Bizon 476cba6ff3 Minor improvements to CI_API_V4_URL variable exposure 2019-01-03 14:18:05 +01:00
Grzegorz Bizon f10fe3ae97 Add API::Helpers::Version and expose API root URL
This commits adds a new class that is supposed to represent Grape API
version, like `v3` or `v4`.
2019-01-03 14:18:05 +01:00
Grzegorz Bizon 128a5e410f Expose method that returns GitLab API paths 2019-01-03 14:18:05 +01:00