Commit Graph

30 Commits

Author SHA1 Message Date
Jacob Vosmaer 008a6a6ce6 Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
Bob Van Landuyt 0618487906 Forking a project to a namespace with lower visibility.
In this case the project will get the minimum between both
visibilities.

If that visibility is restricted, then a lower level will be picked.
2017-12-29 11:15:26 +01: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
Bob Van Landuyt e8ca579d88 Add a project forks spec helper
The helper creates a fork of a project with all provided attributes,
but skipping the creation of the repository on disk.
2017-10-07 11:46:23 +02:00
Bob Van Landuyt d328007214 Create a fork network when forking a project
When no fork network exists for the source projects, we create a new
one with the correct source
2017-10-07 11:46:23 +02:00
Jacob Vosmaer e5fecc3a37 Create repositories via Gitaly 2017-09-29 18:27:06 +02:00
Gabriel Mazetto 8f178c4222 Prevent new / renamed project from using a repository path that already exists on disk
There are some redundancies in the validation steps, and that is to
preserve current error messages behavior

Also few specs have to be changed in order to fix madness in validation
logic.
2017-08-25 20:06:06 +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
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Lin Jen-Shin bf6961cad8 Just let the user to create the namespace 2017-06-06 23:39:22 +08:00
Robert Speicher ca9a79f620 Use `:empty_project` where possible in service specs 2017-03-27 20:44:09 -04:00
Robert Speicher def164e761 Fix RSpec/DescribeSymbol cop violations 2017-03-24 19:04:03 -04:00
Jacob Vosmaer ec273b8d06 Copy, don't move uploaded avatar files 2017-01-03 15:37:32 +01:00
Nick Thomas 3ed80a0176 Enforce the fork_project permission in Projects::CreateService
Projects::ForkService delegates to this service almost entirely, but needed
one small change so it would propagate create errors correctly.

CreateService#execute needs significant refactoring; it is now right at the
complexity limit set by Rubocop. I avoided doing so in this commit to keep the
diff as small as possible.

Several tests depend on the insecure behaviour of ForkService, so fi them up at
the same time.
2016-09-27 13:17:56 +01:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Felipe Artur 5273335247 Fix forks creation when visibility level is restricted 2016-05-25 10:57:00 -04:00
Douwe Maan a2cfb44157 Tag service specs 2015-12-09 11:55:49 +01:00
Douwe Maan d0ec28827d Fix specs 2015-11-18 12:02:09 +01: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
Dmitriy Zaporozhets 3515cb9b2d
Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-02 11:02:05 +02:00
Dmitriy Zaporozhets 37e9e71ea1
Remove unnecessary fork ci logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-02 10:26:56 +02:00
Valery Sizov a0c1a12dee remove API calls from CE to CI 2015-09-18 18:02:11 +02:00
Stan Hu 9995f0806b Import forked repositories asynchronously to prevent large repositories from timing out
Use import_status to track async import status and give feedback to the user

Closes #2388
Closes #2400
2015-09-11 00:34:04 -07:00
Stan Hu 3e9b612306 Check that project was actually created rather than just validated in import:repos task
Add gitlab-shell to error message to give user a clue that something may be wrong there.

Ran into this in #2082. User was told that repositories were created when they were
not due to hooks symlink being wrong.
2015-07-29 10:49:13 -07:00
Stan Hu 359ed48638 Fix Style/AlignHash cop violations 2015-06-22 22:24:39 -07:00
Douwe Maan 0cf76a0b70 Use Projects::CreateService to fork projects so that after-create hooks are run. 2015-04-24 22:58:27 +02:00
Valery Sizov bafec400f1 CI forking: tests 2015-04-06 19:45:16 +03: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
Bernhard Kaindl c44764f523 Prepare ForkService to support forking projects to given namespaces
Remove overload of BaseService.initialize, so initialize gains params,
which is used to pass the namespace (like e.g. in TransferService).

The namespace is checked for permission to create projects in it.
2014-10-03 11:52:29 +02:00
Dmitriy Zaporozhets 2e497d8438
Prevent project stars duplication when fork project
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-25 12:19:52 +03:00