Commit Graph

9 Commits

Author SHA1 Message Date
Gabriel Mazetto d391dfb4ac Refactored AfterRenameService to reduce coupling
We still rely on the Dirty API for project rename (before/after) values,
but we don't access the dirty api from the service class anymore.

The previous value is now part of the initialization, which makes it
easier to test and the behavior is clearer.

The same was done with the `rename_repo` on the Storage classes, we now
provide before and after values as part of the method signature.
2019-01-22 13:55:18 +01:00
Stan Hu e96fd232a6 Remove unnecessary includes of ShellAdapter
Determined by running the script:

```
included = `git grep --name-only ShellAdapter`.chomp.split("\n")
used = `git grep --name-only gitlab_shell`.chomp.split("\n")
included - used
```
2018-12-05 23:19:27 -08:00
Jan Provaznik 0fc9f9d3e7 Add version 4.2 to all existing migrations
DB schema generated by a migration may look different in
rails 4 and 5 (because rails 5 may use different default values).
For this reason it's important to explicitly set for which rails
version a migration was written for.

See https://stackoverflow.com/questions/35929869/activerecordmigration-deprecation-warning-asks-for-rails-version-but-im-no/35930912#35930912
2018-11-22 13:18:28 +01:00
Yorick Peterse 4b9c17f196
Move Project#rename_repo to a service class
This moves the logic of Project#rename_repo and all methods _only_ used
by this method into a new service class: Projects::AfterRenameService.
By moving this code into a separate service class we can more easily
refactor it, and we also get rid of some RuboCop "disable" statements
automatically.

During the refactoring of this code, I removed most of the explicit
logging using Gitlab::AppLogger. The data that was logged would not be
useful when debugging renaming issues, as it does not add any value on
top of data provided by users.

I also removed a variety of comments that either mentioned something the
code does in literal form, or contained various grammatical errors.
Instead we now resort to more clearly named methods, removing the need
for code comments.

This method was chosen based on analysis in
https://gitlab.com/gitlab-org/release/framework/issues/28. In this issue
we determined this method has seen a total of 293 lines being changed in
it. We also noticed that RuboCop determined the ABC size
(https://www.softwarerenovation.com/ABCMetric.pdf) was too great.
2018-10-22 15:12:46 +02:00
Semyon Pupkov 2d0839e542 Fix UnneededRequireStatement cop 2018-09-21 12:37:57 +05:00
Lin Jen-Shin b95da565cd Enable rubocop for db/**/* and ee/db/**/* 2018-07-25 17:47:12 +08:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Dmitriy Zaporozhets ca0d84384d
Improve rename projects migration
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-03-20 18:25:03 +02:00
Dmitriy Zaporozhets cd4db7b417
Reserve few project and nested group paths
That have wildcard routes associated and not reserved yet: artifacts,
graphs, badges and refs

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-03-13 15:47:24 +02:00