Dmitriy Zaporozhets ca1c35aa51 Merge branch 'fork-via-API' into 'master'
API: Add support for forking a project via the API

This adds an API call to create a fork of a project.

Such API "fork button" has been requested by feature requests summing up with 37 votes.

The GitLab user has flagged one of them as accepting merge/pull requests for this feature.

Motivation:

The ability to create a fork is missing in the API.
(The API currently only supports adding and removing the "forked" relationship between two existing projects)

This feature (create fork thru the API) feature has been requested via two feature requests:

15 votes, 13 comments: to be able to fork a project through the API
http://feedback.gitlab.com/forums/176466-general/suggestions/4125380-to-be-able-to-fork-a-project-through-the-api (it was marked as completed in error by referring to the much more special change which allows to add&delete fork information)

22 votes, 3 comments: add a "fork project" API call that acts like the "fork button"
http://feedback.gitlab.com/forums/176466-general/suggestions/5820264-add-a-fork-project-api-call-that-acts-like-the

The implementation is described in the text of the commit message (click on the "..." field to open it).

A comprehensive test suite is added as well: It covers all 5 success / failure modes:
1. Success case
2. Failure if authenticated user has no access the the project to be forked
3. Failure if the forked project already exists in the authenticated user's namespace
4. Failure if the forked project does not exist
5. Failure if not authenticated

Documentation for the new API call is added to the project help page: doc/api/projects.md

I have 2 additional merge requests in progress, one is based on this feature and extend it, the other is related to querying forks.

The merge request that would be directly related is based on a request written comment of one of the feature requests (that was independently also requested in a but entry):
The ability to fork a project (thru the API) to a given namespace, eg. a group, in one case, for trainings.

As this request does not change code, but only adds a new request API for creating forks, it does not have
the capability to break existing code, and as the test spec demonstrates, it works.

It allocates the API request POST /projects/fork/:id, the only other API path I'd have thought of would have been POST /projects/:id/fork but that path is already taken by the API for creating a new fork relationship between projects, so POST /projects/fork/:id is the remaining possibility that I could see.

See merge request !191
2014-10-01 10:20:57 +00:00
2014-09-10 15:28:58 +02:00
2011-10-09 00:36:38 +03:00
2012-01-08 13:20:20 +02:00
2014-09-19 08:52:42 +02:00
2014-07-16 09:38:42 +03:00
2014-03-24 08:55:27 -04:00
2013-01-07 22:23:13 +02:00
2014-06-17 11:21:49 +03:00
2014-09-30 16:54:56 +03:00
2014-09-30 16:54:56 +03:00
2014-05-23 15:01:02 +02:00
2014-09-10 12:40:13 +02:00
2014-09-10 15:28:58 +02:00
2011-10-09 00:36:38 +03:00
2014-10-01 12:40:43 +03:00
2014-09-22 17:08:16 +02:00

logo GitLab

Open source software to collaborate on code

Animated screenshots

  • Manage Git repositories with fine grained access controls that keep your code secure
  • Perform code reviews and enhance collaboration with merge requests
  • Each project can also have an issue tracker and a wiki
  • Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises
  • Completely free and open source (MIT Expat license)
  • Powered by Ruby on Rails

Canonical source

Code status

  • build status on ci.gitlab.org (master branch)

  • Build Status

  • Code Climate

  • Coverage Status

  • PullReview stats

Website

On about.gitlab.com you can find more information about:

Third-party applications

Access GitLab from multiple platforms with applications below. These applications are maintained by contributors, GitLab B.V. does not offer support for them.

Requirements

  • Ubuntu/Debian/CentOS/RHEL**
  • ruby 2.0+
  • git 1.7.10+
  • redis 2.0+
  • MySQL or PostgreSQL

** More details are in the requirements doc.

Installation

Please see the installation page on the GitLab website.

New versions

Since 2011 a minor or major version of GitLab is released on the 22nd of every month. Patch and security releases come out when needed. New features are detailed on the blog and in the changelog. For more information about the release process see the release documentation. Features that will likely be in the next releases can be found on the feature request forum with the status started and completed.

Upgrading

For updating the the Omnibus installation please see the update documentation. For manual installations there is an upgrader script and there are upgrade guides.

Run in production mode

The Installation guide contains instructions on how to download an init script and run it automatically on boot. You can also start the init script manually:

sudo service gitlab start

or by directly calling the script:

 sudo /etc/init.d/gitlab start

Please login with root / 5iveL!fe

Install a development environment

We recommend setting up your development environment with the GitLab Development Kit. If you do not use the development kit you might need to copy the example development unicorn configuration file

cp config/unicorn.rb.example.development config/unicorn.rb

Run in development mode

Start it with Foreman

bundle exec foreman start -p 3000

or start each component separately:

bundle exec rails s
bin/background_jobs start

And surf to localhost:3000 and login with root / 5iveL!fe.

Run the tests

  • Run all tests:

    bundle exec rake test
    
  • RSpec unit and functional tests.

    All RSpec tests: bundle exec rake spec

    Single RSpec file: bundle exec rspec spec/controllers/commit_controller_spec.rb

  • Spinach integration tests.

    All Spinach tests: bundle exec rake spinach

    Single Spinach test: bundle exec spinach features/project/issues/milestones.feature

Documentation

All documentation can be found on doc.gitlab.com/ce/.

Getting help

Please see Getting help for GitLab on our website for the many options to get help.

Is it any good?

Yes

Is it awesome?

Thanks for asking this question Joshua. These people seem to like it.

S
Description
No description provided
Readme MIT
170 MiB
Languages
Ruby 75.2%
Haml 10.4%
CoffeeScript 6.1%
SCSS 4.7%
Gherkin 2.4%
Other 1.2%