Commit Graph
265 Commits
Author SHA1 Message Date
Dmitriy ZaporozhetsandJacob Vosmaer 62a27f38b5 Make sure private_token for API is a string
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-14 13:14:41 +01:00
Dmitriy Zaporozhets 03dba1fd42 Merge pull request #5344 from amacarthur/thread-variable-fix
Fixing unsafe use of Thread.current variable :current_user
2013-10-16 23:30:44 -07:00
Nihad Abbasov 12420a2256 refactor by_username_or_id 2013-10-16 22:31:46 +05:00
Nihad Abbasov e09cc195a7 fix variable name 2013-10-16 22:28:39 +05:00
Angus MacArthur aefe2e952f Fixing unsafe use of Thread.current variable :current_user 2013-10-16 01:20:53 -04:00
Dmitriy Zaporozhets 12800e5445 Extend API Issues, MergeRequets, Milestones with iid field 2013-10-14 16:39:54 +03:00
Izaak Alpert a00c534c4c Fix a bug where the tgz returned got encoded utf8
Conflicts:
	doc/api/repositories.md

Change-Id: I7ebc39b47ff860813d9622ba6776583536e6e384
2013-10-10 09:19:28 -04:00
Izaak Alpert ce21d8688d feature API call to download repo archive
defaults to HEAD

Conflicts:
	spec/requests/api/repositories_spec.rb

Change-Id: Id114aca6c59d75f18e49bf9f33809a04e010bfb6
2013-10-10 09:19:28 -04:00
Dmitriy Zaporozhets c8e7d6df79 API: new feature - remove project[D 2013-10-09 14:41:41 +03:00
Islam AmerandJacob Vosmaer 29c807ced3 Expose votes in merge request api
Signed-off-by: Islam Amer <islam.amer@jollamobile.com>
2013-10-08 09:32:00 +02:00
Dmitriy Zaporozhets baa65e89b9 Check if LDAP user was removed or blocked when use git over ssh 2013-10-07 16:06:30 +03:00
Dmitriy Zaporozhets f141711cfd API: new feature - remove group 2013-10-07 13:10:01 +03:00
Dmitriy Zaporozhets 1d3f03fb69 Fix blob and repo stuff after gitlab_git v3 2013-10-01 18:26:55 +03:00
Dmitriy Zaporozhets 715eaed6ae Refactor API: project hooks 2013-09-30 16:49:55 +03:00
Dmitriy Zaporozhets 73f780d640 API: Protect project deploy keys from unauthorized access 2013-09-30 16:47:26 +03:00
Dmitriy Zaporozhets 836104b41a Merge pull request #5213 from bladealslayer/feature/user_api_extended
Extended User API to expose admin and can_create_group for user creation...
2013-09-29 23:03:46 -07:00
Dmitriy Zaporozhets 726fa6c76a Respect authorization in Repository API
* dont allow protect/unprotect branches for users without master permissions
* dont allow access to Repository api for guests
2013-09-29 16:04:57 +03:00
Boyan Tabakov 479631aafc Extended User API to expose admin and can_create_group for user creation/updating.
Also, is_admin and can_create_group are exposed in the user information.
Fixed attributes_for_keys to process properly keys with boolean values (since false.present? is false).
2013-09-29 11:47:29 +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
Hiroyuki Sato d426195df8 Fix API::MergeRequest
Fixes #5144 Refs #4996
2013-09-22 08:21:22 +09:00
Hiroyuki Sato df9cbbc924 Drop support of root namespace in routing 2013-09-13 07:00:24 +09:00
Izaak Alpert 5dae40f579 Update to only provide one way to get a default user
-calling build_user will now apply defaults and only override them if as: :admin is set

Change-Id: Id1d938c0967752ecc14370af54f2d88128d18c44
2013-09-11 14:04:15 -04:00
Izaak Alpert d4d4a78f83 Update User api to respect default settings
-API now respects default_projects_limit, default_can_create_group, and default_can_create_team

Change-Id: I059d060d576df1050e5371e707381c5e8c608a7a
2013-09-11 14:04:15 -04:00
Izaak Alpert 7a56075efa Some of the requested updates, rebase on master
Change-Id: I305266fe9acbbb5136adeeb52e7e4e1d6629a30a
2013-09-09 12:04:38 -04:00
Izaak AlpertandIzaak Alpert e86e881832 API: admin users can sudo commands as other users
-Specifying a header of SUDO or adding a :sudo with either user id, or username of the user will set the current_user to be that user if your identifying private_token/PRIVATE_TOKEN is an administrator token
2013-09-09 12:04:38 -04:00
Izaak Alpert fadcc25189 Fixes for @randx
Change-Id: I3b15ae34c0957a0f4026e1886c92a9770e9d170e
2013-09-05 10:41:57 -04:00
Izaak Alpert 8248e1f2b8 Add group membership api
Change-Id: I5b174bba02856ede788dcb51ec9b0d598ea7d0df
2013-09-04 13:17:17 -04:00
Alex Van't Hof 59f428dca2 Standardize commit diff api url, change blob api url, add get single commit
Use "/commits/:sha/diff" as opposed to "/commit/:sha", keeping in line
with existing api urls (e.g. "/projects/:id", etc.)

Fix 500 error resulting from a diff api call with an invalid commit hash

Move "/commits/:sha/blob" to "/blobs/:sha", leaving the old path for
backwards compatibility.

Add ability to get a single commit via "/commits/:sha"
2013-08-27 21:22:42 -04:00
Dmitriy Zaporozhets cd7c131b23 Merge pull request #4916 from marbindrakon/merge_request_api
Fix project_id field in MergeRequest API
2013-08-27 01:21:57 -07:00
Andrew Austin 45280499b8 Fix project_id field in MergeRequest API 2013-08-27 01:54:09 +00:00
Gabor Nagy d139cc6b32 Adds feature: get a diff via API. 2013-08-25 23:48:11 +02:00
Dmitriy Zaporozhets d6aec3fc1a Allow specify path when create project via api 2013-08-14 13:41:06 +03:00
Dmitriy Zaporozhets 4537623d12 Merge branch 'master' into karlhungus-mr-on-fork
Conflicts:
	app/contexts/filter_context.rb
	app/contexts/search_context.rb
	app/models/merge_request.rb
	app/models/note.rb
	app/views/shared/_merge_requests.html.haml
	spec/controllers/commit_controller_spec.rb
	spec/services/notification_service_spec.rb
2013-08-08 12:22:09 +03:00
Jakub Zienkiewicz e03d01d036 extract server-side git commands to constants 2013-07-30 10:15:36 +02:00
Jakub Zienkiewicz 5e35f21605 allow all git-upload-* commands for deploy keys 2013-07-30 10:15:36 +02:00
Izaak Alpert fae3f46615 Refactor merge api create
-Made the api method a little more readable
-removed some missed extra newline's

Change-Id: Ic38baafc813aaeda0a8b283f39916182c8ec37d5
2013-07-17 22:48:03 -04:00
Izaak Alpert 489fa5d726 MR on Fork multiple fixes
-Disable observers post test run
-Allow db:seed_fu RAILS_ENV=test to be run more than once without error
-fix diffs_in_between, was passing in the default_options for grit, but grit in this case doesn't take options, fixed the test to actually fail if the incorrect diffs are returned
-make notes/commits render against proper project
-MR discussion file links should reference note's project
-Added tests for commit links on edit merge request
-fixes edit issues (canceling an edited mr, updating an edited mr)
-updates tests with checks for source code updates
-still forked_merge_requests.feature (project_forked_merge_requests) test not passing (commented out -- "stable" not being set)

MR API: error on bad target_project

-If the target project id is specified and it is not the same as the project the request is being made on (the source), and the it isn't a fork of that project, error out, otherwise use it as the target
-Fixes some busted (but hidden) test cases

Conflicts:
	app/views/merge_requests/show/_diffs.html.haml
	spec/features/notes_on_merge_requests_spec.rb

Change-Id: I20e595c156d0e8a63048baaead7be6330c738a05
2013-07-17 22:42:51 -04:00
Izaak AlpertandIzaak Alpert 3d7194f011 Merge Request on forked projects
The good:

 - You can do a merge request for a forked commit and it will merge properly (i.e. it does work).
 - Push events take into account merge requests on forked projects
 - Tests around merge_actions now present, spinach, and other rspec tests
 - Satellites now clean themselves up rather then recreate

The questionable:

 - Events only know about target projects
 - Project's merge requests only hold on to MR's where they are the target
 - All operations performed in the satellite

The bad:

  -  Duplication between project's repositories and satellites (e.g. commits_between)

(for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos)

Fixes:

Make test repos/satellites only create when needed
-Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap)
-project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually
-fixed remote removal
-How to merge renders properly
-Update emails to show project/branches
-Edit MR doesn't set target branch
-Fix some failures on editing/creating merge requests, added a test
-Added back a test around merge request observer
-Clean up project_transfer_spec, Remove duplicate enable/disable observers
-Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well
-Signifant speed ups for tests
-Update formatting ordering in notes_on_merge_requests
-Remove wiki schema update
Fixes for search/search results
-Search results was using by_project for a list of projects, updated this to use in_projects
-updated search results to reference the correct (target) project
-udpated search results to print both sides of the merge request

Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-07-17 22:41:30 -04:00
Dmitriy Zaporozhets 559e83d300 Add LDAP support to /api/session 2013-07-16 11:28:19 +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 5181816970 Merge branch 'master' into 6-0-dev 2013-07-12 14:42:35 +03: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
Dmitriy Zaporozhets 6a9aed1e87 Merge branch 'master' into 6-0-dev
Conflicts:
	CHANGELOG
	VERSION
	app/views/admin/teams/projects/new.html.haml
	app/views/projects/teams/available.html.haml
	doc/install/installation.md
2013-07-10 14:03:00 +03: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
Dmitriy Zaporozhets 439f399bec Remove all team resources except models. Move models to deprecated directory 2013-06-18 21:22:34 +03: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 993af5d0d2 cattr_accessor is not threadsafe! 2013-06-11 18:15:18 +03:00
Dmitriy Zaporozhets 8df699a336 API: project events 2013-06-06 19:19:17 +03:00
Dmitriy Zaporozhets 543506f3c5 API: Add last_activity_at date to project entity 2013-06-06 18:40:05 +03:00