Commit Graph

343 Commits

Author SHA1 Message Date
Andre Guedes 41d70ea300 Added Issue Board API support
- Includes documentation and tests
2016-10-05 13:12:07 -03:00
DJ Mountney 59157c0423 Expose the Koding application settings in the API
This will allow the Koding app to enable the integration itself once is has authorized an admin user using the application secrets.
2016-09-29 09:12:52 -07:00
Rémy Coutable f6a1a21f6f Merge branch 'issue_22382' into 'master'
Expose project share expiration_date field on API

closes #22382

See merge request !6484
2016-09-29 13:04:16 +00:00
Guilherme Salazar e80e4cb8b9 expose pipeline data in builds API
add pipeline ref, sha, and status to the build API response

add tests of build API (pipeline data)

change API documentation for builds API

log change to builds API in CHANGELOG

CHANGELOG: add reference to pull request and contributor's name
2016-09-28 23:58:16 -03:00
Felipe Artur 93d849beae Expose project share expiration_date field on API 2016-09-28 10:12:49 -03:00
Dmitriy Zaporozhets d0b556eb1b Add User#organization to users api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-09-27 14:04:39 +03:00
Robert Speicher 791079e2ab Merge branch '22065-group-members-api-returning-null-user-details' into 'master'
Ensure invitees are not returned in Members API

## What are the relevant issue numbers?

Closes #22065

See merge request !6370
2016-09-20 05:20:47 +00:00
Felipe Artur e0067d1850 Allow to set request_access_enabled for groups and projects using API 2016-09-19 12:13:57 -03:00
Rémy Coutable d8dd1c1940 Ensure invitees are not returned in Members API
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-16 17:18:26 +02:00
Patricio Cano 02ddb9dff4 Syntax fixes and better tests for helper methods. Updated docs. 2016-09-15 14:10:49 -05:00
Patricio Cano fd62142950 Added group-specific setting for LFS.
Groups can enable/disable LFS, but this setting can be overridden at the project level. Admin only
2016-09-15 12:27:32 -05:00
Marc Siegfriedt 48333b9da3 Add notification_settings API calls
Use NotificationSetting::EMAIL_EVENTS for params
2016-09-09 17:08:06 +00:00
Douwe Maan d308a3f433 Merge branch 'issue_19734' into 'master'
Project tools visibility level

## part of #19734   

![project_features_access_level](/uploads/81ec7185d4e61d7578652020209af925/project_features_access_level.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5606
2016-09-01 15:28:14 +00:00
Douwe Maan ae439a62cc Merge branch 'merge-request-sha-info' into 'master'
Merge request sha info

## What does this MR do?

Exposes `sha` and `merge_commit_sha` items in `MergeRequest` API endpoint data.

## Are there points in the code the reviewer needs to double check?

No.

## Why was this MR needed?

It's useful information.

## What are the relevant issue numbers?

Closes #20456.

## Screenshots (if relevant)

N/A

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5966
2016-09-01 14:49:36 +00:00
Felipe Artur 892dea6771 Project tools visibility level 2016-09-01 11:47:59 -03:00
Robert Speicher 6a58af3a4a Add BroadcastMessage API implementation 2016-08-31 17:03:18 -03:00
Ben Boeckel 9c3db830c0 entities: expose {,merge_commit_}sha in MergeRequest
Fixes #20456.
2016-08-31 10:50:54 -04:00
Robert Schilling 036cc8c27e API: Expose issue#confidential 2016-08-31 09:20:04 +02:00
Patricio Cano cf37d623e1 Renamed `enable_lfs` to `lfs_enabled` for the Project field, and related fixes. 2016-08-30 17:17:45 -05:00
Patricio Cano 0227e98d0d Added CHANGELOG, documentation, and API functionality 2016-08-30 16:17:41 -05:00
Douwe Maan bbd9a6fe40 Merge branch 'dz-merge-request-version' 2016-08-25 12:59:21 -05:00
Douwe Maan 952c501fdf Merge branch 'api_only_allow_merge_if_build_succeeds' into 'master'
expose 'only_allow_merge_if_build_succeeds' project setting in the API

## What does this MR do?
Adds the 'only_allow_merge_if_build_succeeds' project setting in the API.

## Are there points in the code the reviewer needs to double check?
No, but maybe this code is not enough for ACLs or the like.

## Why was this MR needed?
Because that's a very useful setting to change via automation (through the API)

## What are the relevant issue numbers?

Closes #21085, closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20088.

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [X] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [X] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [X] API support added
- Tests
  - [X] Added for this feature/bug
  - [X] All builds are passing
- [X] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [X] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5930
2016-08-24 19:27:58 +00:00
Douwe Maan 90441e85dd Merge branch 'entity-api-web-url' into 'master'
api: expose web_url for project entities

## What does this MR do?

Adds a `web_url` field to project snippet, issues, and merge request API returned objects.

## Are there points in the code the reviewer needs to double check?

Tests. Are they sufficient? (I'm working on getting them to pass.)

## Why was this MR needed?

Creating the URL for an MR or issue from the MR is tedious in API libraries; it's easy for Gitlab to just provide it.

## What are the relevant issue numbers?

N/A

## Screenshots (if relevant)

N/A

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5631
2016-08-24 19:26:04 +00:00
Ben Boeckel 99c2f3b3c5 api: expose wiki_page_events project hook field in the API 2016-08-24 10:33:51 -04:00
Ben Boeckel e43c4060b6 api: expose web_url for project entities
This allows web hooks to have a URL back to entities without having to
generate it themselves.
2016-08-24 10:32:31 -04:00
Marc Dequènes (Duck) 31b2c1ef88 expose 'only_allow_merge_if_build_succeeds' project setting in the API 2016-08-24 17:11:48 +09:00
Ben Boeckel 542be288d6 entities: make Environment inherit EnvironmentBasic 2016-08-23 10:25:17 -04:00
Dmitriy Zaporozhets dde44b83dd
Fix merge request diff api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-22 15:30:23 +03:00
Dmitriy Zaporozhets 9329436deb
Merge branch 'master' into dz-merge-request-version
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-22 11:34:41 +03:00
Dmitriy Zaporozhets 6db65143db
Merge branch 'master' into dz-merge-request-version
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-19 13:01:58 +03:00
Sean McGivern aba9cc6f22 Merge branch 'master' into expiration-date-on-memberships 2016-08-18 22:50:28 +01:00
Sean McGivern 396f85e438 Add expiration date to group memberships 2016-08-18 21:09:17 +01:00
Z.J. van de Weg 2038e035c7 Do not expose projects on deployments 2016-08-18 21:10:53 +02:00
Z.J. van de Weg 39c71a19c4 Expose project for environments 2016-08-18 21:10:52 +02:00
Z.J. van de Weg 47d6f286eb Add deployment endpoints 2016-08-18 21:10:52 +02:00
Z.J. van de Weg df5661b6f4 Add docs on API for pipelines, plus minor fixes 2016-08-18 16:56:39 +02:00
Z.J. van de Weg de7b8e51b8 Add endpoints for pipelines 2016-08-18 16:56:39 +02:00
Sean McGivern 8b1656282b Merge branch 'master' into expiration-date-on-memberships 2016-08-18 15:54:07 +01:00
Kamil Trzcinski 45953a4c59 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into pipeline-hooks-without-slack 2016-08-16 21:17:15 +01:00
Timothy Andrew 4ddbbcd11a Improve EE compatibility with protected branch access levels.
1. Change a few incorrect `access_level` to `access_levels.first` that
   were missed in e805a64.

2. `API::Entities` can iterate over all access levels instead of just
   the first one. This makes no difference to CE, and makes it more compatible
   with EE.
2016-08-16 12:08:10 +05:30
Timothy Andrew e805a64700 Backport changes from gitlab-org/gitlab-ee!581 to CE.
!581 has a lot of changes that would cause merge conflicts if not
properly backported to CE. This commit/MR serves as a better
foundation for gitlab-org/gitlab-ee!581.

= Changes =

1. Move from `has_one {merge,push}_access_level` to `has_many`, with the
   `length` of the association limited to `1`. This is _effectively_ a
   `has_one` association, but should cause less conflicts with EE, which
   is set to `has_many`. This has a number of related changes in the
   views, specs, and factories.

2. Make `gon` variable loading more consistent (with EE!581) in the
   `ProtectedBranchesController`. Also use `::` to prefix the
   `ProtectedBranches` services, because this is required in EE.

3. Extract a `ProtectedBranchAccess` concern from the two access level
   models. This concern only has a single `humanize` method here, but
   will have more methods in EE.

4. Add `form_errors` to the protected branches creation form. This is
   not strictly required for EE compatibility, but was an oversight
   nonetheless.
2016-08-16 11:05:14 +05:30
Dmitriy Zaporozhets 5e95c0b8d2
Merge branch 'master' into dz-merge-request-version
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-15 17:27:22 +03:00
Dmitriy Zaporozhets ac072132b8
Add single merge request diff API endpoint
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-12 14:44:49 +03:00
Kamil Trzcinski 0b0a53ee5e Merge remote-tracking branch 'origin/master' into pipeline-hooks-without-slack
# Conflicts:
#	app/models/ci/pipeline.rb
#	app/services/ci/create_pipeline_service.rb
#	spec/models/project_services/hipchat_service_spec.rb
2016-08-11 17:10:28 +02:00
Lin Jen-Shin 0b52517049 Merge remote-tracking branch 'upstream/master' into pipeline-hooks-without-slack
* upstream/master: (233 commits)
  Fix awardable button mutuality loading spinners
  Update CHANGELOG for 8.10.5
  Clean up project destruction
  Small refactor of doc/development/README.md
  Avoid commit lookup on diff_helper
  Removed extra newline from redis_spec.rb
  Used cached value of project count to reduce DB load
  Remove duplicate link_to statements
  Mention add_column_with_default in downtime guide
  Add missing space to generic badge template
  Rename `run` task helper method to prevent conflict with StateMachine
  Add a method in Project to return a cached value of total count of projects
  spellcheck
  Add svg guidelines to ui guide
  Add Changelog entry for Grape upgrade [ci skip]
  Fix Grape tests.
  Retain old behavior
  Update Grape from 0.13.0 to 0.15.0.
  adds second batch of tests changed to active tense
  fixes part1 of files to start using active tense
  ...
2016-08-11 13:35:35 +08:00
Rémy Coutable 5010be7766 Improve the performance of the GET /:sources/:id/{access_requests,members} API endpoints
The performance was greatly improved by removing two N+1 queries issues
for each endpoint.

For comparison:

1. `GET /projects/:id/members`

With two N+1 queries issues (one was already fxed in the following
snippet):

```
  ProjectMember Load (0.2ms)  SELECT "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
NULL  ORDER BY "members"."id" DESC  [["source_type", "Project"],
["source_id", 1], ["source_type", "Project"]]
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN
(5, 22, 16, 13)  ORDER BY "users"."id" DESC
  ActiveRecord::SchemaMigration Load (0.2ms)  SELECT
"schema_migrations".* FROM "schema_migrations"
  ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
[["source_type", "Project"], ["source_id", 1], ["source_type",
"Project"], ["user_id", 5]]
  ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
[["source_type", "Project"], ["source_id", 1], ["source_type",
"Project"], ["user_id", 22]]
  ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
[["source_type", "Project"], ["source_id", 1], ["source_type",
"Project"], ["user_id", 16]]
  ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
[["source_type", "Project"], ["source_id", 1], ["source_type",
"Project"], ["user_id", 13]]
```

Without the N+1 queries issues:

```
  ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
NULL  ORDER BY "members"."id" DESC LIMIT 20 OFFSET 0  [["source_type",
"Project"], ["source_id", 1], ["source_type", "Project"]]
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN
(5, 22, 16, 13)  ORDER BY "users"."id" DESC
```

2. `GET /projects/:id/access_requests`

With two N+1 queries issues:

```
  ProjectMember Load (0.3ms)  SELECT "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
NOT NULL)  ORDER BY "members"."id" DESC  [["source_type", "Project"],
["source_id", 8], ["source_type", "Project"]]
  User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" =
$1  ORDER BY "users"."id" DESC LIMIT 1  [["id", 24]]
  User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" =
$1  ORDER BY "users"."id" DESC LIMIT 1  [["id", 23]]
  ActiveRecord::SchemaMigration Load (0.2ms)  SELECT
"schema_migrations".* FROM "schema_migrations"
  ProjectMember Load (0.1ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
NOT NULL) AND "members"."user_id" = $4  ORDER BY "members"."id" DESC
LIMIT 1  [["source_type", "Project"], ["source_id", 8], ["source_type",
"Project"], ["user_id", 24]]
  ProjectMember Load (0.2ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
NOT NULL) AND "members"."user_id" = $4  ORDER BY "members"."id" DESC
LIMIT 1  [["source_type", "Project"], ["source_id", 8], ["source_type",
"Project"], ["user_id", 23]]
```

Without the N+1 queries issues:

```
  ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
"members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
"members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
NOT NULL)  ORDER BY "members"."id" DESC LIMIT 20 OFFSET 0
[["source_type", "Project"], ["source_id", 8], ["source_type",
"Project"]]
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN
(24, 23)  ORDER BY "users"."id" DESC
```

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-10 19:07:05 +02:00
Rémy Coutable 29850364ec New AccessRequests API endpoints for Group & Project
Also, mutualize AccessRequests and Members endpoints for Group &
Project.
New API documentation for the AccessRequests endpoints.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-10 19:07:05 +02:00
Adam Niedzielski 6d89224458 Add API support for expires_at. 2016-08-06 21:06:30 +02:00
Dmitriy Zaporozhets 9a5f40878c
Add API to list merge request diff versions
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-03 11:32:29 +03:00
Paco Guzman c86c1905b5 switch from diff_file_collection to diffs
So we have raw_diffs too
2016-08-03 07:00:20 +02:00