{"action":"created","issue":{"url":"https://api.github.com/repos/opf/openproject/issues/3196","labels_url":"https://api.github.com/repos/opf/openproject/issues/3196/labels{/name}","comments_url":"https://api.github.com/repos/opf/openproject/issues/3196/comments","events_url":"https://api.github.com/repos/opf/openproject/issues/3196/events","html_url":"https://github.com/opf/openproject/pull/3196","id":91841010,"number":3196,"title":"Repository Management","user":{"login":"oliverguenther","id":459462,"avatar_url":"https://avatars.githubusercontent.com/u/459462?v=3","gravatar_id":"","url":"https://api.github.com/users/oliverguenther","html_url":"https://github.com/oliverguenther","followers_url":"https://api.github.com/users/oliverguenther/followers","following_url":"https://api.github.com/users/oliverguenther/following{/other_user}","gists_url":"https://api.github.com/users/oliverguenther/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverguenther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverguenther/subscriptions","organizations_url":"https://api.github.com/users/oliverguenther/orgs","repos_url":"https://api.github.com/users/oliverguenther/repos","events_url":"https://api.github.com/users/oliverguenther/events{/privacy}","received_events_url":"https://api.github.com/users/oliverguenther/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opf/openproject/labels/feature","name":"feature","color":"fbca04"},{"url":"https://api.github.com/repos/opf/openproject/labels/work%20in%20progress","name":"work in progress","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"oliverguenther","id":459462,"avatar_url":"https://avatars.githubusercontent.com/u/459462?v=3","gravatar_id":"","url":"https://api.github.com/users/oliverguenther","html_url":"https://github.com/oliverguenther","followers_url":"https://api.github.com/users/oliverguenther/followers","following_url":"https://api.github.com/users/oliverguenther/following{/other_user}","gists_url":"https://api.github.com/users/oliverguenther/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverguenther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverguenther/subscriptions","organizations_url":"https://api.github.com/users/oliverguenther/orgs","repos_url":"https://api.github.com/users/oliverguenther/repos","events_url":"https://api.github.com/users/oliverguenther/events{/privacy}","received_events_url":"https://api.github.com/users/oliverguenther/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/opf/openproject/milestones/3","html_url":"https://github.com/opf/openproject/milestones/4.3","labels_url":"https://api.github.com/repos/opf/openproject/milestones/3/labels","id":1104474,"number":3,"title":"4.3","description":"","creator":{"login":"myabc","id":755,"avatar_url":"https://avatars.githubusercontent.com/u/755?v=3","gravatar_id":"","url":"https://api.github.com/users/myabc","html_url":"https://github.com/myabc","followers_url":"https://api.github.com/users/myabc/followers","following_url":"https://api.github.com/users/myabc/following{/other_user}","gists_url":"https://api.github.com/users/myabc/gists{/gist_id}","starred_url":"https://api.github.com/users/myabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myabc/subscriptions","organizations_url":"https://api.github.com/users/myabc/orgs","repos_url":"https://api.github.com/users/myabc/repos","events_url":"https://api.github.com/users/myabc/events{/privacy}","received_events_url":"https://api.github.com/users/myabc/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":6,"state":"open","created_at":"2015-05-11T10:04:28Z","updated_at":"2015-07-17T15:28:56Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-06-29T15:46:05Z","updated_at":"2015-07-22T08:30:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/3196","html_url":"https://github.com/opf/openproject/pull/3196","diff_url":"https://github.com/opf/openproject/pull/3196.diff","patch_url":"https://github.com/opf/openproject/pull/3196.patch"},"body":"This PR begins the push towards management of repository lifetime\r\nfrom within OpenProject.\r\n\r\nWhat this currently provides is the following:\r\n\r\n  - A mixin `ManageableRepository`, included by `Repository::{Git,\r\n      Subversion}` to provide an interface to repo management\r\n  - Two services and delayed_job workers for creating (`CreateManagedRepositoryService`) and\r\n  deleting (`DeleteRepositoryService`)\r\n  - Customized rendering of subforms in the repository settings for\r\n  arbitrary SCM vendors.\r\n\r\n  - [x] Provide sane ground to work on ( cf. state of [now closed] PR #3149 )\r\n  - [x] Rework SCM settings form (`{scm}_tags` is currently HTML generated\r\n        from within a Helper.)\r\n  - [x] Ease integration of arbitrary SCM vendors\r\n  - [x] Display meaningful error / warning when user looks at bare\r\n  repository (currently outputs 500, as Git HEAD / svn revision is not\r\n          available)\r\n  - [x] I18n\r\n  - [x] Specs\r\n    - [x] Fix legacy specs\r\n  - [X] Decide what to do with `Filesystem` adapter ~~[Will be removed in subsequent PR](https://github.com/oliverguenther/openproject/compare/feature/remove_filesystem_adapter...oliverguenther:feature/repository_management)~~ Merged into this PR due to the errors that would occur when using existing Filesystem repositories on these features.\r\n\r\n### Review remarks\r\n\r\n- Manged repositories are not enabled by default. The following section in configuration.yml currently controls the management.\r\n``` yaml\r\n  scm:\r\n    Git:\r\n      # Use command below to override the default git command taken from path.\r\n      # client_command: /usr/local/bin/git\r\n      manages: /tmp/git\r\n    Subversion:\r\n      manages: /tmp/svn\r\n      # Use command below to override the default svn command taken from path.\r\n      # client_command: /usr/local/bin/svn\r\n```\r\n- Creation / Deletion of managed repositories is asynchronous. Don't forget to start a delayed_job worker.\r\n- Rubocop complains about several complexity issues in the (git) adapter. I deem this refactoring to be necessary, but out of scope for this PR. I suggest we instead move to Libgit2/rugged for reading a Git repository instead, which [would also solve remote repository retrieval](https://community.openproject.org/work_packages/20422)\r\n- Hound still has some remaining remarks on other files which are either outdated or which I didn't really touch during this PR.\r\n- Use the following bookmarklet to toggle outdated hounds:\r\n```\r\njavascript:(function()%7B%24('.outdated-diff-comment-container').has('img%5Balt%3D\"%40houndci\"%5D').toggle()%7D)()\r\n```\r\n### Open Questions:\r\n\r\n  - **Configuration**: Currently replaces the existing options in\r\n  `configuration.yml`.\r\n  - **Implementation specifics**:\r\n    - Sub-projects repositories reside in a hierarchy below their parents\r\n    - How should the delayed_job react upon failure? (esp. creation of\r\n            repositories)\r\n\r\nRelevant work package: https://community.openproject.org/work_packages/20416"},"comment":{"url":"https://api.github.com/repos/opf/openproject/issues/comments/123615230","html_url":"https://github.com/opf/openproject/pull/3196#issuecomment-123615230","issue_url":"https://api.github.com/repos/opf/openproject/issues/3196","id":123615230,"user":{"login":"ulferts","id":617519,"avatar_url":"https://avatars.githubusercontent.com/u/617519?v=3","gravatar_id":"","url":"https://api.github.com/users/ulferts","html_url":"https://github.com/ulferts","followers_url":"https://api.github.com/users/ulferts/followers","following_url":"https://api.github.com/users/ulferts/following{/other_user}","gists_url":"https://api.github.com/users/ulferts/gists{/gist_id}","starred_url":"https://api.github.com/users/ulferts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulferts/subscriptions","organizations_url":"https://api.github.com/users/ulferts/orgs","repos_url":"https://api.github.com/users/ulferts/repos","events_url":"https://api.github.com/users/ulferts/events{/privacy}","received_events_url":"https://api.github.com/users/ulferts/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T08:30:22Z","updated_at":"2015-07-22T08:30:22Z","body":"When I try to use use the code I get a couple of errors which seem to be related.\r\n\r\n* Upon creation:\r\n```\r\nNoMethodError (undefined method `scm_type=' for #<Repository::Subversion:0x007ff282fbf6b8>):\r\n  app/models/repository.rb:288:in `build'\r\n  app/services/scm/repository_factory_service.rb:77:in `build_with_type'\r\n  app/services/scm/repository_factory_service.rb:60:in `block in build_temporary'\r\n  app/services/scm/repository_factory_service.rb:86:in `build_guarded'\r\n  app/services/scm/repository_factory_service.rb:59:in `build_temporary'\r\n  app/controllers/repositories_controller.rb:57:in `edit'\r\n  app/middleware/params_parser_with_exclusion.rb:40:in `call'\r\n```\r\n\r\n* Calling project settings with an existing scm (Subversion)\r\n```\r\nActionView::Template::Error (undefined method `scm_type' for #<Repository::Subversion:0x007ff263bb1928>):\r\n    39: <% else %>\r\n    40:   <%= render partial: \"/repositories/settings/vendor_attribute_groups\",\r\n    41:              locals: { existing: true, alone: true, vendor: repository.vendor.underscore,\r\n    42:                        type: repository.scm_type,\r\n    43:                        form: form, repository: repository } %>\r\n    44: <% end %>\r\n  app/views/repositories/settings/_vendor_form.html.erb:42:in `_app_views_repositories_settings__vendor_form_html_erb___3036419288644176347_70339732912420'\r\n  app/views/repositories/_settings.html.erb:48:in `block in _app_views_repositories__settings_html_erb___684265239055021837_70339733184160'\r\n  app/views/repositories/_settings.html.erb:31:in `_app_views_repositories__settings_html_erb___684265239055021837_70339733184160'\r\n  app/views/common/_tabs.html.erb:60:in `block in _app_views_common__tabs_html_erb__2434448662004139958_70339524095440'\r\n  app/views/common/_tabs.html.erb:58:in `each'\r\n  app/views/common/_tabs.html.erb:58:in `_app_views_common__tabs_html_erb__2434448662004139958_70339524095440'\r\n  app/helpers/application_helper.rb:214:in `render_tabs'\r\n  app/views/projects/settings.html.erb:49:in `_app_views_projects_settings_html_erb__1062259285172986050_70339757250020'\r\n  app/middleware/params_parser_with_exclusion.rb:40:in `call'\r\n```\r\n\r\nAs this PR is quite huge and as such hard to understand I fear I am dependent on trying it out to understand it in depth. I will therefor stop reviewing until this is fixed."}}