Commit Graph

312 Commits

Author SHA1 Message Date
Robert Schilling 8b5c16e4b1 API: Ability to remove source branch 2016-12-04 16:52:42 +01:00
Rémy Coutable c8fb6f6f37 Merge branch 'update-api-spec-files' into 'master'
Update  API spec files to describe the correct class by changing `API::API` to the corresponding class, for example `API::AwardEmoji`.

Closes #24902

See merge request !7718
2016-12-02 09:38:11 +00:00
Grzegorz Bizon 4681ab1df1 Fix Rubocop offense in merge request specs 2016-11-30 14:08:51 +01:00
Grzegorz Bizon 00ca7adca2 Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeeds
* master: (110 commits)
  Rewrite an HTTP link to use HTTPS
  Edit /spec/features/profiles/preferences_spec.rb to match changes in 084d90ac
  Add blue back to sub nav active
  Remove JSX/React eslint plugins.
  Fix a transient spec failure
  Adds hoverstates for collapsed Issue/Merge Request sidebar
  Moved groups above projects
  Add StackProf to the Gemfile, along with a utility to get a profile for a spec
  Update Sidekiq-cron to fix compatibility issues with Sidekiq 4.2.1
  Add a CHANGELOG entry
  Alert user when logged in user email is not the same as the invitation
  Expose timestamp in build entity used by serializer
  Rename `MergeRequest#pipeline` to `head_pipeline`
  Remove unnecessary database indexes
  CE-specific changes gitlab-org/gitlab-ee#1137
  Fixing typo & Clarifying Key name
  fix started_at check
  fix blob controller spec failure - updated not to use file-path-
  fix blob controller spec failure
  Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security'
  ...

Conflicts:
	app/controllers/projects/merge_requests_controller.rb
	lib/api/merge_requests.rb
	spec/requests/api/merge_requests_spec.rb
2016-11-30 12:21:33 +01:00
Grzegorz Bizon a49e9949c6 Rename `MergeRequest#pipeline` to `head_pipeline` 2016-11-29 14:12:49 +01:00
Douwe Maan 3d7704ae5f Merge branch 'zj-fix-label-creation-non-members' into 'security'
Fix label creation non members

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23416

See merge request !2006
2016-11-28 21:24:19 -03:00
Livier eb4f15571d Changed API spec files to describe the correct class
Restore changes for api spec files

Fix error in rspec Users

Delete extra space Repositories-spec
2016-11-28 10:55:27 -07:00
Grzegorz Bizon 895d97af87 Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeeds
* master: (312 commits)
  Fix bad selection on dropdown menu for tags filter
  Fixed issue boards scrolling with a lot of lists & issues
  You can only assign default_branch when editing a project ...
  Don't convert data which already is the target type
  Stop supporting Google and Azure as backup strategies
  renames some of the specs and adds changelog entry
  Fixed dragging issue moving wrong issue after multiple drags of issue
  Fixed issue boards issue sorting when dragging issue into list
  Rephrase some system notes to be compatible with new system note style
  Add missing JIRA file that redirects to the new location
  Fix documentation to create the `pg_trm` extension before creating the DB
  Document that we always use `do...end` for `before` in RSpec
  Backport Note#commands_changes from EE
  Log mv_namespace parameters
  Add default_branch attr to Project API payload in docs.
  Fix title case to sentence case
  properly escape username validation error message flash
  Remove header ids from University docs
  Add missing documentation.
  Added test that checks the correct select box is there for the LFS ...
  ...

Conflicts:
	app/services/system_note_service.rb
	spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb
	spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb
	spec/services/system_note_service_spec.rb
2016-11-25 11:05:34 +01:00
Robert Schilling cb11d3521c Fix IID filter for merge requests and milestones 2016-11-22 08:25:07 +01:00
Grzegorz Bizon c6a4f9fc5b Update some docs to reflect MWPS name change 2016-11-21 11:27:28 +01:00
Robert Schilling 9dbb0417ba Grapify the merge request API 2016-11-15 10:31:18 +01:00
Valery Sizov a6ba358a8f Make specs a bit faster 2016-11-01 14:46:59 +02:00
Rémy Coutable ec0061a95c Allow Member.add_user to handle access requesters
Changes include:

- Ensure Member.add_user is not called directly when not necessary
- New GroupMember.add_users_to_group to have the same abstraction level as for Project
- Refactor Member.add_user to take a source instead of an array of members
- Fix Rubocop offenses
- Always use Project#add_user instead of project.team.add_user
- Factorize users addition as members in Member.add_users_to_source
- Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects
- Destroy any requester before adding them as a member
- Improve the way we handle access requesters in Member.add_user
  Instead of removing the requester and creating a new member,
  we now simply accepts their access request. This way, they will
  receive a "access request granted" email.
- Fix error that was previously silently ignored
- Stop raising when access level is invalid in Member, let Rails validation do their work

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 09:43:00 +02:00
Ben Boeckel 9c3db830c0 entities: expose {,merge_commit_}sha in MergeRequest
Fixes #20456.
2016-08-31 10:50:54 -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
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Ben Boeckel eac19b2893 api: expose {should,force}_remove_source_branch
Workflows which use a bot to merge should remove branches if requested.
Expose the flag so that bots can request know this.
2016-07-11 14:08:06 -04:00
Douwe Maan 6ce25e7b4c Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
Douglas Barbosa Alexandre e186626d25 Allow '?', or '&' for label titles 2016-07-05 20:57:09 -03:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
Stan Hu a85dde9182 Fix Error 500 when using closes_issues API with an external issue tracker
Closes #18484
2016-06-11 19:50:08 -07:00
Rémy Coutable 5324c93643 Rename MergeRequest#cannot_be_merged_because_build_is_not_success? to #mergeable_ci_state?
The logic of the method was obviously inverted.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-10 14:37:32 +02:00
Rémy Coutable 6dff7c1771 Improve initial implementation of the 'only_allow_merge_if_build_succeeds.rb' feature
Based on the feedback from reviewers.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-10 14:36:57 +02:00
Rui Anderson 07dbd6b388 Allow or not merge MR with failed build
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-10 14:36:54 +02:00
Kamil Trzcinski 842f0a3401 Merge branch 'rename-ci-commit' into rename-ci-commit-phase-2
# Conflicts:
#	features/steps/shared/builds.rb
#	spec/requests/ci/api/builds_spec.rb
2016-06-06 11:21:39 +02:00
Kamil Trzcinski 7ad7e10fee Merge remote-tracking branch 'origin/master' into rename-ci-commit 2016-06-06 11:20:17 +02:00
Kamil Trzcinski 9614c52266 Fix tests offenses: use `pipeline` of Ci::Build and rename views 2016-06-06 11:19:54 +02:00
Kamil Trzcinski 20c7144ed2 Rename all `[ci_]commit` to `[ci_]pipeline` in specs and features 2016-06-03 16:22:26 +02:00
Kamil Trzcinski 8ce1896b46 Merge commit 'ca3c5c295ed653b483fe81c3918ffe60f46666b9' into rename-ci-commit
* commit 'ca3c5c295ed653b483fe81c3918ffe60f46666b9':
  Let contributors know where to start
  Ensure branch cleanup regardless of whether the import process succeeds
  Fix failing todo tests
  Reorder the todos because the use of the project finder attempts to order them differently
  Update target todo test to use a public project
  Use the project finder in the todos finder to limit todos to just ones within projects you have access to.
  Move filtering todos by projects not pending deletion into a scope on the todo model
  Reduce the filters on the todos joins project query by being explicit about the join
  Ensure we don't show TODOS for projects pending delete
  Fix deprecation warnings in spec/services/issues/bulk_update_service_spec.rb
  Remove unused Issuable#is_assigned? method
  fixup! Don't allow merges with new commits
  fixup! Add `sha` parameter to MR accept API
  Reduce Namespace queries in UserReferenceFilter
  Added ReferenceFilter#nodes
  Returning enums in ReferenceFilter#each_node
  Don't allow merges with new commits
  Add `sha` parameter to MR accept API
2016-06-03 15:53:26 +02:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Kamil Trzcinski 021d3810c3 Rename Ci::Commit to Ci::Pipeline and rename some of the ci_commit to pipeline 2016-06-02 16:59:04 +02:00
Sean McGivern d863d86aeb Add `sha` parameter to MR accept API
The `sha` parameter is optional, and when present, must match the
current HEAD SHA of the source branch. Otherwise, the API call fails
with a 409 Conflict and a message containing the current HEAD for the
source branch.

Also tidy up some doc wording.
2016-06-01 20:29:54 +01:00
Zeger-Jan van de Weg 4558b5b9fe Incorporate feedback 2016-05-11 22:43:58 +02:00
Rémy Coutable f5240f9703
Expose MergeRequest#user_notes_count in the API and use the method in issues list
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-09 16:08:07 +02:00
Robert Schilling a9200d93d3 Ensure that issues and merge requests are found 2016-04-13 17:15:42 +02:00
Robert Schilling fa3009095f Make subscription API more RESTful 2016-04-13 13:52:13 +02:00
Robert Schilling f875189b39 API: Ability to subscribe and unsubscribe from a merge request 2016-04-13 13:45:01 +02:00
Abhi Rao 762d6ab4fd Ensuring Merge Request API returns boolean values for work_in_progress
Fixes #14692
2016-03-28 22:11:44 -05:00
Zeger-Jan van de Weg d28a587e82 Fix typos and denting 2016-03-21 19:30:45 +01:00
Zeger-Jan van de Weg 3b088fc5b5 Minor improvements on IssuableActions 2016-03-21 16:59:35 +01:00
Zeger-Jan van de Weg 1d77822816 minor improvements and fixed specs 2016-03-19 21:24:05 +01:00
Zeger-Jan van de Weg 212e83bab3 Soft delete issuables 2016-03-19 21:23:03 +01:00
Douwe Maan 0807bd5130 Merge branch 'skakirill/gitlab-ce-api-merge-request-setup-milestone' into 'master'
API: Allow to set or update a merge-request's milestone

_Originally opened at !2107 by @ skakirill._

- - -


See merge request !2755
2016-02-12 08:39:18 +00:00
Rémy Coutable 973a7d040e Merge branch 'Schniz/gitlab-ce-feature/merge-request-closes-issues-in-api' into 'master'
Add merge_requests/:merge_request_id/closes_issues

_Originally opened at !2660 by @Schniz._

- - -

Added `/api/v3/projects/:id/merge_requests/:merge_request_id/closes_issues` route in the API for getting the issues that should be closed when a merge request merged successfully

See merge request !2779
2016-02-11 17:13:36 +00:00
Rémy Coutable b91d1890a8 Pass current_user to merge_request.closes_issues in API ans streamline MR API specs 2016-02-11 09:34:07 +01:00
Gal Schlezinger 78e36780be Added '/api/v3/projects/:id/merge_requests/:merge_request_id/closes_issues' route in the API
Added some documentation for it

Added to changelog

Added curl example and an attribute table

Moved the api route definition from "lib/api/issues.rb" to "lib/api/merge_requests.rb"

Fixed the attributes and changed the documentation to be at "merge_requests.md" too

Changed generic titles to more specific titles

added an underscore

added tests. it depends on a newer version of gitlab-test project
I'm doing a  since I need to add a branch to the `gitlab-test` repo

removed the before

using 'iid' instead of 'id' in the description to reference the issues. that makes the tests pass

Removed the 'closes-issues' key from test_env. so it should pass the tests

Moved the two initializations to the describe block

Changed the changelog
2016-02-11 09:34:07 +01:00
Rémy Coutable 2d59a0ff44 Add a spec for setting/updating a MR's milestone via the API 2016-02-09 10:06:26 +01:00
Rémy Coutable f6a666bdc2 Add an API spec for MergeRequest#merge_status and properly document this resource 2016-02-08 17:18:44 +01:00
Dmitriy Zaporozhets dfb8803c1c
Improve consistency and duplication for Merge Request API
* Follow REST for merge request API route
* Remove repeating comments API for MR

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-01-28 14:26:12 +01:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Zeger-Jan van de Weg 0e96d6eb10 Merge branch 'master' into merge-if-green 2015-12-07 10:06:07 +01:00
Zeger-Jan van de Weg 2462a96e45 Incorporate feedback 2015-12-05 15:42:38 +01:00
Dmitriy Zaporozhets 0b68a0e79e
Add API endpoint to fetch merge request commits list
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-04 11:08:10 +01:00
Zeger-Jan van de Weg a7682f8775 Specs for 'Merge When Build Succeeds' 2015-12-02 13:27:16 +01:00
Stan Hu 2df573dac3 Fix bug where merge request comments created by API would not trigger notifications
Closes https://github.com/gitlabhq/gitlabhq/issues/9715
2015-10-10 10:59:02 -07:00
Stan Hu 1c289ac0c3 Fix broken sort in merge request API
Closes #2266
2015-09-15 22:55:22 -07:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 9f10943c1a
Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41, reversing
changes made to 6b9dbe9f5a.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:28:42 +02:00
Dmitriy Zaporozhets b48b07044b
Merge branch 'master' into drop-satellites
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-04 16:42:36 +02:00
Dmitriy Zaporozhets c17f5d06aa
Fix merge api and spec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-04 16:33:53 +02:00
Stan Hu 6c9f527b3f Return comments in created order in merge request API
Closes #1832
2015-07-16 22:33:58 -07:00
Dmitriy Zaporozhets f40b99d02e
Merge branch 'master' into rubocop-for-tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/issues_spec.rb
	spec/models/forked_project_link_spec.rb
	spec/models/hooks/service_hook_spec.rb
	spec/models/hooks/web_hook_spec.rb
	spec/models/project_services/hipchat_service_spec.rb
	spec/requests/api/project_members_spec.rb
	spec/requests/api/projects_spec.rb
	spec/requests/api/system_hooks_spec.rb
	spec/services/archive_repository_service_spec.rb
	spec/support/matchers.rb
	spec/tasks/gitlab/backup_rake_spec.rb
2015-06-23 10:44:03 +02:00
Robert Speicher 15a05be70d Fix Style/Blocks cop violations 2015-06-22 16:00:54 -04:00
Dmitriy Zaporozhets cc9b5c49d1
Merge branch 'revert-mr-state-names'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	features/steps/project/merge_requests.rb
2015-06-22 15:43:09 +02:00
Dmitriy Zaporozhets 967214b2ec
Merge requests API returns closed for closed and merged for merged.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-22 15:11:53 +02:00
Robert Speicher 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Robert Speicher 422236c71e Change `foo.should` syntax to `expect(foo).to` in specs 2015-06-13 18:37:30 -04:00
Stan Hu 85145d1d77 Disable changing of the source branch in merge request update API 2015-05-29 09:40:35 -07:00
jubianchi 2c544d43c8 Query issues, merge requests and milestones with their IID through API 2015-05-02 10:44:52 +02:00
Douwe Maan 7e0eb486ed Don't allow a merge request to be merged when its title starts with "WIP". 2015-04-30 15:46:36 +02:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Dmitriy Zaporozhets f9e6f66898 Fix tests 2015-02-05 22:40:35 -08: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
Jeroen van Baarsen b60d06eb2c Added a way to retrieve MR files
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-04 10:24:25 +01:00
Dmitriy Zaporozhets d0e3ab5826 Merge branch 'api/improve-error-reporting' of https://github.com/jubianchi/gitlabhq into jubianchi-api/improve-error-reporting 2014-09-23 21:35:45 +03: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
Marin Jankovski f37b4cc5ad Different created_at and updated_at time in api merge_requests spec. 2014-09-15 11:54:49 +02:00
Marin Jankovski b99b2e60d5 Ordering and sorting for MR in api. 2014-09-15 11:54:49 +02:00
Robert Schilling 66f6ca0770 Fix tests after #7526 2014-08-20 20:34:55 +02:00
Robert Schilling cbc90565b5 Do label validation for issues/merge requests API 2014-08-14 10:17:52 +02:00
Dmitriy Zaporozhets 2d87556847 Remove rails observers from application 2014-06-17 22:51:43 +03:00
Dmitriy Zaporozhets 2d2b2da45a
More tests for merge api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-05-13 13:20:10 +03:00
Dmitriy Zaporozhets ab032256da
Add some tests for merge API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-05-13 11:01:40 +03:00
Dmitriy Zaporozhets 53b52b11d5 Merge pull request #6699 from criteo/api_get_open_merge_requests
Add optional parameter to list merge requests
2014-04-13 20:10:39 +03:00
Jeroen van Baarsen 5dd2f36ae1 Added API testing group 2014-04-11 21:45:56 +02:00
Stuart Pook 66209fbc76 Add optional parameter to list merge requests
Add an optional parameter to list merge requests to restrict the
returned merge requests to those that are "opened", "merged" or
"closed". By default all merge requests are returned. Note that
"all" can be given to explicitly request all merge requests.
2014-04-07 16:18:25 +02:00
Dmitriy Zaporozhets 9b6224f99c
More test fixes
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-03 12:05:21 +03:00
Stuart Pook 9886998f24 Add method to get the comments on a merge request
Add method to get the comments for a merge request and
document that you can change the status of a merge request.
2014-03-19 19:07:51 +01:00
Greg Messner f84d846223 Added tests of Create and Update MR description. 2014-03-10 12:39:29 -07:00
Dmitriy Zaporozhets cee68dec8a
Fix api merge request specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-22 21:59:09 +02:00
Dmitriy Zaporozhets c227aa44f9
Make changes to tests
* project_with_code -> project
* project -> ermpty_project

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-22 21:03:52 +02:00
Dmitriy Zaporozhets 12800e5445 Extend API Issues, MergeRequets, Milestones with iid field 2013-10-14 16:39:54 +03: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 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 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 634cbd7138 Refactor API classes. So api classes like Gitlab::Issues become API::Issues 2013-05-14 15:33:31 +03:00
Dmitriy Zaporozhets f536c13355 fixed test using repo with commits but old factory 2013-04-01 19:06:47 +03:00
Sebastian Ziebell 3b3add35fb API: merge request documentation updated, added return codes to functions
The API documentation of merge requests contains info to status codes for all functions.
Required arguments are now checked in the merge requests API functions and a `400 Bad Request` error is
returned if they are not given.
2013-02-27 15:07:42 +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
Andrew8xx8 29f70acc98 Merge Request uses StateMachine now 2013-02-18 14:43:50 +04: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 41e93bbfe2 Test added to check creation of note to a non-existent MR via API 2013-02-06 17:05:55 +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 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 afbdbb0c95 Rspec fixes 2013-01-04 18:50:31 +02:00
Dmitriy Zaporozhets ccf0686b01 Fix api specs. Use id instead path 2013-01-02 19:46:06 +02:00
Dmitriy Zaporozhets d431e43392 Fix few bugs and tests after refactoring ownership logic 2013-01-02 19:32:34 +02:00
Dmitriy Zaporozhets 9304d049de Fixed some tests and snippet colorize 2012-11-23 22:31:09 +03:00
Vincent Bonmalais 80fb38de7a Remove backward compatibility of factories. 2012-11-13 22:27:45 +11:00
Valeriy Sizov 56bf829c75 API: fix after review 2012-10-25 13:19:18 +03:00
Valeriy Sizov e6cdfb607a API: tests for merge_requests 2012-10-25 13:13:01 +03:00