Giter Club home page Giter Club logo

redmine_github_hook's Introduction

Redmine GitHub Hook

Maintainers Wanted

This plugin allows you to update your local Git repositories in Redmine when changes have been pushed to GitHub.

Project Status: Looking for maintainers

This project is not under active development, although I will continue to provide support for current users, but you can change that by joining the team.

If you use this project and would like to develop it further, please introduce yourself on the maintainers wanted ticket.

Description

Redmine has supported Git repositories for a long time, allowing you to browse your code and view your changesets directly in Redmine. For this purpose, Redmine relies on local clones of the Git repositories.

If your shared repository is on a remote machine - for example on GitHub - this unfortunately means a bit of legwork to keep the local, Redmine-accessible repository up-to-date. The common approach is to set up a cronjob that pulls in any changes with regular intervals and updates Redmine with them.

That approach works perfectly fine, but is a bit heavy-handed and cumbersome. The Redmine GitHub Hook plugin allows GitHub to notify your Redmine installation when changes have been pushed to a repository, triggering an update of your local repository and Redmine data only when it is actually necessary.

Getting started

1. Install the plugin

  1. Add the gem to your Gemfile.local: gem "redmine_github_hook"
  2. bundle
  3. Run migrations: bundle exec rake redmine:plugins:migrate RAILS_ENV=production
  4. Restart your Redmine

2. Add the repository to Redmine

Adding a Git repository to a project (note, this should work whether you want to use Redmine GitHub Hook or not).

  1. Simply follow the instructions for keeping your git repository in sync.
  • You don't need to set up a cron task as described in the Redmine instructions.

3. Connecting GitHub to Redmine

  1. Go to the repository Settings interface on GitHub.
  2. Under "Webhooks & Services" add a new "WebHook". The "Payload URL" needs to be of the format: [redmine_url]/github_hook (for example http://redmine.example.com/github_hook).
    • By default, GitHub Hook assumes your GitHub repository name is the same as the project identifier in your Redmine installation.
      • If this is not the case, you can specify the actual Redmine project identifier in the Post-Receive URL by using the format [redmine_url]/github_hook?project_id=[identifier] (for example http://redmine.example.com/github_hook?project_id=my_project).
      • GitHub Hook will then update all repositories in the specified project. Be aware, that this process may take a while if you have many repositories in your project.
      • If you want GitHub Hook to only update the current repository you can specify it with an additional parameter in the Post-Receive URL by using the format [redmine_url]/github_hook?project_id=[identifier]&repository_id=[repository] (for example http://redmine.example.com/github_hook?project_id=my_project&repository_id=my_repo).
    • In most cases, just having the "push" event trigger the webhook should suffice, but you are free to customize the events as you desire.
    • Note: Make sure you're adding a Webhook - which is what Redmine Github Hook expects. GitHub has some builtin Redmine integration; that's not what you're looking for.

That's it. GitHub will now send a HTTP POST to the Redmine GitHub Hook plugin whenever changes are pushed to GitHub. The plugin then takes care of pulling the changes to the local repositories and updating the Redmine database with them.

Assumptions

  • Redmine running on a *nix-like system. Redmine versions before 2.0 should use the redmine_1.x branch. This gem has been reported to work with Redmine version 5.x, 4.x, 3.x., 2.x.
  • Git 1.5 or higher available on the commandline.

Troubleshooting

Check your logfile

If you run into issues, your Redmine logfile might have some valuable information. Two things to check for:

  1. Do POST requests to /github_hook show up in the logfile at all? If so, what's the resulting status code?
  2. If the git command used to pull in changes fails for whatever reason, there should also be some details about the failure in the logfile.

The logfile is usually found in your Redmine directory in log/production.log although your webserver logs may contain some additional clues.

Permissions problems

As for permissions, whatever user Redmine is running as needs permissions to do the following things:

  • Read from the remote repository on GitHub
  • Read and write to the local repository on the Redmine server

What user you are running Redmine as depends on your system and how you've setup your Redmine installation.

GitHub

This means you need to add its SSH keys on GitHub. If the user doesn't already have an SSH key, generate one and add the public SSH key as a Deploy Key for the repository on GitHub (or as one of your own keys, if you prefer that).

Local repository

The user running Redmine needs permissions to read and write to the local repository on the server.

What happens

The interactions between the different parts of the process is outlined in the following sequence diagram:

sequenceDiagram
    participant Dev as Development Machine
    participant GH as GitHub
    participant Rm as Redmine
    Dev->>GH: git push
    GH->>Rm: POST /github_hook
    Rm->>GH: git fetch
    GH-->>Rm: commits
    Rm->>Rm: Update repository

License

Distributed under the MIT License. See LICENSE for more information.

redmine_github_hook's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redmine_github_hook's Issues

NoMethodError

Started POST "/github_hook" for 192.30.252.41 at 2014-03-29 05:18:49 +0100
Processing by GithubHookController#index as */*
  Parameters: {"ref"=>"refs/heads/master", "after"=>"5e89b295ab30da9c41bb33e75ced213f54044e13", "before"=>"4a99e21ba44298c2deb98f099cd9db588c0fdad5", "created"=>false, "deleted"=>false, "forced"=>false, "compare"=>"https://github.com/agaida/wiggle/compare/4a99e21ba442...5e89b295ab30", "commits"=>[{"id"=>"5e89b295ab30da9c41bb33e75ced213f54044e13", "distinct"=>true, "message"=>"refs #86\nab dafür", "timestamp"=>"2014-03-29T05:17:30+01:00", "url"=>"https://github.com/agaida/wiggle/commit/5e89b295ab30da9c41bb33e75ced213f54044e13", "author"=>{"name"=>"Alf Gaida", "email"=>"[email protected]", "username"=>"agaida"}, "committer"=>{"name"=>"Alf Gaida", "email"=>"[email protected]", "username"=>"agaida"}, "added"=>["willi"], "removed"=>nil, "modified"=>nil}], "head_commit"=>{"id"=>"5e89b295ab30da9c41bb33e75ced213f54044e13", "distinct"=>true, "message"=>"refs #86\nab dafür", "timestamp"=>"2014-03-29T05:17:30+01:00", "url"=>"https://github.com/agaida/wiggle/commit/5e89b295ab30da9c41bb33e75ced213f54044e13", "author"=>{"name"=>"Alf Gaida", "email"=>"[email protected]", "username"=>"agaida"}, "committer"=>{"name"=>"Alf Gaida", "email"=>"[email protected]", "username"=>"agaida"}, "added"=>["willi"], "removed"=>nil, "modified"=>nil}, "repository"=>{"id"=>7759286, "name"=>"wiggle", "url"=>"https://github.com/agaida/wiggle", "description"=>"debian-packaging for wiggle 0.9", "watchers"=>0, "stargazers"=>0, "forks"=>0, "fork"=>false, "size"=>140, "owner"=>{"name"=>"agaida", "email"=>"[email protected]"}, "private"=>false, "open_issues"=>0, "has_issues"=>true, "has_downloads"=>true, "has_wiki"=>true, "language"=>"Shell", "created_at"=>1358882458, "pushed_at"=>1396066705, "master_branch"=>"master"}, "pusher"=>{"name"=>"agaida", "email"=>"[email protected]"}}
  Current user: anonymous
Completed 500 Internal Server Error in 652.5ms

NoMethodError (undefined method `[]' for nil:NilClass):
  plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:72:in `get_identifier'
  plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:79:in `find_project'
  plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:87:in `find_repositories'
  plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:10:in `index'
  actionpack (3.2.17) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.17) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.17) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.17) lib/active_support/callbacks.rb:447:in `_run__463273825576433750__process_action__3249720540850747292__callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.17) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.17) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.17) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.17) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.17) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.17) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.17) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.17) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'

Seems to work so far - but after a few hours i have no plan, what goes wrong. If additional infos needed - please tell me, which.

System:

Redmine 2.5.0.stable
Default administrator account changed   True
Attachments directory writable  True
Plugin assets directory writable    True
RMagick available (optional)    True
ImageMagick convert available (optional)    True

Environment:
  Redmine version                2.5.0.stable
  Ruby version                   1.9.3-p194 (2012-04-20) [x86_64-linux]
  Rails version                  3.2.17
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.6.17
  Cvs                            1.12.13
  Git                            1.7.10.4
  Filesystem                     
Redmine plugins:
  redmine_github_hook            0.2.0

Compatibility with 2.1.x?

Hi,

I've followed the steps described in the README but when trying the hooks in google, i get the following error in the production log.

Started POST "/github_hook?project_id=monaqasat" for 108.171.174.178 at 2012-11-19 11:17:55 +0000

ActionController::RoutingError (uninitialized constant GithubHookController):
  activesupport (3.2.8) lib/active_support/inflector/methods.rb:230:in `block in constantize'
  activesupport (3.2.8) lib/active_support/inflector/methods.rb:229:in `each'
  activesupport (3.2.8) lib/active_support/inflector/methods.rb:229:in `constantize'
  actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:69:in `controller_reference'
  actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:54:in `controller'
  actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:32: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.8) lib/action_dispatch/routing/route_set.rb:600:in `call'
  rack-openid (1.3.1) lib/rack/openid.rb:98:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.1) lib/rack/etag.rb:23:in `call'
  rack (1.4.1) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
  rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in `call'
  activerecord (3.2.8) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__4067862905208126349__call__2867047889180174774__callbacks'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
  rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
  rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.8) lib/rails/engine.rb:479:in `call'
  railties (3.2.8) lib/rails/application.rb:223:in `call'
  railties (3.2.8) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (3.0.17) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  passenger (3.0.17) lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
  passenger (3.0.17) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  passenger (3.0.17) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
  passenger (3.0.17) lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
  passenger (3.0.17) lib/phusion_passenger/utils.rb:470:in `safe_fork'
  passenger (3.0.17) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
  passenger (3.0.17) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.17) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.17) lib/phusion_passenger/abstract_server.rb:180:in `start'
  passenger (3.0.17) lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
  passenger (3.0.17) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
  passenger (3.0.17) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  passenger (3.0.17) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
  passenger (3.0.17) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
  <internal:prelude>:10:in `synchronize'
  passenger (3.0.17) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (3.0.17) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
  passenger (3.0.17) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
  passenger (3.0.17) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  passenger (3.0.17) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.17) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.17) helper-scripts/passenger-spawn-server:99:in `<main>'

Any ideas?

Thx.

.Karim

NoMethodError (undefined method `downcase' for 1:Fixnum)

tail -f /var/log/apache2/error.log
App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:51:in call' App 14591 stderr: railties (3.2.19) lib/rails/engine.rb:484:incall'
App 14591 stderr: railties (3.2.19) lib/rails/application.rb:231:in call' App 14591 stderr: railties (3.2.19) lib/rails/railtie/configurable.rb:30:inmethod_missing'
App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in process_request' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:141:inaccept_and_process_next_request'
App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:109:in main_loop' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler.rb:455:inblock (3 levels) in start_threads'
App 14591 stderr:
App 14591 stderr:

App 14591 stderr:
App 14591 stderr: NoMethodError (undefined method downcase' for 1:Fixnum): App 14591 stderr: plugins/redmine_github_hook/app/services/github_hook/updater.rb:77:infind_project'
App 14591 stderr: plugins/redmine_github_hook/app/services/github_hook/updater.rb:84:in find_repositories' App 14591 stderr: plugins/redmine_github_hook/app/services/github_hook/updater.rb:13:incall'
App 14591 stderr: plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:11:in index' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/implicit_render.rb:4:insend_action'
App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/base.rb:167:in process_action' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/rendering.rb:10:inprocess_action'
App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/callbacks.rb:18:in block in process_action' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:447:in_run__18679478662002799__process_action__1330827819000691208__callbacks'
App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:405:in __run_callback' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:385:in_run_process_action_callbacks'
App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:81:in run_callbacks' App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/callbacks.rb:17:inprocess_action'
App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/rescue.rb:29:in process_action' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:30:inblock in process_action'
App 14591 stderr: activesupport (3.2.19) lib/active_support/notifications.rb:123:in block in instrument' App 14591 stderr: activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:ininstrument'
App 14591 stderr: activesupport (3.2.19) lib/active_support/notifications.rb:123:in instrument' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:29:inprocess_action'
App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/params_wrapper.rb:207:in process_action' App 14591 stderr: activerecord (3.2.19) lib/active_record/railties/controller_runtime.rb:18:inprocess_action'
App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/base.rb:121:in process' App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/rendering.rb:45:inprocess'
App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal.rb:203:in dispatch' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/rack_delegation.rb:14:indispatch'
App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal.rb:246:in block in action' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:73:incall'
App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:73:in dispatch' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:36:incall'
App 14591 stderr: journey (1.0.4) lib/journey/router.rb:68:in block in call' App 14591 stderr: journey (1.0.4) lib/journey/router.rb:56:ineach'
App 14591 stderr: journey (1.0.4) lib/journey/router.rb:56:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:608:incall'
App 14591 stderr: rack-openid (1.4.2) lib/rack/openid.rb:98:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
App 14591 stderr: rack (1.4.5) lib/rack/etag.rb:23:in call' App 14591 stderr: rack (1.4.5) lib/rack/conditionalget.rb:35:incall'
App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/head.rb:14:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/params_parser.rb:21:incall'
App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/flash.rb:242:in call' App 14591 stderr: rack (1.4.5) lib/rack/session/abstract/id.rb:210:incontext'
App 14591 stderr: rack (1.4.5) lib/rack/session/abstract/id.rb:205:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/cookies.rb:341:incall'
App 14591 stderr: activerecord (3.2.19) lib/active_record/query_cache.rb:64:in call' App 14591 stderr: activerecord (3.2.19) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall'
App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:28:in block in call' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:405:in_run__590154791167750232__call__2014811694302225741__callbacks'
App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:405:in __run_callback' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:385:in_run_call_callbacks'
App 14591 stderr: activesupport (3.2.19) lib/active_support/call
App 14591 stderr: backs.rb:81:in run_callbacks' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:27:incall'
App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/remote_ip.rb:31:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall'
App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in call' App 14591 stderr: railties (3.2.19) lib/rails/rack/logger.rb:32:incall_app'
App 14591 stderr: railties (3.2.19) lib/rails/rack/logger.rb:16:in block in call' App 14591 stderr: activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:intagged'
App 14591 stderr: railties (3.2.19) lib/rails/rack/logger.rb:16:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:incall'
App 14591 stderr: rack (1.4.5) lib/rack/methodoverride.rb:21:in call' App 14591 stderr: rack (1.4.5) lib/rack/runtime.rb:17:incall'
App 14591 stderr: activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in call' App 14591 stderr: rack (1.4.5) lib/rack/lock.rb:15:incall'
App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in call' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:136:inforward'
App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:143:in pass' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:155:ininvalidate'
App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:71:in call!' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:51:incall'
App 14591 stderr: railties (3.2.19) lib/rails/engine.rb:484:in call' App 14591 stderr: railties (3.2.19) lib/rails/application.rb:231:incall'
App 14591 stderr: railties (3.2.19) lib/rails/railtie/configurable.rb:30:in method_missing' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/rack/thread_handler_extension.rb:74:inprocess_request'
App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:141:in accept_and_process_next_request' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:109:inmain_loop'
App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
App 14591 stderr:
App 14591 stderr:

Environment:
Redmine version 2.5.2.stable.13435
Ruby version 2.0.0-p576 (2014-09-19) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.17
Git 1.7.10.4
Filesystem
Redmine plugins:
redmine_github_hook 2.1.0

Allow passing the project name on URL

It would be great if it would be possible to pass the name of the Redmine project as part of the hook URL. I named my Redmine project slightly differently and found that I cannot use the hook now.
Will eventually look into it myself and create a pull request :)

is payload['repository']['name'] evaluated?

Hi, I installed this gem to our development redmine (ver. 2.4.1)
I want to use gitlab hook by using this plugin.

So, I got a problem.
When I tried to hook from gitlab 'https:///redmine/github_hook',
redmine's production log put error message below.

  Parameters: {"before"=>"xxxxxxxxxxxxxxxxxxxxx", "after"=>"xxxxxxxxxxxxxxxxxxxxxx", "ref"=>"refs/heads/master", "user_id"=>2, "user_name"=>"xxxxx", "project_id"=>83, "repository"=>{"name"=>"our project", "url"=>"[email protected]:ourgroup/ourproject.git", "description"=>"", ,,,,,,,


Completed 500 Internal Server Error in 358.2ms

NoMethodError (undefined method `downcase' for 83:Fixnum):
  redmine_github_hook (2.1.0) app/services/github_hook/updater.rb:77:in `find_project'

I saw update.rb and wonder why 'project_id' is used by downcase method.

    # Finds the Redmine project in the database based on the given project identifier
    def find_project
      identifier = get_identifier
      project = Project.find_by_identifier(identifier.downcase)
      raise ActiveRecord::RecordNotFound, "No project found with identifier '#{identifier}'" if project.nil?
      return project
    end

And I found get_project_name method's payload is not evaluated by this hook...

    def get_project_name
      params[:project_id] || (payload['repository'] ? payload['repository']['name'] : nil)
    end

Is their any solutions?
If you know, please let me know.

json requires ruby1.8-dev

Hi,

Ran into an issue with Ubuntu 10.04 LTS. Couldn't install gem json without getting error " /usr/bin/ruby1.8 extconf.rb extconf.rb:1:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:1" .

After installing apt-get install ruby1.8-dev, the gem install worked.

Issue fetching changes for branch

Hi, I am using latest head for with Redmine 2.0.3

I set-up two bare repositories on the disk and linked to Redmine project.
When pushing to github, hook (/github_hook?project_id=PROJECT) is called, but the problem is that one of the two repos is using a branch instead of master

git symbolic-ref HEAD refs/heads/mybranch

The problem is that this local repository is never updated by the plugin. Tried to change
in https://github.com/koppen/redmine_github_hook/blob/master/app/controllers/github_hook_controller.rb#L60, but I don't know enough ruby.

404 github_hook not found in RM 2.3.0

I am trying to get this guy to work, but am getting hit with a 404 error when I try to access the github_hook URL.

Plugin was installed via a GIT clone from this repo.

Started GET "/github_hook?project_id=dotcom" for 192.168.1.54 at Thu Apr 25 10:16:46 -0500 2013

ActionController::RoutingError (No route matches [GET] "/github_hook"):
  actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.13) 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.13) 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.13) 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.13) lib/rails/engine.rb:479:in `call'
  railties (3.2.13) lib/rails/application.rb:223:in `call'
  railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `send'
  railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (3.0.4) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  passenger (3.0.4) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
  passenger (3.0.4) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
  passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:170:in `send'
  passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:170:in `handle_spawn_application'
  passenger (3.0.4) lib/phusion_passenger/utils.rb:479:in `safe_fork'
  passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'
  passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:180:in `start'
  passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
  passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
  passenger (3.0.4) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
  passenger (3.0.4) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
  passenger (3.0.4) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
  passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
  passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.4) helper-scripts/passenger-spawn-server:99&
Environment:
  Redmine version                          2.3.0.stable
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.13
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  clipboard_image_paste                    1.6a
  redmine_github_hook                      0.2.0
  redmine_graphs                           0.1.0

TypeError (can't convert nil into String)

I'm getting:

Processing GithubHookController#index (for 82.193.109.185 at 2010-09-16 12:09:31) [GET]
  Parameters: {"action"=>"index", "controller"=>"github_hook"}
  SQL (0.6ms)   SELECT max("settings".updated_on) AS max_updated_on FROM "settings" 
  AnonymousUser Load (1.5ms)   SELECT * FROM "users" WHERE ( ("users"."type" = 'AnonymousUser' ) ) LIMIT 1

TypeError (can't convert nil into String):
  json (1.4.6) lib/json/common.rb:146:in `initialize'
  json (1.4.6) lib/json/common.rb:146:in `new'
  json (1.4.6) lib/json/common.rb:146:in `parse'
  vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:43:in `get_identifier'
  vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:51:in `find_project'
  vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:59:in `find_repository'
  vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:9:in `index'

Doesn't work with private projects

Hi there. I am having an issue with this plugin. The github hook doesn't seem to work if the project is private, nor does it work if the redmine settings has "Authentication required" set.

Is there a chance that your plugin will support private projects / authentication required in the future?

MissingSourceFile (no such file to load -- json)

I keep getting a MissingSourceFile (no such file to load -- json) error. The json gem has been installed. OSX 10.7.1. Ruby 1.8.7.

Processing ApplicationController#index (for 207.97.227.234 at 2011-09-15 16:14:57) [POST]
Parameters: {"payload"=>"{"after":"30f2d125cf46b2214d2ce3f9ce1da894a9f352cf","created":false,"base_ref":null,"repository":{"has_issues":true,"pushed_at":"2011/09/15 08:14:55 -0700","created_at":"2011/06/30 05:45:58 -0700","forks":1,"homepage":"","language":"Python","fork":false,"watchers":2,"open_issues":0,"private":false,"size":2468,"owner":{"name":"evandavey","email":"[email protected]"},"name":"OpenFinancialManagement","has_wiki":true,"description":"Open source personal financial management application using the django framework.","has_downloads":true,"url":"https://github.com/evandavey/OpenFinancialManagement\"},\"commits\":[{\"author\":{\"name\":\"Evan Davey","username":"evandavey","email":"[email protected]"},"message":"Adds site wide urls","added":["urls.py"],"timestamp":"2011-09-15T08:14:49-07:00","removed":[],"distinct":true,"id":"30f2d125cf46b2214d2ce3f9ce1da894a9f352cf","modified":[],"url":"https://github.com/evandavey/OpenFinancialManagement/commit/30f2d125cf46b2214d2ce3f9ce1da894a9f352cf\"}],\"forced\":false,\"deleted\":false,\"compare\":\"https://github.com/evandavey/OpenFinancialManagement/compare/ff5ea20...30f2d12\",\"pusher\":{\"name\":\"evandavey\",\"email\":\"[email protected]\"},\"ref\":\"refs/heads/master\",\"before\":\"ff5ea20ad4b43618281f2e03fa9bdb2e793cf3ab\"}", "project_id"=>"financialdatabase", "action"=>"index", "controller"=>"github_hook"}

MissingSourceFile (no such file to load -- json):

*** LOCAL GEMS ***

actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
acts-as-taggable-on (2.0.6)
Ascii85 (1.0.1)
bluefeather (0.40)
bundler (1.0.18)
coderay (0.9.8)
daemon_controller (0.2.6)
fastthread (1.0.7)
holidays (1.0.3)
i18n (0.4.2)
icalendar (1.1.6)
json (1.6.0)
mysql (2.8.1)
nokogiri (1.5.0)
open-uri-cached (0.0.4)
passenger (3.0.9)
pdf-reader (0.10.0)
prawn (0.12.0)
rack (1.1.0)
rails (2.3.11)
rake (0.8.7)
rubygems-update (1.3.7)
ttfunk (1.0.2)
vpim (0.695)

Ruby on Rails could not be started

I'm trying to set up your redmine_github_hook plugin, but have been having trouble.
I installed it in the {Rails_root}/vendor/plugins directory. I also set up the hook in github.
When I restart apache I get the "Ruby on Rails application could not be started" screen.

I am using Redmine 1.3.2.stable (ruby 1.8.7) with Postgresql 9.1 on Ubuntu 12.04.

Here is the error page:
redmine_error

Hook does not appear to catch git errors properly

I had some odd issues when using the github_hook to update our Redmine repositories. When testing the hook I had some git repos update and others not, but nothing showed up in the apache error_log or in the Redmine production.log. I finally tracked it down to a bug in the logger, where it always returns as successful when sending the git commands even when there is a failure.

Redirecting the output to production when successful gave me this, which obviously points to a permissions issue (now fixed):

Processing GithubHookController#index (for 207.97.227.235 at 2011-04-04 15:43:58) [POST]
  Parameters: {"project_id"=>"bioperl", "payload"=>"{\"forced\":false,\"created\":false,\"commits\":[{\"author\":{\"username\":\"cjfields\",\"email\":\"[email protected]\",\"name\":\"Chris Fields\"},\"timestamp\":\"2011-04-03T20:38:46-07:00\",\"modified\":[\"README\"],\"distinct\":true,\"message\":\"test hook\",\"url\":\"https://github.com/bioperl/bioperl-live/commit/983fb37a89be22476b0e4e3880dfb9891bf812b1\",\"added\":[],\"removed\":[],\"id\":\"983fb37a89be22476b0e4e3880dfb9891bf812b1\"},{\"author\":{\"username\":\"cjfields\",\"email\":\"[email protected]\",\"name\":\"Chris Fields\"},\"timestamp\":\"2011-04-03T20:47:22-07:00\",\"modified\":[\"README\"],\"distinct\":true,\"message\":\"test hook\",\"url\":\"https://github.com/bioperl/bioperl-live/commit/5e4f1516b6a4541d6dc3481427101cdffd94dfc7\",\"added\":[],\"removed\":[],\"id\":\"5e4f1516b6a4541d6dc3481427101cdffd94dfc7\"},{\"author\":{\"username\":\"cjfields\",\"email\":\"[email protected]\",\"name\":\"Chris Fields\"},\"timestamp\":\"2011-04-04T07:19:56-07:00\",\"modified\":[\"Bio/Tools/SeqStats.pm\",\"t/SeqTools/SeqStats.t\"],\"distinct\":true,\"message\":\"use residue count for calcs instead of length, fixes bug #3185\",\"url\":\"https://github.com/bioperl/bioperl-live/commit/536fd500d3cd308938513279d755d418ea86e0d5\",\"added\":[],\"removed\":[],\"id\":\"536fd500d3cd308938513279d755d418ea86e0d5\"}],\"repository\":{\"pushed_at\":\"2011/04/04 07:19:59 -0700\",\"watchers\":56,\"description\":\"Core BioPerl code\",\"url\":\"https://github.com/bioperl/bioperl-live\",\"open_issues\":1,\"fork\":false,\"forks\":21,\"language\":\"Perl\",\"has_wiki\":false,\"has_downloads\":true,\"private\":false,\"size\":13584,\"created_at\":\"2010/05/12 10:13:10 -0700\",\"has_issues\":false,\"owner\":{\"email\":\"[email protected]\",\"name\":\"bioperl\"},\"name\":\"bioperl-live\",\"organization\":\"bioperl\",\"homepage\":\"http://bioperl.org\"},\"pusher\":{\"name\":\"none\"},\"base_ref\":null,\"before\":\"13813c2b5e8c5c825940a82f62e7c8715fc70f9b\",\"compare\":\"https://github.com/bioperl/bioperl-live/compare/13813c2...536fd50\",\"after\":\"536fd500d3cd308938513279d755d418ea86e0d5\",\"deleted\":false,\"ref\":\"refs/heads/master\"}", "action"=>"index", "controller"=>"github_hook"}
GithubHook: Command output: ["error: cannot open /home/git/bioperl/bioperl-live.git/FETCH_HEAD: Permission denied\n", "\n"]
GithubHook: Command output: ["fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.\n", "Use '--' to separate paths from revisions\n"]
Completed in 206ms (View: 1, DB: 102) | 200 OK [https://redmine.open-bio.org/github_hook]

Local repository not updating

Hello,

I'm trying to set your plugin but I have this problem with local repo not being updated.

When Github sends the request this is what I get in the access log:

[17/Aug/2012:20:41:10 +0000] "GET /github_hook/sys/fetch_changesets?id=github&key=x7o1FQNqLTltnd1V8rSh HTTP/1.1" 404 485 "-" "-"

The Url I have set in Github is like :

http://projects.domain.com/github_hook

Redmine reports:

Processing GithubHookController#sys (for aaa.bbb.ccc.ddd at 2012-08-17 20:34:17) [GET]
Parameters: {"controller"=>"github_hook", "key"=>"x7o1FQNqLTltnd1V8rSh", "id"=>"fetch_changesets", "action"=>"sys"}

ActionController::UnknownAction (No action responded to sys. Actions: accept_api_auth?, accept_key_auth_actions, accept_rss_auth?, api_key_from_request, api_offset_and_limit, api_request?, authorize, authorize_global, back_url, check_if_login_required, check_project_privacy, check_project_uniqueness, current_language, current_menu_item, day_name, default_search_scope, default_search_scopes, default_template, delete_broken_cookies, deny_access, filename_for_content_disposition, find_current_user, find_issues, find_language, find_model_object, find_optional_project, find_project_by_project_id, find_project_from_association, format_date, format_time, handle_unverified_request, index, invalid_authenticity_token, l_hours, l_or_humanize, ll, logged_user=, menu_items, month_name, parse_qvalues, per_page_option, pick_layout, query_statement_invalid, redirect_back_or_default, redirect_to_project_menu_item, render_403, render_404, render_attachment_warning_if_needed, render_error, render_feed, render_validation_errors, require_admin, require_admin_or_api_request, require_login, set_flash_from_bulk_issue_save, set_language_if_valid, set_localization, use_layout, user_setup, and valid_languages):
thin (1.2.11) lib/thin/connection.rb:84:in pre_process' thin (1.2.11) lib/thin/connection.rb:82:incatch'
thin (1.2.11) lib/thin/connection.rb:82:in pre_process' thin (1.2.11) lib/thin/connection.rb:57:inprocess'
thin (1.2.11) lib/thin/connection.rb:42:in receive_data' eventmachine (0.12.10) lib/eventmachine.rb:256:inrun_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in run' thin (1.2.11) lib/thin/backends/base.rb:61:instart'
thin (1.2.11) lib/thin/server.rb:159:in start' thin (1.2.11) lib/thin/controllers/controller.rb:86:instart'
thin (1.2.11) lib/thin/runner.rb:185:in send' thin (1.2.11) lib/thin/runner.rb:185:inrun_command'
thin (1.2.11) lib/thin/runner.rb:151:in run!' thin (1.2.11) bin/thin:6 /usr/bin/thin:19:inload'
/usr/bin/thin:19

Rendering /web/www/projects.domain.com/public_html/redmine/public/404.html (404 Not Found)

Any idea what the problem is?

Thanks

NameError at first request

Hi! I've installed you plugin with Redmine 2.4.2-stable and after first test request got this error in log

NameError (uninitialized constant GithubHookController::GithubHook):
  plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:9:in `index'

At that time server shows 500 error. Any ideas how to solve it? Thanks.

Local repository doesn't update - Could not read Username

I'm getting the following error after github sends the POST with commit info.

Current user: anonymous
GithubHook: Command 'git --git-dir='/home/bitnami/repos/wattpad-redmine/wattpad-redmine.git' fetch origin' didn't exit properly. Full output: ["fatal: could not read Username for 'https://github.com': No such device or address\n"]

I can see the payload in the logs. Not sure how to get rid of this error, though.

Git updates have fatal error on git mirrored repos

Recent versions of git allow one to create true mirrored repos using the --mirror option. However, using a git reset --soft refs/remotes/origin/master command is fatal (which is the method the github hook uses to update the repo). It appears to be a minor issue, as the prior call to git (a simple git fetch) works, but the error as reported before isn't caught.

Unsure of a fix beyond checking for the git version prior to the git reset --soft call.

No route matches [GET] "/github_hook"

I got this problem (404) when accessing /github_hook url.

Plugin is visible in redmine administration,

What can be wrong?

Environment:
Redmine version 2.1.2.stable.10538
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.8
Environment production
Database adapter MySQL
Redmine plugins:
redmine_github_hook 0.2.0

don't work in redmine 1.4.1

After install plugin and starting thin I see next exception:

/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:611:in `to_constant_name': Anonymous modules have no name to be referenced by (ArgumentError) from /usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:417:in`qualified_name_for' from /usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:130:in `rescue in const_missing' from /usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:120:in`const_missing' from /tracker/vendor/plugins/redmine_github_hook/config/routes.rb:1:in `' from /usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:173:in`load' from /usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:173:in `load_with_new_constant_marking' from /usr/lib/ruby/gems/1.9.1/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:287:in`block in load_routes!' from /usr/lib/ruby/gems/1.9.1/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:287:in `each' from /usr/lib/ruby/gems/1.9.1/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:287:in`load_routes!' from /usr/lib/ruby/gems/1.9.1/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:267:in `load!' from /usr/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/initializer.rb:537:in`initialize_routing' from /usr/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/initializer.rb:188:in `process' from /usr/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/initializer.rb:113:in`run' from /tracker/config/environment.rb:21:in `' from :29:in`require' from internal:lib/rubygems/custom_require:29:in `require' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/rack/adapter/rails.rb:37:in`load_application' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/rack/adapter/rails.rb:23:in `initialize' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:45:in`new' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:45:in `for' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:169:in`load_adapter' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:73:in `start' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in`run_command' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!' from /usr/lib/ruby/gems/1.9.1/gems/thin-1.4.1/bin/thin:6:in`' from /usr/bin/thin:19:in `load' from /usr/bin/thin:19:in`' And thin procss crashed.

"There are no gemspecs" Error

On CentOS 6.4 running Redmine 2.3, I get the following error after installing it in my plugins directory

/usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/dsl.rb:59:in `gemspec': There are no gemspecs at ###/redmine-2.3.

Error: Refusing to fetch into current branch of non-bare repository

I get the following error when my post-commit hook fires at my Chili/Redmine instance:

GithubHook: Command 'git --git-dir='/path/to/my/git/repo/.git' fetch origin '+refs/heads/*:refs/heads/*'' didn't exit properly. Full output: ["fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository\n"]

Is this a result of the Git command that the GithubHook plugin is issuing, or a misconfiguration on my end?

No action responded to sys

Hi,

first of all thanks for the plugin, it worked pretty nice until now.

The problem is, that a while ago, the fetches started to work sometimes but not always. I think it could be related to a Redmine update, but I'm not totally sure there. My Ruby isn't very good, but this issue seems to be similar to the problem that was fixed with the routes.rb.

Here is the redmine log output:

Processing GithubHookController#sys (for 50.57.128.197 at 2012-04-13 20:31:45) [GET]
  Parameters: {"key"=>"", "action"=>"sys", "controller"=>"github_hook", "id"=>"fetch_changesets"}

ActionController::UnknownAction (No action responded to sys. Actions: accept_key_auth_actions, api_key_from_request, api_offset_and_limit, api_request?, authorize, authorize_global, back_url, check_if_login_required, check_project_privacy, check_project_uniqueness, current_language, current_menu_item, day_name, default_search_scope, default_search_scopes, default_template, delete_broken_cookies, deny_access, filename_for_content_disposition, find_current_user, find_issues, find_language, find_model_object, find_optional_project, find_project_by_project_id, find_project_from_association, format_date, format_time, index, invalid_authenticity_token, l_hours, l_or_humanize, ll, logged_user=, menu_items, month_name, object_errors_to_json, parse_qvalues, per_page_option, pick_layout, query_statement_invalid, redirect_back_or_default, redirect_to_project_menu_item, render_403, render_404, render_attachment_warning_if_needed, render_error, render_feed, render_validation_errors, require_admin, require_login, set_flash_from_bulk_issue_save, set_language_if_valid, set_localization, use_layout, user_setup, and valid_languages):
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:617:in `call_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:610:in `perform_action_without_benchmark'
  /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  /usr/lib/ruby/vendor_ruby/action_controller/rescue.rb:160:in `perform_action_without_flash'
  /usr/lib/ruby/vendor_ruby/action_controller/flash.rb:151:in `perform_action'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `send'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `process_without_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:606:in `process'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:391:in `process'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:386:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/routing/route_set.rb:438:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:87:in `dispatch'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:121:in `_call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:130:in `build_middleware_stack'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:9:in `cache'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:28:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/1.8/rack/head.rb:9:in `call'
  /usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/params_parser.rb:15:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/session/cookie_store.rb:99:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/failsafe.rb:26:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:106:in `call'
  /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  /usr/lib/phusion_passenger/passenger-spawn-server:61

Gemify commit breaks existing "git clone"-installations

Hi,
I have the plugin installed as a git clone in my plugins directory. This always worked very well, until you introduced the gemify commit.

I just wanted to upgrade to the latest version and after my git pull now get that for plugin-upgrades:

$ # rake redmine:plugins:migrate RAILS_ENV=production
There are no gemspecs at /var/www/projekte/redmine-2.4.

After switching back to commit before "gemify", verything works as expected.

Please have a look and restore git cloning functionality!

Thanks,
Tobias

Git errors on cli not logged

Running the command with backticks captures STDOUT, but I think if there's a problem with a git command it's sent to STDERR, which makes the returned text be empty.

run command under specific user

I have private repository and managing access to it through the ssh keys.
I've got following output on my log file:

 Current user: anonymous
 GithubHook: Command 'git --git-dir='/projects/eca.git' fetch origin' didn't exit properly.   Full output: ["Permission denied (publickey).\r\n", "fatal: The remote end hung up   unexpectedly\n"]
 Rendered text template (0.0ms)

I think it would be nice provide a way to run plugin under specific linux user.
User under which redmine itself running is www-data. And strange enough I had to create folders /var/www/.shh to run against my repository

Not work in ubuntu

Hello I installed redmine on ubuntu from ppa repository ppa:ondrej/redmine. I installed the plugins and appears in the view settings but adds redmine plugin routes. I am attaching the logs.

Started POST "/github_hook?project_id=portal-inicio-zend" for 179.9.224.152 at Sun Apr 27 01:10:43 -0400 2014

ActionController::RoutingError (No route matches [POST] "/github_hook"):
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:32:in `call_app'
  /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:16:in `call'
  /usr/lib/ruby/vendor_ruby/active_support/tagged_logging.rb:22:in `tagged'
  /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:16:in `call'
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/request_id.rb:22:in `call'
  /usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:21:in `call'
  /usr/lib/ruby/vendor_ruby/rack/runtime.rb:17:in `call'
  /usr/lib/ruby/vendor_ruby/active_support/cache/strategy/local_cache.rb:72:in `call'
  /usr/lib/ruby/vendor_ruby/rack/lock.rb:15:in `call'
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/static.rb:63:in `call'
  /usr/lib/ruby/vendor_ruby/rack/cache/context.rb:136:in `forward'
  /usr/lib/ruby/vendor_ruby/rack/cache/context.rb:143:in `pass'
  /usr/lib/ruby/vendor_ruby/rack/cache/context.rb:155:in `invalidate'
  /usr/lib/ruby/vendor_ruby/rack/cache/context.rb:71:in `call!'
  /usr/lib/ruby/vendor_ruby/rack/cache/context.rb:51:in `call'
  /usr/lib/ruby/vendor_ruby/rails/engine.rb:479:in `call'
  /usr/lib/ruby/vendor_ruby/rails/application.rb:223:in `call'
  /usr/lib/ruby/vendor_ruby/rails/railtie/configurable.rb:30:in `send'
  /usr/lib/ruby/vendor_ruby/rails/railtie/configurable.rb:30:in `method_missing'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:479:in `safe_fork'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `__send__'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:180:in `start'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `__send__'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99
ubuntu@ip-10-114-66-198:/usr/share/redmine$ RAILS_ENV=production rake routes | grep github_hook
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /usr/lib/ruby/vendor_ruby/rake/rdoctask.rb
Rails Error: Unable to access log file. Please ensure that /var/log/redmine/default/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
OpenIdAuthentication.store is nil. Using in-memory store.
ubuntu@ip-10-114-66-198:/usr/share/redmine$

Check :body in get_identifier

I'm not entirely sure how you would go about doing this, but checking params[:body] along with params[:payload] would allow it to work with Gitlab as well.

I've done this myself by just replacing :payload with :body since I only need it to work with Gitlab, but just something you could add to extend the plugins usage.

Thats the only change required for it to work with Gitlab.

undefined method `[]' for nil:NilClass error

Hey I'm using Ruby 1.8.7-p352 and redmine 1.2. I set up a github hook for my repo and it's not updating. I don't know if this error is related. I'm running into this error when visiting /github_hook on my redmine site.

Processing GithubHookController#index (for 70.36.146.73 at 2011-10-18 18:13:52) [GET]
Parameters: {"action"=>"index", "controller"=>"github_hook"}

NoMethodError (undefined method []' for nil:NilClass): vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:59:inget_identifier'
vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:66:in find_project' vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:74:infind_repository'
vendor/plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:8:in index' passenger (3.0.9) lib/phusion_passenger/rack/request_handler.rb:96:inprocess_request'
passenger (3.0.9) lib/phusion_passenger/abstract_request_handler.rb:513:in accept_and_process_next_request' passenger (3.0.9) lib/phusion_passenger/abstract_request_handler.rb:274:inmain_loop'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in start_request_handler' passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:275:insend'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in handle_spawn_application' passenger (3.0.9) lib/phusion_passenger/utils.rb:479:insafe_fork'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in handle_spawn_application' passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:insend'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:in server_main_loop' passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:206:instart_synchronously'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:180:in start' passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:149:instart'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:219:in spawn_rails_application' passenger (3.0.9) lib/phusion_passenger/abstract_server_collection.rb:132:inlookup_or_add'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:214:in spawn_rails_application' passenger (3.0.9) lib/phusion_passenger/abstract_server_collection.rb:82:insynchronize'
passenger (3.0.9) lib/phusion_passenger/abstract_server_collection.rb:79:in synchronize' passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:213:inspawn_rails_application'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:132:in spawn_application' passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:275:inhandle_spawn_application'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:in __send__' passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:inserver_main_loop'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.9) helper-scripts/passenger-spawn-server:99

Rendering /home/redmine/public_html/public/500.html (500 Internal Server Error)

Linking Git user and Redmine users

When a smart commit is updating the issue (in our workflow, "fixes #125" will set the issue to "Develop"), the update appears to be done by "Anonymous".

Is it by design or is there a way to link the author of the commit with a Redmine user in order to see who actually triggered the change thru the commit.

Many thanks,
JM

local copy issue

Hello,

Environment:
Redmine version 2.5.0.stable.12954
Ruby version 1.9.3-p125 (2012-02-16) [x86_64-freebsd7.2]
Rails version 3.2.17
Environment production
Database adapter Mysql2
SCM:
Subversion 1.7.2
Git 1.8.3.4
Filesystem
Redmine plugins:
redmine_github_hook 0.2.0

Gems included by the bundle:

  • actionmailer (3.2.17)
  • actionpack (3.2.17)
  • activemodel (3.2.17)
  • activerecord (3.2.17)
  • activeresource (3.2.17)
  • activesupport (3.2.17)
  • arel (3.0.3)
  • awesome_nested_set (2.1.6)
  • builder (3.0.0)
  • bundler (1.1.5)
  • capybara (2.1.0)
  • childprocess (0.5.1)
  • coderay (1.1.0)
  • erubis (2.7.0)
  • ffi (1.9.3)
  • hike (1.2.3)
  • i18n (0.6.9)
  • journey (1.0.4)
  • jquery-rails (2.0.3)
  • json (1.8.1)
  • mail (2.5.4)
  • metaclass (0.0.4)
  • mime-types (1.25.1)
  • mini_portile (0.5.2)
  • mocha (1.0.0)
  • multi_json (1.8.4)
  • mysql2 (0.3.15)
  • net-ldap (0.3.1)
  • nokogiri (1.6.1)
  • polyglot (0.3.4)
  • rack (1.4.5)
  • rack-cache (1.2)
  • rack-openid (1.4.2)
  • rack-ssl (1.3.3)
  • rack-test (0.6.2)
  • rails (3.2.17)
  • railties (3.2.17)
  • rake (10.1.1)
  • rdoc (3.12.2)
  • redcarpet (2.3.0)
  • rmagick (2.13.2)
  • ruby-openid (2.3.0)
  • rubyzip (1.1.0)
  • selenium-webdriver (2.40.0)
  • shoulda (3.3.2)
  • shoulda-context (1.0.2)
  • shoulda-matchers (1.4.1)
  • sprockets (2.2.2)
  • thor (0.18.1)
  • tilt (1.4.1)
  • treetop (1.4.15)
  • tzinfo (0.3.38)
  • websocket (1.0.7)
  • xpath (2.0.0)
  • yard (0.8.7.3)

when execution push to githun in logs errors:

Started GET "/github_hook/sys/fetch_changesets?project_id=ti&key=**********" for 192.30.252.37 at 2014-03-06 17:23:50 +0400

AbstractController::ActionNotFound (The action 'sys' could not be found for GithubHookController):
actionpack (3.2.17) lib/abstract_controller/base.rb:116:in process' actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:inprocess'
actionpack (3.2.17) lib/action_controller/metal.rb:203:in dispatch' actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:indispatch'
actionpack (3.2.17) lib/action_controller/metal.rb:246:in block in action' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:incall'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in dispatch' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:36:incall'
journey (1.0.4) lib/journey/router.rb:68:in block in call' journey (1.0.4) lib/journey/router.rb:56:ineach'
journey (1.0.4) lib/journey/router.rb:56:in call' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:incall'
rack-openid (1.4.2) lib/rack/openid.rb:98:in call' actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
rack (1.4.5) lib/rack/etag.rb:23:in call' rack (1.4.5) lib/rack/conditionalget.rb:25:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/head.rb:14:in call' actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/flash.rb:242:in call' rack (1.4.5) lib/rack/session/abstract/id.rb:210:incontext'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in call' actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:incall'
activerecord (3.2.17) lib/active_record/query_cache.rb:64:in call' activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:28:in block in call' activesupport (3.2.17) lib/active_support/callbacks.rb:405:in_run__64747790143452053__call__3630505561187745328__callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:405:in __run_callback' activesupport (3.2.17) lib/active_support/callbacks.rb:385:in_run_call_callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:in call' actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/show_exceptions.rb:56:in call' railties (3.2.17) lib/rails/rack/logger.rb:32:incall_app'
railties (3.2.17) lib/rails/rack/logger.rb:16:in block in call' activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:intagged'
railties (3.2.17) lib/rails/rack/logger.rb:16:in call' actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:incall'
rack (1.4.5) lib/rack/methodoverride.rb:21:in call' rack (1.4.5) lib/rack/runtime.rb:17:incall'
activesupport (3.2.17) lib/active_support/cache/strategy/local_cache.rb:72:in call' rack (1.4.5) lib/rack/lock.rb:15:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/static.rb:63:in call' rack-cache (1.2) lib/rack/cache/context.rb:136:inforward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in fetch' rack-cache (1.2) lib/rack/cache/context.rb:185:inlookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in call!' rack-cache (1.2) lib/rack/cache/context.rb:51:incall'
railties (3.2.17) lib/rails/engine.rb:484:in call' railties (3.2.17) lib/rails/application.rb:231:incall'
railties (3.2.17) lib/rails/railtie/configurable.rb:30:in method_missing' passenger (4.0.37) lib/phusion_passenger/rack/thread_handler_extension.rb:77:inprocess_request'
passenger (4.0.37) lib/phusion_passenger/request_handler/thread_handler.rb:142:in accept_and_process_next_request' passenger (4.0.37) lib/phusion_passenger/request_handler/thread_handler.rb:110:inmain_loop'
passenger (4.0.37) lib/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'

and local copy of repo do not updates.

Failing on Redmine 1.1

I am trying to get the plugin configured for Redmine 1.1, but I'm not having any luck. I can see the post request coming in to the install, but it is failing due to a failed check. This is really wierd, because I see that there is a skip_before_filter in the controller. Here is what I am seeing in the log:
Filter chain halted as [:check_if_login_required] rendered_or_redirected.

Running the script/runner method works fine, so it's not a git access issue. I've tried various ways of modifying the skip_before_filter to skip the following, but no luck: :user_setup, :check_if_login_required, :set_localization

Any suggestions?

uninitialized constant Redmine::Hook::Listener::Singleton using Phusion Passenger

When installing the plugin on Redmine 2.1.6 running on Phusion Passenger, I get this error.

Error message:
uninitialized constant Redmine::Hook::Listener::Singleton
Exception class:
NameError
Application root:
/var/www/redmine/current
Backtrace:

File Line Location

0 /var/www/redmine/redmine-svn-trunk/lib/redmine/hook.rb 69
1 /var/www/redmine/redmine-svn-trunk/lib/redmine.rb 9
2 /var/www/redmine/redmine-svn-trunk/vendor/plugins/redmine_github_hook/init.rb 1
3 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/plugin.rb 82
4 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb 30 in instance_exec' 5 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb 30 inrun'
6 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb 55 in run_initializers' 7 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb 54 ineach'
8 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb 54 in run_initializers' 9 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/application.rb 136 ininitialize!'
10 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb 30 in send' 11 /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb 30 inmethod_missing'
12 /var/www/redmine/redmine-svn-trunk/config/environment.rb 22
13 config.ru 3 in require' 14 config.ru 3 15 /var/lib/gems/1.8/gems/rack-1.4.4/lib/rack/builder.rb 51 ininstance_eval'
16 /var/lib/gems/1.8/gems/rack-1.4.4/lib/rack/builder.rb 51 in initialize' 17 config.ru 1 innew'
18 config.ru 1

long processing for POST payload from github

my github webhook setup is showing "Service Timeout" for every payload / POST request github sends to my redmine github hook URL.
GitHub support says:

We don't allow requests to exceed 30 seconds and posting to your service takes a little more, 37 seconds when I tested. I'd suggest moving whatever action you're taking inside of the web process and moving it to a background job so you can close the HTTP request quickly. This will fix up your timeout issues.

When I check my redmine logfile, this is the logging for one of the POST request:

Started POST "/github_hook?project_id=parsx" for 192.30.252.39 at 2014-05-03 18:37:11 +0200
Processing by GithubHookController#index as /
Parameters: {"project_id"=>"parsx", ... }
Current user: anonymous
Rendered mailer/_issue.text.erb (5.8ms)
Rendered mailer/issue_edit.text.erb within layouts/mailer (10.5ms)
Rendered mailer/_issue.html.erb (2.5ms)
Rendered mailer/issue_edit.html.erb within layouts/mailer (13.4ms)
Rendered text template (0.0ms)
Completed 200 OK in 43012.0ms (Views: 9.2ms | ActiveRecord: 316.5ms)

The processing in the github hook plugin seems to last 43 seconds – but why does it take that long?

The POST request in this case just updated a single branch and basically a bunch of text files.

Could it be the git fetch that takes so long? If I perform a git fetch on the bare repo as root it takes just a few seconds...

Any ideas?

Fresh install error: uninitialized constant RedmineApp

I get this error from a clone of your repo.

Error message: uninitialized constant RedmineApp
Exception class: NameError

Backtrace:

#   File    Line    Location
0   /var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb  469 in `load_missing_constant'
1   /var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb  106 in `const_missing'
2   /var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb  118 in `const_missing'
3   /opt/redmine/vendor/plugins/redmine_github_hook/config/routes.rb    1   
4   /var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb  173 in `load_without_new_constant_marking'
5   /var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb  173 in `load'
6   /var/lib/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 287 in `load_routes!'
7   /var/lib/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 287 in `each'
8   /var/lib/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 287 in `load_routes!'
9   /var/lib/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 267 in `reload!'
10  /var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb  537 in `initialize_routing'
11  /var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb  188 in `process'
12  /var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb  113 in `send'
13  /var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb  113 in `run'
14  /opt/redmine/config/environment.rb  21  

When I checkout the v1.1.0 tag I get no errors.

I use Redmine 1.4.1.stable.9665 (MySQL)

Github Hook stopped working

For some strange reason, the github hooks stopped working. I can't figure out what the problem is. Github says 302 error:

Cache-Control: private
Connection: close
Content-Length: 199
Content-Type: text/html
Date: Wed, 10 Dec 2014 15:09:32 GMT
Location: http://mydomain.com/github_hook?project_id=tac&amp;repository_id=tac
Server: Microsoft-IIS/6.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
x-server: ash01

<title>Object moved</title>

Object Moved

This object may be found here.

We didn't update the redmine code. Any ideas on what the problem can be?

Updating non-main repository of project

It would be cool if I could to set webhook like

“[redmine_installation_url]/github_hook?project_id=[identifier]&repository_id=[repo_identifier]”

for updating non-main repository in project if it contain several repositories.

To work on windows, the commands need to be slightly changed

The commands are executed through CMD on Windows. And simple-quote strings are not playing nice with it.

For it to work, I had to replace:

"git --git-dir='#{repository.url}' #{command}"

By:

"git --git-dir=\"#{repository.url}\" #{command}"

And:

"fetch origin '+refs/heads/*:refs/heads/*'"

By:

"fetch origin \"+refs/heads/*:refs/heads/*\""

I didn't know if those changes would brake on linux/mac, that's why I didn't make it a pull request. But if it's the case, maybe there would be a way to check for the OS before issuing the commands.

Apart from that, awesome plugin ^^ !

Regards.

Install fails with Redmine 2.3.4.stable

When installing I get an error starting redmine

There are no gemspecs at /home/server/services/redmine-2.3.4. (Bundler::InvalidOption)
  /home/server/services/redmine-2.3.4/Gemfile:95:in `instance_eval'
  (eval):4:in `block in eval_gemfile'
  /home/server/services/redmine-2.3.4/Gemfile:95:in `instance_eval'
  /home/server/services/redmine-2.3.4/Gemfile:95:in `block in eval_gemfile'
  /home/server/services/redmine-2.3.4/Gemfile:93:in `glob'
  /home/server/services/redmine-2.3.4/Gemfile:93:in `eval_gemfile'
  /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/dsl.rb:30:in `instance_eval'
  /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/dsl.rb:30:in `eval_gemfile'
  /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/dsl.rb:9:in `evaluate'
  /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:19:in `build'
  /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition'
  /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:116:in `setup'
  /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
  /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
  /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
  /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
  /var/lib/gems/1.9.1/gems/passenger-4.0.18/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
  /var/lib/gems/1.9.1/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:96:in `preload_app'
  /var/lib/gems/1.9.1/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:150:in `<module:App>'
  /var/lib/gems/1.9.1/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /var/lib/gems/1.9.1/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:28:in `<main>'

trying to install the dependencies fails with

root@myhost:/srv/services/redmine# bundle install --without development test
There are no gemspecs at /home/server/services/redmine-2.3.4.

Local repos clone not updating

I am unable to get my local repos updated via plugin.

My setup:

  • redmine: 2.3.1 with authentication == required
  • redmine_github_hook plugin: 41a745f
  • config/additional_environment.rb: config.log_level = :debug
  • local bare mirror of source repos via git clone --mirror [email protected]:git_user/project.git as deploy user
  • passengerdefaultuser == deploy
  • github: private repository

production.log:

OpenIdAuthentication.store is nil. Using in-memory store.
Creating scope :sorted. Overwriting existing method Group.sorted.
Creating scope :sorted. Overwriting existing method User.sorted.
Started POST "/?github_hook%3Fproject_id=my_project" for x.x.x.x at Tue May 07 06:36:49 +0200 2013
Processing by WelcomeController#index as */*
  Parameters: {"github_hook?project_id"=>"my_project", "payload"=>"{\"ref\":\"refs/heads/develop\",\"after\":\ ...(cut)... "}
WARNING: Can't verify CSRF token authenticity
   (0.2ms)  SELECT MAX(`settings`.`updated_on`) AS max_id FROM `settings` 
  Setting Load (0.1ms)  SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'rest_api_enabled' LIMIT 1
  AnonymousUser Load (0.1ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('AnonymousUser') LIMIT 1
  Current user: anonymous
  Setting Load (0.2ms)  SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'login_required' LIMIT 1
Redirected to https://x.x.x.x/login?back_url=https%3A%2F%2Fx.x.x.x%2F
Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 161ms (ActiveRecord: 2.9ms)

There is no info about github hook plugin as i have seen in other issues.

Local Repository not updating

Hi Koppen,

I've followed your instructions carefully. I'm using Ubuntu 10.04/Apache2/Mysql5. I created my server repository using "git clone --mirror" command. The local directory appears as /myproject.git/

After setting up the service hook, and testing a push, the local repository is not updating. My issue is very similar to closed Issue #6. I can see the entire payload in my production.log. The POST is working and being processed by the GithubController. But nothing is getting triggered on the server to fetch. When I do a manual fetch on the repository, it works fine. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.