Commit graph

726 commits

Author SHA1 Message Date
Sebastian Ziebell
f0e417091c Merge branch 'master' into fixes/api
Conflicts:
	spec/requests/api/projects_spec.rb
2013-02-20 14:30:11 +01:00
Sebastian Ziebell
eefb27f5ae Merge branch 'master' into fixes/api
Conflicts:
	spec/requests/api/projects_spec.rb
2013-02-20 12:43:32 +01:00
Matt Humphrey
33c513274d Fix RESTfulness of project hook deletions by API 2013-02-20 11:35:36 +00:00
Sebastian Ziebell
1b97a2eee8 API: fixes return codes, documentation updated with status codes, tests added
The users API updated with return codes, e.g. if required parameters are missing
a `400 Bad Request` error is returned instead of `404`. Fixes return codes of functions,
e.g. deletion of a ssh key is an idempotent function now.
The API documentation is updated to reflect the current status of the API. Descriptions
are more detailed and complete, infos to return values are added to all functions.
2013-02-20 12:23:56 +01:00
Dmitriy Zaporozhets
25e4c512d4 Merge pull request #3011 from Asquera/fix_access_to_nonvisible_hook
API: fixes visibility of project hook
2013-02-20 02:45:07 -08:00
Mike Wyatt
c6f5b96ba8 allow force=yes rake gitlab:setup for capistrano deploy:cold 2013-02-20 00:14:03 -03:30
Dmitriy Zaporozhets
67465dc5ef Fix private flag for project 2013-02-19 11:45:49 +02:00
Andrew8xx8
1644117a1a Issue uses StateMachine now 2013-02-18 14:43:50 +04:00
Andrew8xx8
0b512af803 Milestone uses StateMachine now 2013-02-18 14:43:50 +04:00
Andrew8xx8
29f70acc98 Merge Request uses StateMachine now 2013-02-18 14:43:50 +04:00
Dmitriy Zaporozhets
020078663e Prevent xss attack over group name. Added regex validation for group and team name 2013-02-18 09:28:18 +02:00
Sebastian Ziebell
e9d3b96595 API: fixes visibility of project hook
When a user is not authorized to see the list of hooks for a project, he is
still able to access the hooks separately. For example if access to
`GET /projects/:id/hooks` fails and returns a `403 Unauthorized` error it is
still possible to access a hook directly via `GET /projects/:id/hooks/:hook_id`.

Fixes access, also added tests to check access and status codes of hooks.
2013-02-16 14:42:49 +01:00
Dmitriy Zaporozhets
b729728536 uppercase Gitlab version and revision constants. check api return gitlab version now 2013-02-16 14:42:22 +02:00
Dmitriy Zaporozhets
e65cc4f849 Merge pull request #2994 from dasbh/master
Fix gitlab:setup task on fresh installation
2013-02-16 01:10:36 -08:00
livedata
bbd1bfd155 fixed API access to the project 2013-02-15 15:37:06 +01:00
Bhagavan Das
4bc7d98d65 Remove hardcoded refernce to gitlab-shell home. so that gitlab can be installed on any unix account other than git 2013-02-14 23:10:18 +00:00
Bhagavan Das
08dfbc962b rename setup to setup_db so that it does not collide with gitlab🐚setup task 2013-02-14 21:39:48 +00:00
Riyad Preukschas
428af5ea62 Merge pull request #2890 from cameronyule/support_osx_groups
OS X support for gitlab:check rake tasks
2013-02-14 11:07:46 -08:00
Sebastian Ziebell
c8b92a4be2 Merge branch 'master' into fixes/api 2013-02-14 17:02:16 +01:00
Sebastian Ziebell
c305eb31aa API: tests that check status codes for project branches and hooks
Status code 422 (Unprocessable Entity) returned if invalid url is given when creating
or updating a project hook.
2013-02-14 16:55:33 +01:00
Sebastian Ziebell
6df02adc7a API: status code 403 returned if new project would exceed limit
When the project limit is reached the user is not allowed to create new ones.
Instead of error code 404 the status code 403 (Forbidden) is returned with error
message via API.
2013-02-14 15:51:56 +01:00
Dmitriy Zaporozhets
c9ca15e8d6 require missing lib 2013-02-14 15:25:55 +02:00
Dmitriy Zaporozhets
49cf9badbc Gitlab::ShellEnv added 2013-02-14 15:17:43 +02:00
Dmitriy Zaporozhets
b698094d4d Update post-receive worker to use correct identifier 2013-02-14 14:00:02 +02:00
Sebastian Ziebell
6fc3263e15 API: extracted helper method to provide 400 bad request error with description
Extracted a method for 400 error (Bad request) and adjusted code accordingly. The name of
the missing attribute is used to show which one was missing from the request. It is used to
give an appropriate message in the json response.
2013-02-13 15:48:52 +01:00
Sebastian Ziebell
54ab9bb6df API: return status code 400 if filepath of raw file blob not given 2013-02-13 14:47:59 +01:00
Andrew8xx8
839957cf56 Constants in Events looks good now 2013-02-13 15:48:16 +04:00
Sebastian Ziebell
fd01f3aacd API: fixes a few return codes for project snippets
When using project snippets via API the functions now provide status codes for
different situations other then only returning 404 error. If required parameters are missing,
e.g. `title` when creating a project snippet a 400 (Bad request) error is returned. The snippet
delete function now is idempotent and returns a 200 (Ok) regardless if the snippet with the
given id is available or not. Changing return codes of these functions has the advantage that
the 404 error is used only for resources, which are not available.

Tests added to check these status codes when handling project snippets.
2013-02-13 12:09:16 +01:00
Sebastian Ziebell
375caeefcf Merge branch 'master' into fixes/api 2013-02-13 10:31:06 +01:00
Dmitriy Zaporozhets
b9f8b40190 Merge pull request #2971 from yuters/patch-1
Some fix for gitlab:gitlab_shell:check
2013-02-12 22:17:24 -08:00
Martin Bastien
8353bd8ee3 Forgot gitlab-shell folder 2013-02-12 12:49:11 -05:00
Martin Bastien
6b96ca47e0 Some fix for gitlab:gitlab_shell:check
Fixing issue #2970
2013-02-12 12:42:36 -05:00
Dmitriy Zaporozhets
37a5ac4271 Merge pull request #2969 from zerustech/patch-1
Update lib/tasks/sidekiq.rake
2013-02-12 09:25:53 -08:00
Dmitriy Zaporozhets
8f9c01feed Merge pull request #2946 from Asquera/fix/access_to_non_existent_branch
API: Fixes return code when accessing non existent branch (#2922)
2013-02-12 09:24:54 -08:00
Dmitriy Zaporozhets
ddea7d1689 Merge branch 'easy-to-find-commit-on-network-graph' of https://github.com/hiroponz/gitlabhq into hiroponz-easy-to-find-commit-on-network-graph 2013-02-12 19:02:05 +02:00
Sebastian Ziebell
7cc4339f71 API: changed status codes for project hooks functions
Different status codes in the API lib are returned on hook creation, update or deletion.
If a required parameter is not given (e.g. `url` in `/projects/:id/hooks/:hook_id`) status
code 400 (Bad request) is returned. On hook deletion a 200 status code is returned, regardless if
the hook is present or not. This makes the DELETE function an idempotent operation. Appropriate tests
are added to check these status codes.
2013-02-12 17:44:42 +01:00
Michael Lee
4c0c908655 Update lib/tasks/sidekiq.rake
Mac OS uses launchd instead of /etc/init.d to start daemons and tasks to be started by launchd MUST NOT daemon itself. So "nohup" here won't work for Mac OS. 

Can we add a "launchd" task to the rake file so that we can start sidekiq as "bundle exec rake sidekiq:launchd" ?
2013-02-12 23:01:55 +08:00
Sebastian Ziebell
449380265a Merge branch 'master' into fixes/api 2013-02-12 10:17:57 +01:00
Dmitriy Zaporozhets
2a1fac9e4f add import repo gitlab_shell call 2013-02-11 19:41:02 +02:00
Dmitriy Zaporozhets
d64090b8a9 No gitolite in project any more 2013-02-11 19:16:59 +02:00
Dmitriy Zaporozhets
2d83e43db0 FIx gitlab:env:info 2013-02-11 10:02:52 +02:00
Dmitriy Zaporozhets
7a88bf0978 Fix gitlab:check 2013-02-11 09:58:02 +02:00
Sebastian Ziebell
2bd955961c Changed function to not_found.
Instead of using funtion `error!` the function `not_found!` is used to return 404 error. Adjusted documentation accordingly.
2013-02-09 21:01:17 +01:00
Dmitriy Zaporozhets
a404c43805 removing outdated checks 2013-02-09 15:34:04 +02:00
Dmitriy Zaporozhets
2f019b2b4c cleanup rake tasks since no gitolite required 2013-02-09 15:21:19 +02:00
Dmitriy Zaporozhets
433f2dbcef task to build missing projects with gitlab-shell 2013-02-09 12:30:49 +02:00
Sebastian Ziebell
40e7846f3e Status code 404 returned when retrieving non existent branch (issue #2922)
Accessing a repository branch that does not exist returns a 404 error instead
of 200 now. Added a test.
2013-02-08 17:04:08 +01:00
Sebastian Ziebell
9544f90389 Adding a project hook returns status code 400 if url is not given
When adding a project hook a url must be specified or a 400 error code is returned

* Specs added to check status code on handling project hooks
* refactored code, extracted a method
2013-02-08 16:48:05 +01:00
Sebastian Ziebell
818caf0b5d API: refined status code handling when adding or updating a project member
When a user is added to a project that is already a member of, a status code 201 is now returned to
signal an idempotent operation. If something fails then instead of returning error code 404 different
more specific error codes are returned. Status code 400 (Bad request) is returned when a required
attribute, e.g. `access_level` is not given or 422 if there is a semantic error, e.g. should
the `access_level` have an unsupported value.

Specs are added to check these status codes.
2013-02-08 14:33:29 +01:00
Sebastian Ziebell
8045a81bcf Merge branch 'master' into fixes/api 2013-02-08 10:32:42 +01:00
Dmitriy Zaporozhets
4e1757bfda Merge branch 'gitlab-shell' of dev.gitlabhq.com:gitlab/gitlabhq 2013-02-07 08:26:39 +00:00
Dmitriy Zaporozhets
cdcf69d0d9 gitlab;shell init script 2013-02-07 10:06:39 +02:00
Dmitriy Zaporozhets
8ae1d812dc deploy keys support for gitlab-shell api 2013-02-07 09:56:13 +02:00
Sebastian Ziebell
bb24275f8d Status code 400 is returned if body is missing on note creation.
If a note is created with a POST request via API (`/projects/:id/notes`) status
code 400 is returned instead of 404. The resource itself exists but the request
is incomplete. Specs added to check different status codes when accessing, creating
and updating notes.
2013-02-06 17:11:00 +01:00
Sebastian Ziebell
5be0265fe7 Status code 400 returned if title not given in a milestone (via API)
If a milestone is created via API but no title given then status code 400 (Bad request)
is returned instead of 404. A small helper method handles the errors collection of a
milestone.
2013-02-06 17:10:29 +01:00
Sebastian Ziebell
f978a71f41 Creating MR comment without a note returns status code 400 (Bad request)
Creating a comment to an existing merge request via API without providing a note
returns a status code 400 now, suggesting a bad request. The reason for this
is the resource itself (MR) exists but the required property is not set.
2013-02-06 17:02:30 +01:00
Sebastian Ziebell
3f4e215c80 Extracted helper method to avoid code duplication 2013-02-06 17:02:30 +01:00
Sebastian Ziebell
413952ff94 Creating or updating a MR returns more informative status codes.
Using the API library to create or update a merge request at the moment a 404 error is returned.
This is fine when the merge request in question does not exist, but does not provide good
information that for example a required attribute is missing.
A status code of 400 (Bad request) is returned when creating or updating a merge request
when either `source_branch` or `target_branch` is missing. A status code of 409 is returned
when `source_branch` and `target_branch` are the same. Tests are added for these cases.
2013-02-06 16:57:00 +01:00
Dmitriy Zaporozhets
4bfb98ddc9 Merge pull request #2877 from former03/feature_groups_api
Add groups api
2013-02-06 03:19:29 -08:00
Dmitriy Zaporozhets
18fc090052 remove hooks and support scripts from main repo. Moved to gitlab-shell 2013-02-05 15:59:40 +02:00
Dmitriy Zaporozhets
bd3288e320 api check call 2013-02-05 15:55:49 +02:00
Dmitriy Zaporozhets
adfd36f26a no need to run gitolite for enable_automerge 2013-02-05 13:30:56 +02:00
Sato Hiroyuki
9dccecc9b5 Sort the commits on network graph by commiter date.
Author date is not updated, if the commits is rebased.
So the network graph having many rebased commit turns round and round,
that it is very difficult to undarstand history.
2013-02-05 19:58:49 +09:00
Dmitriy Zaporozhets
70e3bffd95 Fixed: post-receive, project remove, tests 2013-02-05 12:47:50 +02:00
Sato Hiroyuki
df85c9c06a Fix bug when it has been switched to tag. 2013-02-05 19:08:25 +09:00
Dmitriy Zaporozhets
39e37677f2 add remove keys from gitlab-shell by id 2013-02-05 11:12:15 +02:00
Dmitriy Zaporozhets
081c272b85 Remove outdated specs and fixed key remove 2013-02-05 10:15:49 +02:00
Sato Hiroyuki
81cc1cb87b Enable to display the commit older than 650th commit. 2013-02-05 12:42:30 +09:00
Sato Hiroyuki
7812cb77c8 Fix typo. 2013-02-05 12:20:04 +09:00
Dmitriy Zaporozhets
935b6ae653 Internal API 2013-02-04 17:53:43 +02:00
Dmitriy Zaporozhets
6f7ccea668 Fix satellites to use filesystem. Correct post-receive user finder 2013-02-04 16:19:37 +02:00
Dmitriy Zaporozhets
27d9ac0fe8 Make gitlab works with gitlab-shell 2013-02-04 15:07:56 +02:00
Dmitriy Zaporozhets
6b9a609044 preparing for gitlab-shell 2013-02-04 14:28:10 +02:00
Christian Simon
33c48ecd35 Code deduplication using inheritance for GroupDetail 2013-02-03 19:38:33 +01:00
Cameron Yule
e0d62d9c5f Replacing the manual parsing of the /etc/group file with the equivalent call from the Etc class in the Ruby standard library. This has the benefit of supporting additional platforms (e.g. OS X). 2013-02-02 20:04:07 +00:00
Riyad Preukschas
fac503877d Port changes from #2803 2013-02-01 21:22:40 +01:00
Riyad Preukschas
42dd006dfc Small fixes to the installation guide and check task 2013-02-01 21:06:44 +01:00
Riyad Preukschas
003c312104 Merge pull request #2440 from klamontagne/master
Don't setuid the repositories on installation
2013-02-01 20:56:03 +01:00
Christian Simon
149ccd5d91 Fix groups api: differ between users and admin 2013-02-01 15:00:12 +01:00
Felix Gilcher
ce6436b98a Don't crash when removing a user that's not project member
The attempt to revoke project access for a user that was not member of the
project results in a 500 Internal Server error where it actually should
result in a 200 OK since after the operation, the user is not member of
the project. This turns the operation into an idempotent call that can
be repeated with no ill effects.

Updated the spec and changed the code accordingly. However, the result differs
slightly, as we can't return the users project access level if the user was not
member. I'm not aware if anybody relies on the result of this call.

Fixes #2832
2013-02-01 13:53:35 +00:00
Christian Simon
8edc6b6a8c Add api for creating/listing/viewing groups 2013-02-01 12:11:19 +01:00
Felix Gilcher
c72910a8bf log fatal errors that we catch
In case we rescue from a fatal error, we want the error and the backtrace to
the error logged, so we can debug later on. This change injects the configured
logger from the rails app to the grape API and logs error as well as backtrace
in a rails-like fashion.
2013-02-01 10:23:23 +00:00
Dmitriy Zaporozhets
5857a7a9ce Merge pull request #2839 from m4tthumphrey/protected-branches-api
Added methods to protect and unprotect branches in from the API
2013-01-31 10:44:20 -08:00
Dmitriy Zaporozhets
fd1b9fdc12 Merge branch 'extend_user_api' of https://github.com/bladealslayer/gitlabhq into bladealslayer-extend_user_api
Conflicts:
	spec/requests/api/users_spec.rb
2013-01-31 13:00:50 +02:00
Dmitriy Zaporozhets
56000aea22 Merge pull request #2855 from hiroponz/fix-bug-of-network-graph
Fix bug of network graph(#2847) and trivial code clean up.
2013-01-31 02:33:59 -08:00
Matt Humphrey
2c7554e897 Added methods to protect and unprotect branches 2013-01-31 09:26:03 +00:00
Sato Hiroyuki
4133221200 Fix bug of network graph(#2847) and trivial code clean up. 2013-01-31 17:48:51 +09:00
Dmitriy Zaporozhets
193a5624b2 add path and path_with_namespace to api project entity 2013-01-31 09:11:35 +02:00
Dmitriy Zaporozhets
a037c9c249 Merge pull request #2842 from inome/ExposeMergeRequestAsNotable
Expose MergeRequest object as a notable in the API to allow for easy ret...
2013-01-30 22:25:02 -08:00
Dmitriy Zaporozhets
d46cb3fd1c Merge pull request #2847 from hiroponz/improve-overlap-lines
Improve overlap of lines in network graph
2013-01-30 22:22:37 -08:00
Sato Hiroyuki
59b6de93ce Improve overlap of lines in network graph 2013-01-30 23:48:00 +09:00
Micah Huff
1694dc8fe2 Expose MergeRequest object as a notable in the API to allow for easy retrieval of comments 2013-01-29 21:15:13 -08:00
Sato Hiroyuki
525a8cd3e9 Switchable the main branch on network graph 2013-01-30 09:12:03 +09:00
Felix Gilcher
2a669fc899 rescue all errors and return the proper format
This rescues all errors and returns a proper JSON response. Fixes #2833.
2013-01-29 18:20:59 +01:00
Dmitriy Zaporozhets
c84675ee06 satellites logs 2013-01-29 12:12:24 +02:00
Dmitriy Zaporozhets
299a9a1040 keys to gitolite via sidekiq now 2013-01-28 21:02:10 +02:00
Dmitriy Zaporozhets
944b2450b1 Merge pull request #2801 from Takuto88/master
Fix #2790
2013-01-28 10:33:59 -08:00
Dmitriy Zaporozhets
8b54b7233e Async perform for add/remove team members 2013-01-28 17:39:02 +02:00
Dmitriy Zaporozhets
1c5876eb7b Do gitolite calls async. Remove satellite with project remove 2013-01-28 17:22:45 +02:00
Lennart Rosam
f9a48f72d4 Fix issue #2790 2013-01-28 13:52:30 +01:00