Commit Graph

422 Commits

Author SHA1 Message Date
Bob Van Landuyt 11a9fbe65b Make the API project params reusable 2018-04-04 19:49:48 +02:00
Jan f6d58310fc Resolve "Allow the configuration of a project's merge method via the API" 2018-04-04 09:56:38 +00:00
Jan 54baf3a362 Resolve "Forking with namespace doesn't work (API)" 2018-03-26 09:22:03 +00:00
Kárpáti László 8bdfd8aa87 Resolve "API: PUT /projects/:id fails when only ci_config_path is specified" 2018-02-21 15:57:26 +00:00
Markus Koller b7cd99c376
Allow including custom attributes in API responses 2018-02-08 13:30:34 +01:00
Yorick Peterse cca61980d5
Track and act upon the number of executed queries
This ensures that we have more visibility in the number of SQL queries
that are executed in web requests. The current threshold is hardcoded to
100 as we will rarely (maybe once or twice) change it.

In production and development we use Sentry if enabled, in the test
environment we raise an error. This feature is also only enabled in
production/staging when running on GitLab.com as it's not very useful to
other users.
2018-02-01 17:00:46 +01:00
Jan Christophersen 795e546b1c Resolve "Projects API: filter 'with_issues_enabled=true' returns projects with 'issues_enabled=false'" 2018-01-19 07:33:58 +00:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Francisco Javier López c9871e84e4 The API isn't using the appropriate services for managing forks 2017-12-07 08:44:55 +00:00
Francisco Lopez 966f83f965 Undoing debugging change 2017-12-01 18:32:12 +01:00
Francisco Lopez 194f7bca9a Comments from code review applied. Also switched forked_from_project and ForkedProjectLinks to ForkNetworkMember 2017-12-01 18:32:12 +01:00
Francisco Lopez 58c5b463ff Refactored /projects and /user/:user_id/projects endpoints 2017-12-01 18:32:12 +01:00
Markus Koller 6902848a9c
Support custom attributes on projects 2017-11-06 10:51:46 +01:00
Mark Fletcher 63e0a42317 Add an API endpoint to determine the forks of a project 2017-09-20 08:27:16 +10:00
Ashley Dumaine a3f76b76a4 change collapse to resolve and comments to discussions 2017-09-06 10:07:47 +01:00
Ashley Dumaine ef4b3a39bc Add functionality to collapse outdated diff comments regardless of discussion resolution 2017-09-06 10:07:46 +01:00
Robert Schilling 6a2ee0968e API: Use defined project requirements 2017-08-31 14:57:47 +02:00
Robert Schilling ee4820a526 Add a spec when ressource is not modified 2017-08-29 10:12:10 +02:00
Robert Schilling dcd4ea473c Update remaining endpoints 2017-08-28 17:10:30 +02:00
Robert Schilling e80313f9ee Conditionally destroy a ressource 2017-08-28 16:40:25 +02:00
Robert Schilling 998afa5f74 API: Respect the 'If-Unmodified-Since' for delete endpoints 2017-08-28 16:40:25 +02:00
Yorick Peterse aef9f1eb94
Cache the number of forks of a project
The number of forks of a project doesn't change very frequently and
running a COUNT(*) every time this information is requested can be quite
expensive. We also end up running such a COUNT(*) query at least twice
on the homepage of a project.

By caching this data and refreshing it when necessary we can reduce
project homepage loading times by around 60 milliseconds (based on the
timings of https://gitlab.com/gitlab-org/gitlab-ce).
2017-08-14 18:00:28 +02:00
Dmitriy Zaporozhets 6b8ad689da
Update grape gem
New version of the gem returns 200 status code on delete with content
instead of 204 so we explicitly set status code to keep existing
behavior

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-07-20 16:33:18 +03:00
Rémy Coutable 033acc0120
Fix some N+1 queries in the GET /projects API
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-07 02:38:18 +02:00
Rémy Coutable 050eae8c4d Merge branch '33657-user-projects-api' into 'master'
Add user projects API

Closes #33657

See merge request !12596
2017-07-06 09:18:06 +00:00
vanadium23 8d44d5142a Add user projects API 2017-07-06 08:04:54 +03:00
Lin Jen-Shin 9f5ac179d1 Rename ci_config_file to ci_config_path 2017-07-05 20:11:01 +08:00
Lin Jen-Shin d7c32c5870 Fix various descriptions given the feedback 2017-07-04 02:00:50 +08:00
Lin Jen-Shin 62fdbbeeb0 Merge remote-tracking branch 'upstream/master' into 32815--Add-Custom-CI-Config-Path
* upstream/master: (123 commits)
  Backport changes to Projects::IssuesController and the search bar
  bugfix: use `require_dependency` to bring in DeclarativePolicy
  Resolve "Select branch dropdown is too close to branch name"
  Clean up issuable lists
  Defer project destroys within a namespace in Groups::DestroyService#async_execute
  Fixed new navgiation bar logo height in Safari
  Resolve "Issue dropdown persists when adding issue number to issue description"
  Move verification to block level instead of paragraph
  Revert "Merge branch 'dm-drop-default-scope-on-sortable-finders' into 'master'"
  Added code for defining SHA attributes
  Minor edits
  Job details won't scroll horizontally to show long lines
  Run mysql tests on stable preperation branches like 9-3-stable-patch-2
  Bring back branches badge to main project page
  optimize translation content based on comments
  supplement traditional chinese in taiwan translation
  Inserts exact matches of username, email and name to the top of the user search list
  Remove Namespace model default scope override and write additional test to Project search
  optimize translation content based on comments
  Limit OpenGraph image size to 64x64
  ...
2017-06-30 13:46:51 +08:00
http://jneen.net/ 7765dd6a1d bugfix: use `require_dependency` to bring in DeclarativePolicy 2017-06-29 11:57:59 -07:00
Lin Jen-Shin 35674fcd47 Merge remote-tracking branch 'upstream/master' into 15041-Add-Custom-CI-Config-Path
* upstream/master: (12506 commits)
  Update CHANGELOG.md for 9.3.2
  Update architecture.md
  Fix changelog entry file extension
  Fix head pipeline stored in merge request for external pipelines
  updated gitlab-ci.yml to compile locale
  Ignore JSON files generated from PO files
  Update mmap2 gem tha disables mmap_obj.gsub! as current implementation uses method that is no longer part of Ruby API
  Disable rainbow during SimpleExecutor specs to have consistence
  Slightly refactor pipeline schedules form in preparation for additions
  Resolve "Submitting reply to existing diff discussion using Cmd/Ctrl+Enter submits twice and refreshes page"
  Make the SimpleExecutor rescue exceptions in the executing Checks
  Resolve "Unable to access edit comment from dropdown menu in certain screen sizes"
  Update changelog item
  revert removal of requestAnimationFrame and move to a separate MR/discussion
  rename getEmojiCategoryMap and remove unnecessary parameter
  Action Buttons on Prio Labels working again by setting pointer events to none on…
  Remove 'contains' option from Commit.find_all
  Remove Gitlab::Git::Repository#find_all
  Use latest chrome and chrome driver in GitLab QA
  Polish sidebar toggle
  ...
2017-06-28 15:53:12 +08:00
http://jneen.net/ 59e7c39f4c use subject scope in :id/users
since we're loading all the members anyways
2017-06-27 12:44:38 -07:00
David Turner 1cd1bab3af add printing_merge_request_link_enabled to API 2017-06-19 13:33:15 -04:00
vanadium23 4ccd799832 Accept image for avatar in project API 2017-06-09 22:49:57 +03:00
Mark Fletcher ad3e180ed3 Introduce an Events API
* Meld the following disparate endpoints:
 * `/projects/:id/events`
 * `/events`
 * `/users/:id/events`
+ Add result filtering to the above endpoints:
 * action
 * target_type
 * before and after dates
2017-06-06 20:16:41 +08:00
Rémy Coutable 4cfa5ce4a9
Enable the Style/PreferredHashMethods cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 19:11:26 +02:00
Athar Hameed 578adc9bc6 Fix missing optional path parameter in "Create project for user" API 2017-06-02 20:58:48 +08:00
Douwe Maan 4ad85b22e2 Merge branch 'tc-improve-project-api-perf' into 'master'
Improve /project API performance

Closes #31855 and #31937

See merge request !11666
2017-05-31 13:45:00 +00:00
vanadium23 0684073d1e Add tag_list param to project api 2017-05-31 09:02:33 +03:00
Toon Claes db679788e4 Add :owned param to ProjectFinder
And use it in the API.
2017-05-30 22:45:59 +02:00
Toon Claes 0f0b9a8466 Use helper to construct Finder params
The ProjectsFinder and GroupFinder both support the same set of params. And the
`/api/v4/projects` and `/api/v4/group/:id/projects` also support the same set of
params. But they do not match the Finder params. So use a helper method to
transform them.
2017-05-30 22:45:59 +02:00
Toon Claes a1deed629e Use ProjectFinder to filter the projects
Instead of trying to do the heavy lifting in the API itself, use the existing
features of the ProjectFinder.
2017-05-30 22:45:59 +02:00
Toon Claes 07fc79e7c5 Handle `membership` in ProjectFinder
The ProjectFinder supports the `non_public` parameter. This can be used to find
only projects the user is member of.
2017-05-30 22:45:59 +02:00
Toon Claes 4fda13b68e Build options hash after finding the list of projects
Because this order makes more sense and makes the code easier to read.
2017-05-30 22:45:58 +02:00
Toon Claes 44fdf0a1e3 Move ProjectsFinder to `present_projects` for simplification
To avoid passing parameters double, move all filtering to the `present_projects`
helper.
2017-05-30 22:41:29 +02:00
blackst0ne a7349560b2 'New issue'/'New merge request' dropdowns should show only projects with issues/merge requests feature enabled 2017-05-30 15:35:49 +11:00
Rémy Coutable 3db37e0562 Enable the Style/TrailingCommaInArguments cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Sean McGivern ba608dc0f2 Merge branch '12910-uploader-pers-snippet' into 'master'
Prepare uploaders for personal snippets comments

See merge request !11022
2017-05-04 10:47:10 +00:00
Mark Fletcher 21f5515a5f Expose project statistics on single requests via the API
+ The statistics parameter was already accepted
* This commit ensure that it is respected for GET /projects/:id endpoint
+ Add documentation of the parameter and update the example response for stats
2017-05-03 18:45:19 +08:00
Jarka Kadlecova 43ff738641 Support uploaders for personal snippets comments 2017-05-02 15:22:24 +02:00
winniehell de2c2d9cc6 Replace builds_enabled with jobs_enabled in projects API v4 (!10786) 2017-04-20 00:29:09 +02:00
Oswaldo Ferreira fd32960e7c Separate CE params on Grape API 2017-04-10 16:13:48 -03:00
Jacopo b996a82ff4 ProjectsFinder should handle more options
Extended ProjectFinder in order to handle the following options:
 - current_user - which user use
 - project_ids_relation: int[] - project ids to use
 - params:
   -  trending: boolean
   -  non_public: boolean
   -  starred: boolean
   -  sort: string
   -  visibility_level: int
   -  tags: string[]
   -  personal: boolean
   -  search: string
   -  non_archived: boolean

GroupProjectsFinder now inherits from ProjectsFinder.
Changed the code in order to use the new available options.
2017-04-06 07:11:37 +02:00
Rémy Coutable 63360adeae
Add `requirements: { id: %r{[^/]+} }` for all projects and groups namespaced API routes
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-16 18:00:24 +01:00
Toon Claes 6357635686 Rename query parameter to `membership`
The query parameter `membership` should be more self-explaining.
2017-03-03 13:42:39 +01:00
Toon Claes a3fdd6acd2 Use string based `visibility` getter & setter
Add `visibility` & `visibility=` methods to the
`Gitlab::VisibilityLevel` module so the `visibility_level` can be
get/set with a string value.
2017-03-02 12:15:25 +01:00
Toon Claes b2c2dfe545 Expose Project's & ProjectSnippet's VisibilityLevel as String
Instead of exposing the VisibilityLevel as Integer, expose it as
String `visibility` for Project and ProjectSnippet.

Filter queries also accept the `visibility` as String instead of
`visibility_level` as Integer.

Also remove the `public` boolean.
2017-03-02 09:33:24 +01:00
James Lopez a0101ebf84 Update occurrences of MWBS to MWPS
Rename column in the database
 Rename fields related to import/export feature
 Rename API endpoints
 Rename documentation links
 Rename the rest of occurrences in the code
 Replace the images that contain the words "build succeeds" and docs referencing to them
 Make sure pipeline is green and nothing is missing.

updated doc images

renamed only_allow_merge_if_build_succeeds in projects and fixed references

more updates

fix some spec failures

fix rubocop offences

fix v3 api spec

fix MR  specs

fixed issues with partials

fix MR spec

fix alignment

add missing v3 to v4 doc

wip - refactor v3 endpoints

fix specs

fix a few typos

fix project specs

copy entities fully to V3

fix  entity error

more fixes

fix failing specs

fixed missing entities in V3 API

remove comment

updated code based on feedback

typo

fix spec
2017-03-01 12:02:02 +01:00
Sean McGivern 0226fb0e1f Merge branch '6073_project_api' into 'master'
API project create: Make name or path required

Closes #6073

See merge request !9416
2017-02-28 16:29:00 +00:00
Robert Schilling 86c58687b2 Return 204 for delete endpoints 2017-02-28 08:32:38 +01:00
Jarka Kadlecova 08ee177d6f API project create: Make name or path required 2017-02-27 07:55:45 +01:00
Oswaldo 2b001d9e7a Return 202 with JSON body on async removals on V4 API 2017-02-23 19:55:13 -03:00
Douwe Maan 99a34a52d7 Enable Style/MultilineArrayBraceLayout 2017-02-23 09:32:22 -06:00
Douwe Maan c10064aad5 Enable Style/SpaceInsideBrackets 2017-02-23 09:31:56 -06:00
Mark Fletcher d3425933dd Add housekeeping endpoint for Projects API 2017-02-22 17:40:20 +05:30
Robert Schilling 039c6d60fa API: Moved `DELETE /projects/:id/star` to `POST /projects/:id/unstar` 2017-02-20 15:14:48 +01:00
Toon Claes 4e9e29d295 API: Consolidate /projects endpoint
It consolidates these endpoints:
 - /projects
 - /projects/owned
 - /projects/visible
 - /projects/starred
 - /projects/all

Into the /projects endpoint using query parameters.
2017-02-14 16:41:57 +01:00
Oswaldo Ferreira c2102e6e3b Move /projects/fork/:id to /projects/:id/fork 2017-02-13 16:58:11 -02:00
Toon Claes c6ad83ec29 API: remove `public` param for projects
The create and edit actions for projects had these parameters:

- `public` (optional) - if true same as setting `visibility_level = 20`
- `visibility_level` (optional)

Remove the `public` parameter to avoid contradiction.
2017-02-07 14:29:31 +01:00
Oswaldo Ferreira cc24682b58 Unify projects search by removing /projects/:search endpoint 2017-01-30 11:22:15 -02:00
Robert Speicher 55b3ee7439 Merge branch 'sandish/gitlab-ce-update_ret_val' into 'master'
Ensure updating project settings shows a flash message on success

See merge request !8579
2017-01-16 18:28:23 +00:00
Rémy Coutable 7485cec94e
Add a spec and actually display the flash notice
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-16 10:57:15 -05:00
Rémy Coutable 281f3fcfd5 Merge branch 'dot-in-project-queries' into 'master'
Add a constraint on the query parameter to allow querying for projects with dots in their name.

See merge request !8210
2017-01-16 00:03:01 +00:00
Bruno Melli 322534aa94 Add a constraint on the query parameter to allow querying for projects with dots in their name. 2017-01-14 23:13:39 -07:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00
Markus Koller d5c4977912
Consistently use current_user in API entities 2016-12-21 16:36:53 +01:00
Rémy Coutable d757247247
Allow public access to some Project API endpoints
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-01 16:39:42 +01:00
Robert Schilling 7c607a55ab Grapify the projects API 2016-11-28 21:01:43 +01:00
Rémy Coutable 4f5ed81232
API: Introduce `#find_project!` which also check access permission
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 14:40:35 +01:00
Robert Schilling eff1b05ab1 API: Add endpoint to delete a group share 2016-11-23 12:53:37 +01:00
Rodolfo Santos 1db9f826c1 Add setting to only allow merge requests to be merged when all discussions are resolved
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-04 14:58:40 +01:00
Rémy Coutable 670b2eb5c0
Merge branch 'api-fix-project-group-sharing' into 'security'
API: Share projects only with groups current_user can access

Aims to address the issues here: https://gitlab.com/gitlab-org/gitlab-ce/issues/23004

* Projects can be shared with non-existent groups
* Projects can be shared with groups that the current user does not have access to read

Concerns:

The new implementation of the API endpoint allows projects to be shared with a larger range of groups than can be done via the web UI.

The form for sharing a project with a group uses the following API endpoint to index the available groups: 494269fc92/lib/api/groups.rb (L17). The groups indexed in the web form will only be those groups that the user is currently a member of.

The new implementation allows projects to be shared with any group that the authenticated user has access to view. This widens the range of groups to those that are public and internal.

See merge request !2005

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-11 20:36:26 +02:00
Keith Pope 07365e5183 Add config option to project to allow custom .gitlab-ci.yml location 2016-10-08 12:30:47 +01:00
Sean McGivern 0a1baaa80f Tidy up project list actions 2016-10-05 12:13:58 +01:00
Ben Boeckel e956a24dfd api: add /projects/visible API endpoint
FIxes #19361, #3119.
2016-10-04 17:23:18 +01:00
Felipe Artur 93d849beae Expose project share expiration_date field on API 2016-09-28 10:12:49 -03:00
Rémy Coutable 7458126111 API: Return 404 when trying to fork to unaccessible namespace
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-22 12:15:45 +02: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 3a58dd2d8f
Use Search::GlobalService.new in the `GET /projects/search/:query` endpoint
Also streamline the sorting part while we're at it.

That being done, there's currently a duplication between
`GET /projects/search/:query` and `GET /projects?search=:search`
so we might want to keep only the latter for 9.0...

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-12 10:34:03 +02:00
Razzeee 874ad681cd Search should compare only the lowercase versions of the project names 2016-09-09 15:19:18 +02:00
Olaf Tomalka 636db1515c Higher code quality for fork to namespace API 2016-09-06 23:51:08 +02:00
Olaf Tomalka 3aa40153e0 Improved code quality on API fork namespace feature 2016-09-06 10:52:42 +02:00
Olaf Tomalka bad3fb895c Added fork API paremeter for a specific namespace
Browser interface allows forking to an owned grup.
This commit brings API up to speed by providing optional namespace
parameter to fork API. This allows forking to users and groups under
forker's control using their id or unique name.

Fixes #21591
2016-09-06 04:16:14 +02:00
Felipe Artur 892dea6771 Project tools visibility level 2016-09-01 11:47:59 -03: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
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
Stan Hu 4955a47cb1 Clean up project destruction
Instead of redirecting from the project service to the service and back to the model,
put all destruction code in the service. Also removes a possible source of failure
where run_after_commit may not destroy the project.
2016-08-10 09:28:21 -07:00
Robert Schilling 839aec1a61 Replace parse_boolean with to_boolean 2016-07-20 08:55:44 +02:00
tiagonbotelho 563b303bde removes basicprojectwithaccess and replaces it with basicprojectdetails 2016-07-12 17:32:40 +01:00
tiagonbotelho 8d9e649c24 changes the usage of simpleprojectdetails to already implemented basicprojectsdetails and changes the url to a more reader friendly format 2016-07-12 16:40:49 +01:00
tiagonbotelho 2179c4052e adds basic functionality to the new endpoint of the api 2016-07-12 16:39:25 +01:00
tiagonbotelho be3409ab7a changes string to symbol in param 2016-07-12 16:36:42 +01:00
tiagonbotelho c4dc0f52c3 adds test to check json fields on simple request and changes the url request format 2016-07-12 16:36:42 +01:00
tiagonbotelho f5d92d120e changes the usage of simpleprojectdetails to already implemented basicprojectsdetails and changes the url to a more reader friendly format 2016-07-12 16:36:42 +01:00
tiagonbotelho a8cf4e13b3 adds basic functionality to the new endpoint of the api 2016-07-12 16:36:42 +01:00
tiagonbotelho e1c5eb480e implements filter_params 2016-07-12 16:36:42 +01:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Kamil Trzcinski 0958f331d1 Merge remote-tracking branch 'origin/master' into docker-registry
# Conflicts:
#	config/initializers/1_settings.rb
2016-05-13 17:14:46 -05:00
Sean McGivern 97424ea544 Restrict starred projects to viewable ones
`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.
2016-05-10 18:13:52 +01:00
Kamil Trzcinski 0094d8f196 Rename `images` to `container_registry` 2016-05-09 20:29:57 +03:00
Kamil Trzcinski 03b3fe13f6 Make images_enabled configurable 2016-04-29 16:45:00 +02:00
Robert Schilling 54231aa4e0 Styling changes to code and docs 2016-04-13 16:25:24 +02:00
Robert Schilling 3ab9ea8dae Make staring API more restful 2016-04-13 14:26:41 +02:00
Robert Schilling ea2193aaeb API: Star and unstar a project 2016-04-13 14:26:40 +02:00
Zeger-Jan van de Weg 3549d7c1d4 PUT becomes POST on archiving endpoints
Also the specs have a minor improvement. Mainly the access right spec.
Changes are reflected in the docs
2016-03-24 18:58:42 +01:00
Zeger-Jan van de Weg 2c5bcf2e1b Add endpoints for archiving and unarchiving 2016-03-23 22:36:35 +01:00
Dmitriy Zaporozhets e8b3b92dde
Bring share project with group API from EE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-13 11:52:43 +01:00
Kamil Trzcinski b4c36130cc Rename allow_guest_to_access_builds to public_builds 2016-02-04 12:57:46 +01:00
Kamil Trzcinski 6a5a175d9f Expose allow_guest_to_access_builds in GitLab API 2016-02-04 11:14:12 +01:00
Josh Frye 91b9cbff8d First pass at deleting projects in the background. 2016-01-29 09:14:16 -05:00
Douwe Maan 9664424cab Merge branch 'ci/api-projects' into 'master'
Extend projects API with CI data

Reference #4264 

See merge request !2303
2016-01-13 13:32:35 +00:00
Tomasz Maczukin fc4108b38b Modify CI features in projects API 2016-01-11 15:27:20 +01:00
Douwe Maan 1886d727f7 Add API project upload endpoint 2016-01-07 13:37:14 +01:00
Tomasz Maczukin ba9799b42f Update ./doc/api 2016-01-07 10:39:02 +01:00
Tomasz Maczukin 0a21731e3b Add ci fields in project create/update feature API 2016-01-05 15:00:25 +01:00
Stan Hu 086cfc8685 Fix API project lookups when querying with a namespace with dots
Attempting to use the /projects/:id API by specifying :id in
"namespace/project" format would always result in a 404 if the namespace
contained a dot.

The reason? From http://guides.rubyonrails.org/routing.html#specifying-constraints:

"By default the :id parameter doesn't accept dots - this is because the dot is
used as a separator for formatted routes. If you need to use a dot within an
:id add a constraint which overrides this - for example id: /[^\/]+/ allows
anything except a slash."

Closes https://github.com/gitlabhq/gitlabhq/issues/9573
2016-01-03 15:08:44 -08:00
Stan Hu 301a30e0ea Add project permissions to all project API endpoints
This standardizes all the project API formats. Also needed to support Huboard.
2015-12-22 10:58:23 -08:00
Zeger-Jan van de Weg c36821df9f Api support for requesting starred projects for user
Fixes #4112
2015-12-16 21:46:00 +01:00
Kamil Trzcinski e80e3f5372 Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
Stan Hu 631a30276e Fix API setting of 'public' attribute to false will make a project private
Closes #3864
2015-12-05 17:39:36 -08:00
Kamil Trzcinski 6384c757b7 Expose CI enable option in project features
- Enable CI by default for all new projects
2015-11-13 10:52:50 +01:00
Han Loong Liauw 0bea5ced8b Made suggested content changes based on MR Review
Changed the authentication method for removing fork through API
Reflected changes to new auth method in API specs
2015-10-14 20:19:41 +11:00
Han Loong Liauw df99ddbba1 Adds ability to remove the forked relationship
This was previously possible through the API but can now be done
through the project#edit settings screen if the current user is
the owner of the project.
Update changelog
2015-10-13 21:42:17 +11:00
Valery Sizov 22bf844869 fix specs. Stage 3 2015-09-15 13:50:24 +03:00
Valery Sizov 7c3ca86370 Add order option for projects API 2015-05-14 15:49:09 +03:00
Stephan van Leeuwen 3b3662da0a Updated api method GET /projects/:id/events to use paginate instead of a self-implementation
Also updated example request url

Added changelog item
2015-03-24 19:11:48 +01:00
Vinnie Okada 285c534185 Allow admins to override restricted visibility
Allow admins to use restricted visibility levels when creating or
updating projects.
2015-03-08 16:10:05 -06:00
Dmitriy Zaporozhets bdfb349ff7 Refactor and improve sorting objects in API for projects, issues and merge requests 2015-02-05 22:00:54 -08:00
Mika Mäenpää 7dd5656a5b Implement edit via API for projects 2015-01-22 16:58:01 +01:00
Jeroen van Baarsen ec29ce4b02 Merge pull request #8307 from cirosantilli/project-api-comment-typo
Typo in project API events comment
2015-01-18 19:05:02 +01:00
Marin Jankovski 8689ce1efe Add search filter option on project api for authorized projects. 2015-01-12 11:08:53 +01:00
Marin Jankovski 7240150c89 Forward the messages in api response. 2014-12-30 15:17:46 +01:00
Stephan van Leeuwen 180fda3d0a Updated indentation on case when statements. 2014-12-29 16:36:56 +01:00
Stephan van Leeuwen 6af34b0f71 Changed setting the sort variable
Changed from using cases to set the sort variable, to use a one line if/else statement
2014-12-29 16:36:56 +01:00
Stephan van Leeuwen 6b50721946 Updated projects api to allow ordering
Added support for order_by and sort parameters, to sort the projects by the specified values.
Updated projects api documentation including the order_by and sort parameters
2014-12-29 16:36:56 +01:00
Ciro Santilli e375d0de65 Typo in project API events comment 2014-11-14 09:33:33 +01:00
Vinnie Okada 41518a467d Remove :keep_repo option
Always delete repositories from the filesystem when deleting a project.
2014-10-22 21:08:19 -05:00
Vinnie Okada 68b5ac7f18 Add option to keep repo on project delete
Update the project API controller to use `Projects::DestroyService`
instead of calling `Project#destroy` directly.

Also add an optional parameter, `:keep_repo`, that allows a project to
be deleted without deleting the repository, wiki, and satellite from
disk.
2014-10-07 15:21:00 -05:00
Bernhard Kaindl f030ee846e API: Initial support for forking a project via the API
This change adds POST /projects/fork/:id to the API for forking
a project into the namespace of the authenticated user, like the
"create fork" link in the GUI does. It also calls the same code.

Failure and permission checks (except for conflict) are already
implemented and handled in ForkService and the API, so the added
code is simple and does not alter anything.
2014-10-01 10:27:48 +02:00
jubianchi 998cd3cb63 Improve error reporting on users API
* users (#6878, #3526, #4209): Validation error messages are now exposed through 400 responses, 409 response are sent in case of duplicate email or username
* MRs (#5335): 409 responses are sent in case of duplicate merge request (source/target branches), 422 responses are sent when submiting MR fo/from unrelated forks
* issues
* labels
* projects
2014-09-16 01:25:24 +02:00
Robert Schilling 9284038dbe Add, delete labels via API 2014-08-13 12:28:19 +02:00
Dmitriy Zaporozhets f8eedb4cda
Cleaner variable name
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-11 15:25:25 +03:00
Dmitriy Zaporozhets d10ecacc47 Merge branch 'master' into 'master'
Let users limit by archived/not archived projects in GitLab API GET /projects

Adds a boolean parameter, archived, to the /projects endpoint.

See merge request !158
2014-08-11 09:27:24 +00:00
Dmitriy Zaporozhets 70f868b737
Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-30 16:05:43 +03:00
Sasha Joseph 37c4ba6f8d Add an option to GET /projects in the GitLab API to exclude archived projects 2014-07-28 12:48:13 -04:00
Dmitriy Zaporozhets 66098dbb59 Merge pull request #7089 from NARKOZ/api-patch
API patch
2014-07-23 20:26:36 +03:00
Dmitriy Zaporozhets ae564c97d4
Dont expose user email via API
To prevent leaking of users info we reduce amount of user information
retrieved via API for normal users.

What user can get via API:

* if not admin: only id, state, name, username and avatar_url
* if admin: all user information
* about himself: all informaion

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-13 17:46:48 +03:00
Dmitriy Zaporozhets 1355ede49d
Wipe wall notes feature
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-13 14:24:54 +03:00
Nihad Abbasov 7040a42cfc API: ability to set an import url when creating project for a specified user 2014-06-06 06:31:55 +05:00
Ábner Silva de Oliveira e153469f31 changed doc comment for get labels of a project 2014-03-23 19:07:18 -03:00
Ábner Silva de Oliveira 44aa6b90dd added api method to return labels of a given project 2014-03-21 06:25:25 -03:00
Dmitriy Zaporozhets eea317795e
Add current user permissions info to /api/projects/:id.json
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-03-17 14:33:41 +02:00
Dmitriy Zaporozhets 7c60713e82
Move project members api to separate file
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-03-17 13:44:54 +02:00
Dmitriy Zaporozhets f0f88390c1
project_user selectbox with ajax autocomplete
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-13 16:08:26 +02:00
skv a3f645ef51 Remove deprecated finders 2014-01-19 23:39:56 +04:00
Dmitriy Zaporozhets efa10c819d
Replace context with service in lib
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-16 20:35:21 +02:00
Maxime Brugidou 56d4788264 Add import_url param in API projects create 2013-12-09 11:07:32 +01:00
Jason Hollingsworth d9bb4230cc Adding authenticated public mode (internal).
Added visibility_level icons to project view (rather than just text).
Added public projects to search results.
Added ability to restrict visibility levels standard users can set.
2013-11-26 22:22:07 -06:00
Dmitriy Zaporozhets a09fc160d0
Add project.all for API if admin
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-18 14:15:59 +02:00
Dmitriy Zaporozhets cfa15d0846
Remove default_branch support from API project creation
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-06 19:14:11 +02:00
Dmitriy Zaporozhets c8e7d6df79 API: new feature - remove project[D 2013-10-09 14:41:41 +03:00
Izaak Alpert 04c7c262a7 Used pagnation function from api helpers
Change-Id: I1bdd3608d3b46924b5da3ae282c99f85ee4e0dab
2013-09-24 09:22:46 -04:00
Izaak Alpert 4cfbfbb845 Added search for projects by name to api
GITLAB-1283 (GITLAB-869)

Change-Id: I611e7e93f6292de08e1edc8d3ea77cf9087b6ded

Conflicts:
	config/initializers/1_settings.rb
2013-09-23 19:36:25 -04:00
Dmitriy Zaporozhets d6aec3fc1a Allow specify path when create project via api 2013-08-14 13:41:06 +03:00
Angus MacArthur ace5c54ab9 enhance project creation apis to allow setting of public attribute
Change-Id: Ib71ce8cf993627eada63d7d596fb302ec702f36e
2013-07-12 12:10:42 -04:00
Dmitriy Zaporozhets 8cdfa86b57 Merge pull request #3993 from bke-drewb/3599
Issue 3599: Add snippets_enabled flag to projects for API
2013-07-11 09:54:15 -07:00
Angus MacArthur ea5a006f27 Additon of apis for fork administration.
Added ability to add and remove the forked from/to relatioinship
between existing repos.
2013-07-08 17:34:00 -04:00
Drew Blessing 31b06ebd01 Issue 3599: Add snippets_enabled flag to projects for API
s 3599: Add snippets_enabled flag to projects for API

Replace missing comma
2013-06-11 21:38:02 -05:00
Dmitriy Zaporozhets 8df699a336 API: project events 2013-06-06 19:19:17 +03:00
Dmitriy Zaporozhets b05600f28b Split Project api on several parts: deploy_keys, hooks, snippets etc 2013-06-06 12:37:51 +03:00
babatakao 37a90d5f76 Selectable deploy keys contain master projects 2013-06-05 02:59:30 +09:00
Dmitriy Zaporozhets bcc4e4dc7e Merge branch 'gist' of https://github.com/Andrew8xx8/gitlabhq into Andrew8xx8-gist
Conflicts:
	Gemfile.lock
	app/models/ability.rb
	app/models/project.rb
	app/views/snippets/_form.html.haml
	db/schema.rb
	features/steps/shared/paths.rb
	spec/factories.rb
	spec/models/project_spec.rb
2013-06-04 18:36:22 +03:00
Dmitriy Zaporozhets 0611c5c612 Fix deploy key api 500 if key is empty 2013-06-03 21:01:07 +03:00
Dmitriy Zaporozhets 50e8d6c0c0 Add api to collect owned user projects. Api deploy_key.create: Enable deploy key if it exist in other owned project 2013-06-03 19:49:04 +03:00
Dmitriy Zaporozhets 068cf2f467 split repositories and projects api 2013-05-23 12:23:47 +03:00
Dmitriy Zaporozhets 634cbd7138 Refactor API classes. So api classes like Gitlab::Issues become API::Issues 2013-05-14 15:33:31 +03:00
Nihad Abbasov 77d0e41df0 fix API route to delete project hook 2013-05-07 00:09:23 +05:00
Dmitriy Zaporozhets 4528fa9817 modify api to work with new deploy keys 2013-05-06 16:24:58 +03:00
Dmitriy Zaporozhets dfeef6c228 Fixed API file raw functionality, Fixed tree controller tests. Added BlobController specs 2013-04-03 15:55:08 +03:00
Dmitriy Zaporozhets 541d899410 Project.repository should never be nil so you can call repository.exists? or repository.empty?
Also specify separate project factory for project with filled repo
2013-04-01 16:56:25 +03:00
Andrew8xx8 d4543eb5a7 Tests fixed 2013-03-25 11:20:14 +04:00
Alex Denisov 28e7d1a8bf Abilities added to /user and /sign_in requests 2013-03-18 20:11:28 +00:00
Sebastian Ziebell ecf53bb9e6 API: fixes project creation and removed redundant info 2013-03-07 15:11:33 +01:00
Sebastian Ziebell 3374027e3a Merge branch 'master' into fixes/api, code clean up and tests fixed
Conflicts:
	doc/api/projects.md
	spec/requests/api/projects_spec.rb
2013-03-07 14:51:56 +01:00
Dmitriy Zaporozhets 7c408960ce Merge pull request #3146 from amacarthur/AdminAPIs
Additional Admin APIs
2013-03-06 22:57:24 -08:00
Sebastian Ziebell b5ef6d2268 API: refactored and simplified error handling in merge requests API 2013-03-05 23:43:05 +01:00
Sebastian Ziebell cce35b6d05 Fixes api 2013-03-05 22:33:45 +01:00
Sebastian Ziebell 61cfa2a7a6 Merge branch 'master' into fixes/api
Conflicts:
	lib/api/projects.rb
2013-03-05 22:29:49 +01:00