Skip to content

Force push only when "manage repository" permission? #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hameno opened this issue Aug 26, 2014 · 58 comments
Closed

Force push only when "manage repository" permission? #264

hameno opened this issue Aug 26, 2014 · 58 comments
Assignees
Milestone

Comments

@hameno
Copy link

hameno commented Aug 26, 2014

Hello,
I just recently upgraded to 0.7.6 and now users can't force push to their feature branches when they don't have the manage repository permission. How can I disable this? We need to be able to force push our rebased feature branches and not every developer should be able to manage the repository.

Please advise

@n-rodriguez n-rodriguez self-assigned this Aug 28, 2014
@n-rodriguez n-rodriguez modified the milestones: v0.8, v0.7.8 Sep 10, 2014
@n-rodriguez
Copy link
Contributor

I just recently upgraded to 0.7.6 and now users can't force push to their feature branches

What do you mean by 'users can't force push to their feature branches' ?

@hameno
Copy link
Author

hameno commented Sep 11, 2014

We are using git Flow. Before merging the feature branch to the develop branch we do code reviews. For that the branch will be pushed to the remote. After the code review they need to rebase their branch onto the latest develop commit. This changes the history and now the local and remote branches differ. They need to do a git push --force to update the remote before using git flow feature finish. They can't force push if they don't have that permission.

@n-rodriguez
Copy link
Contributor

I just recently upgraded to 0.7.6 and now users can't force push to their feature branches when they don't have the manage repository permission

What was the previous version? (before migration)

@hameno
Copy link
Author

hameno commented Sep 19, 2014

I'm not sure, some version of 0.6 I think

@n-rodriguez
Copy link
Contributor

Yes. That's what I thought.

At the time, the plugin only managed 2 types of permissions : RW+ and R.
Now it manages all permissions : RW+, RW and R :

  • RW+ are for managers (or other Redmine role with the manage_repository permission)
  • RW are for developers (or other Redmine role with the commit permission)
  • R are for others (or other Redmine role with the view_changeset permission)

According to Gitolite (http://gitolite.com/gitolite/conf.html#rules) :

  • RW+, to allow pretty much anything -- fast-forward, rewind or delete branches or tags
  • RW, to allow fast-forward push of a branch, or create new branch/tag
  • R, to allow read operations only

@hameno
Copy link
Author

hameno commented Sep 19, 2014

Okay, that's bad. Can you maybe introduce a separate permission for that? We don't want normal developers to be able to edit the repository settings of a project, but they should be able to force push branches. Even better would be, if there would be a possibility to define patterns to allow force push to (everything feature/, hotfix/, release/* but never master and develop).

@n-rodriguez
Copy link
Contributor

Test the v0.8-beta branch. It has the protected branches feature.

@hameno
Copy link
Author

hameno commented Sep 19, 2014

Tried:
rake does not work after installing bundle without development / test:

root@tracker:/opt/redmine/plugins# sr rake redmine:plugins:migrate RAILS_ENV=production
(in /opt/redmine)
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
LoadError: cannot load such file -- ci/reporter/rake/rspec
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/redmine_git_hosting.rake:62:in `block (2 levels) in <top (required)>'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/redmine_git_hosting.rake:61:in `block in <top (required)>'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/redmine_git_hosting.rake:1:in `<top (required)>'
/opt/redmine/lib/tasks/redmine.rake:178:in `block in <top (required)>'
/opt/redmine/lib/tasks/redmine.rake:178:in `each'
/opt/redmine/lib/tasks/redmine.rake:178:in `<top (required)>'
/opt/redmine/Rakefile:7:in `<top (required)>'
(See full trace by running task with --trace)

with test and development gems installed I'm now stuck on:

 Migrating redmine_git_hosting (Redmine Git Hosting Plugin)...
==  CreateRepositoryMirrors: migrating ========================================
-- create_table(:repository_mirrors)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'repository_mirrors' already exists: CREATE TABLE `repository_mirrors` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `project_id` int(11), `active` int(11) DEFAULT 1, `url` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB/opt/redmine/plugins/redmine_git_hosting/db/migrate/20110807000000_create_repository_mirrors.rb:3:in `up'
/opt/redmine/lib/redmine/plugin.rb:452:in `migrate_plugin'
/opt/redmine/lib/redmine/plugin.rb:424:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:438:in `block in migrate'
/opt/redmine/lib/redmine/plugin.rb:437:in `each'
/opt/redmine/lib/redmine/plugin.rb:437:in `migrate'
/opt/redmine/lib/tasks/redmine.rake:126:in `block (3 levels) in <top (required)>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)

@n-rodriguez
Copy link
Contributor

My bad, I should have warned you : https://jbox-web.github.io/redmine_git_hosting/guide/development/

@hameno
Copy link
Author

hameno commented Sep 19, 2014

Ah, okay. Unfortunately:

root@tracker:/opt/redmine/plugins/redmine_git_hosting# RAILS_ENV=production rake redmine_git_hosting:fix_migration_numbers
(in /opt/redmine)
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.

old_name : 2011072600000-redmine_git_hosting
new_name : 20110726000000-redmine_git_hosting
rake aborted!
ActiveRecord::RecordNotUnique: Mysql2::Error: Duplicate entry '20110726000000-redmine_git_hosting' for key 'unique_schema_migrations': INSERT INTO schema_migrations (VERSION) VALUES ('20110726000000-redmine_git_hosting');
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/fix_migration_numbers.rake:24:in `block (3 levels) in <top (required)>'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/fix_migration_numbers.rake:7:in `each'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/fix_migration_numbers.rake:7:in `block (2 levels) in <top (required)>'
Tasks: TOP => redmine_git_hosting:fix_migration_numbers
(See full trace by running task with --trace)

@hameno
Copy link
Author

hameno commented Sep 19, 2014

Second try worked o_O

@n-rodriguez
Copy link
Contributor

Yes. You have to fix it by hand. Basically : go in your database (https://code.google.com/p/sqlyog/wiki/Downloads) and rename the version 20110726000000-redmine_git_hosting to 2011072600000-redmine_git_hosting (be carefull to the missing digit in the last one) in table schema_migrations

@n-rodriguez
Copy link
Contributor

Second try worked o_O

Weird...but why not :)

@hameno
Copy link
Author

hameno commented Sep 19, 2014

And one step further:

root@tracker:/opt/redmine/plugins/redmine_git_hosting# RAILS_ENV=production rake redmine_git_hosting:rename_ssh_keys
(in /opt/redmine)
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.

Delete SSH keys in Gitolite and reset identifier :

  - Delete SSH key redmine_<user>@redmine_1396712869_627936
rake aborted!
NoMethodError: undefined method `config' for nil:NilClass
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper/admin.rb:9:in `initialize'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper.rb:70:in `new'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper.rb:70:in `block in update'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper.rb:68:in `each'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper.rb:68:in `update'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/git_hosting.rb:42:in `resync_gitolite'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/rename_ssh_keys.rake:12:in `block (3 levels) in <top (required)>'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/rename_ssh_keys.rake:10:in `each'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/rename_ssh_keys.rake:10:in `block (2 levels) in <top (required)>'
Tasks: TOP => redmine_git_hosting:rename_ssh_keys
(See full trace by running task with --trace)

@n-rodriguez
Copy link
Contributor

Ok. Wait a minute, I'm working on it :)

@hameno
Copy link
Author

hameno commented Sep 19, 2014

Okay ;)

@n-rodriguez
Copy link
Contributor

Can you do a git pull on the v0.8-beta branch?

@hameno
Copy link
Author

hameno commented Sep 19, 2014

Done:

root@tracker:/opt/redmine/plugins/redmine_git_hosting# RAILS_ENV=production rake redmine_git_hosting:rename_ssh_keys
(in /opt/redmine)
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.

Delete SSH keys in Gitolite and reset identifier :

  - Delete SSH key redmine_<user>@redmine_1396712869_627936
rake aborted!
TypeError: wrong argument type nil (expected String)
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper.rb:43:in `new'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper.rb:43:in `gitolite_admin'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/gitolite_wrapper.rb:64:in `update'
/opt/redmine/plugins/redmine_git_hosting/lib/redmine_gitolite/git_hosting.rb:42:in `resync_gitolite'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/rename_ssh_keys.rake:12:in `block (3 levels) in <top (required)>'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/rename_ssh_keys.rake:10:in `each'
/opt/redmine/plugins/redmine_git_hosting/lib/tasks/rename_ssh_keys.rake:10:in `block (2 levels) in <top (required)>'
Tasks: TOP => redmine_git_hosting:rename_ssh_keys
(See full trace by running task with --trace)

@n-rodriguez
Copy link
Contributor

Be sure you have removed gitlab-grit and jbox-gitolite gems.

@hameno
Copy link
Author

hameno commented Sep 19, 2014

No change :(

@n-rodriguez
Copy link
Contributor

Can you go in Administration -> Redmine Git Hosting -> Config Checks and check that everything is green?

@hameno
Copy link
Author

hameno commented Sep 19, 2014

Unfortunately I'm now getting an error 500:

Started GET "/settings/plugin/redmine_git_hosting" for <ip> at 2014-09-20 01:28:27 +0200
Processing by SettingsController#plugin as HTML
  Parameters: {"id"=>"redmine_git_hosting"}
  Current user: <user> (id=3)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_ssh.html.erb (0.5ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_storage.html.erb (224.0ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_file.html.erb (0.8ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_global.html.erb (1.3ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_access.html.erb (1.4ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_hooks.html.erb (0.8ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_cache.html.erb (0.4ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_notify.html.erb (0.8ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_display_access.html.erb (0.8ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_redmine_config.html.erb (1.8ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_sidekiq_interface.html.erb (0.3ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_gitolite_config_test.html.erb (63.3ms)
  Rendered common/_tabs.html.erb (302.3ms)
  Rendered plugins/redmine_git_hosting/app/views/settings/_redmine_git_hosting.html.erb (305.5ms)
  Rendered plugins/redmine_banner/app/views/settings/plugin.html.erb within layouts/admin (306.7ms)
Completed 500 Internal Server Error in 312.0ms

ActionView::Template::Error (can't convert nil into String):
    30:     <td><%= image_tag (RedmineGitolite::GitoliteWrapper.can_redmine_sudo_to_gitolite_user? ? 'true.png' : 'exclamation.png') %></td>
    31:   </tr>
    32:
    33:   <% gitolite_checks = RedmineGitolite::HookManager.check_install! %>
    34:
    35:   <tr>
    36:     <td><%= l(:label_gitolite_hook_dirs_installed) %></td>
  app/views/common/_tabs.html.erb:22:in `block in _8ab6a5ce477c443474f23f9be84f7a04'
  app/views/common/_tabs.html.erb:21:in `each'
  app/views/common/_tabs.html.erb:21:in `_8ab6a5ce477c443474f23f9be84f7a04'
  app/helpers/application_helper.rb:318:in `render_tabs'

@n-rodriguez
Copy link
Contributor

I know, I got the same :)

@hameno
Copy link
Author

hameno commented Sep 28, 2014

Okay, tested it, looks like it works great :) Now we only need to be able to allow roles / groups to force push to feature-Branches.

@hameno
Copy link
Author

hameno commented Sep 28, 2014

Just noticed that git mirrors settings do not load:

Started GET "/repositories/11/mirrors" for <ip> at 2014-09-28 23:13:19 +0200
Processing by RepositoryMirrorsController#index as */*
  Parameters: {"repository_id"=>"11"}
  Current user: <user> (id=3)
  Rendered plugins/redmine_git_hosting/app/views/repository_mirrors/index.html.erb within layouts/popup (11.2ms)
Completed 500 Internal Server Error in 20.8ms

ActionView::Template::Error (wrong number of arguments (1 for 2)):
    89:     initModalBoxes(modals);
    90:
    91:     var mirror_client = Object();
    92:     mirror_client.movie_path    = '<%= plugin_asset_link('ZeroClipboard.swf') %>';
    93:     mirror_client.label_to_copy = '<%= l(:label_copy_to_clipboard) %>';
    94:     mirror_client.label_copied  = '<%= l(:label_copied_to_clipboard) %>';
    95:     mirror_client.target        = '#mirror_clipboard_button';
  plugins/redmine_git_hosting/app/helpers/git_hosting_helper.rb:80:in `plugin_asset_link'
  plugins/redmine_git_hosting/app/views/repository_mirrors/index.html.erb:92:in `block in _3ba8254a5feedc3fb4a74ad8a1069c2f'
  actionpack (3.2.19) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
  actionpack (3.2.19) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
  haml (4.0.5) lib/haml/helpers/action_view_xss_mods.rb:5:in `with_output_buffer_with_haml_xss'
  actionpack (3.2.19) lib/action_view/helpers/capture_helper.rb:40:in `capture'
  haml (4.0.5) lib/haml/helpers/action_view_mods.rb:52:in `capture_with_haml'
  actionpack (3.2.19) lib/action_view/helpers/javascript_helper.rb:63:in `javascript_tag'
  plugins/redmine_git_hosting/app/views/repository_mirrors/index.html.erb:87:in `_3ba8254a5feedc3fb4a74ad8a1069c2f'
  actionpack (3.2.19) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.19) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.19) lib/action_view/template.rb:143:in `render'
  deface (1.0.0) lib/deface/action_view_extensions.rb:41:in `render'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:18:in `render'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:36:in `render_template'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:17:in `render'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:110:in `_render_template'
  actionpack (3.2.19) lib/action_controller/metal/streaming.rb:225:in `_render_template'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:103:in `render_to_body'
  actionpack (3.2.19) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
  actionpack (3.2.19) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:88:in `render'
  actionpack (3.2.19) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
  activesupport (3.2.19) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
  /usr/local/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
  activesupport (3.2.19) lib/active_support/core_ext/benchmark.rb:5:in `ms'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
  activerecord (3.2.19) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:39:in `render'
  plugins/redmine_git_hosting/app/controllers/repository_mirrors_controller.rb:16:in `block (2 levels) in index'
  actionpack (3.2.19) lib/action_controller/metal/mime_responds.rb:196:in `call'
  actionpack (3.2.19) lib/action_controller/metal/mime_responds.rb:196:in `respond_to'
  plugins/redmine_git_hosting/app/controllers/repository_mirrors_controller.rb:15:in `index'
  actionpack (3.2.19) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.19) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.19) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.19) lib/active_support/callbacks.rb:546:in `_run__1850059272624241459__process_action__1389233535879221522__callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.19) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.19) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.19) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.19) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.19) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.19) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.19) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:608:in `call'
  rack-openid (1.4.2) lib/rack/openid.rb:98:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  plugins/redmine_dmsf/lib/redmine_dmsf/webdav/no_parse.rb:33:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.19) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.19) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.19) lib/active_support/callbacks.rb:405:in `_run__2260406159108675525__call__2121826578682363627__callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.19) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.19) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.19) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.19) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
  rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
  rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.19) lib/rails/engine.rb:484:in `call'
  railties (3.2.19) lib/rails/application.rb:231:in `call'
  railties (3.2.19) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (4.0.48) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
  passenger (4.0.48) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
  passenger (4.0.48) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
  passenger (4.0.48) lib/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'

@hameno
Copy link
Author

hameno commented Oct 19, 2014

Just updated, works again.

@n-rodriguez
Copy link
Contributor

Hi there!
Can I close this issue?

@hameno
Copy link
Author

hameno commented Dec 20, 2014

Not quite, or is "Now we only need to be able to allow roles / groups to force push to feature-Branches." already implemented? :)

@n-rodriguez
Copy link
Contributor

mmm.... Actually I don't know ^^ Have to check.

@hameno
Copy link
Author

hameno commented Dec 20, 2014

Also, it would be great to be able to set default values for new repos so that we can configure it globally and each new repo uses these settings.

@n-rodriguez n-rodriguez modified the milestones: v0.9, v0.7.8 Dec 21, 2014
@tchemineau
Copy link

Hi all,

I read the whole thread, and I would like to know how this feature will work. Here, developers also need to force some push to be able to finish their rebase step.

I tried to implement a Gitolite pre-receive hook to do that :

  • Check if refname is ref/heads/perso/* or ref/heads/feature/*
  • If OK : allow push force on these branches
  • if KO : check if the push send by the user includes all merged revisions

The hook is working well, but then redmine_git_hosting denies the push because the user does not have the RW+ permission (and I don't want to set it !).

I understand that the v0.8-beta version include a feature to protected some branches from push force. But it would be better for me to have an option to allow "push force" on a set of specified branches only (and deny all other branches).

What do you think ?

Any help would be appreciated.

@tchemineau
Copy link

Hi all,

I tried to install the v0.8-beta branch.

My first try return an error which indicates that the task redmine_git_hosting:fix_migration_numbers was not found. After reading again this thread, I checked out the devel branch and installed missing gem.

From the root redmine directory, I then tried again the command :

$ bundle exec rake --trace redmine_git_hosting:fix_migration_numbers RAILS_ENV=production
Your Gemfile lists the gem inifile (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem database_cleaner (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem redcarpet (~> 2.3.0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem shoulda (~> 3.5.0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem database_cleaner (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
rake aborted!
Don't know how to build task 'redmine_git_hosting:fix_migration_numbers'

What are the steps to migrate ot this devel branch ?

Thank you !

@tchemineau
Copy link

OK, I get it. I should use redmine_git_hosting:migration_tools:fix_migration_numbers task.

@tchemineau
Copy link

As said @hameno, this task failed the first time and succeed the second time. However, I verified into the database and all migration numbers have been correctly migrated.

Then, I checked out the v0.8-beta branch, and proceed to the plugin migration and all work has expected. I will see if new functionnalities work as expected.

@tchemineau
Copy link

Hi all,

@n-rodriguez, is your fix 9b13720 on v0.8-branch ?

I have the same error as described by @hameno with a ActionView::Template::Error (can't convert nil into String) error.

@n-rodriguez
Copy link
Contributor

@n-rodriguez, is your fix 9b13720 on v0.8-branch ?

yes

I have the same error as described by @hameno with a ActionView::Template::Error (can't convert nil into String) error.

this might come from other place

By the way, the v0.8 branch has been dropped in favor of v1.0.0-beta.
You should be able to switch to it when it will be released.

@hameno
Copy link
Author

hameno commented Jan 23, 2015

So, I tried to update my beta installation, saw that the branch no longer exists and switched to v1.0.0-beta. But now I cannot edit any repository, it just shows the standard settings but no settings from this plugin. I also tried the latest devel branch but it did not change anything.

My installation:

Environment:
Redmine version 2.6.1.stable
Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux]
Rails version 3.2.21
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.17
Mercurial 2.2.2
Git 1.7.10.4
Filesystem
Xitolite 1.7.10.4
Redmine plugins:
redmine_bootstrap_kit 0.1
redmine_git_hosting 0.8-devel

@hameno
Copy link
Author

hameno commented Jan 23, 2015

Ahhh, I just notices that there is now a "Xitolite" Repository-Type. Just created a new Repository with that and there are the settings. Did I forget a migration task?

@n-rodriguez
Copy link
Contributor

Did I forget a migration task?

Nope, it's my fault, I didn't write it yet... But it should be simple : if you can connect to Redmine database update the repositories table and change the type field to Repository::Xitolite for all your Gitolite repositories.

@hameno
Copy link
Author

hameno commented Jan 23, 2015

Yep, worked. Looks good now.

@n-rodriguez
Copy link
Contributor

Great! You can take a look at the changelog There might be other interesting features for you.

@hameno
Copy link
Author

hameno commented Jan 23, 2015

Ahh so a release date is already planned, thats nice ;)

Really great work! 👍

@hameno
Copy link
Author

hameno commented Jan 26, 2015

Great, now all we need is #264 (comment)

@n-rodriguez
Copy link
Contributor

The regression has been fixed by the Protected branch feature.
But this one needs to be improved. To be continued here : #389

@n-rodriguez n-rodriguez modified the milestones: v1.1.0, v1.0.0 Mar 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants