srushti / goldberg

Goldberg is a lightweight CI server written in Ruby which worries about Bundler & RVM so that you don't have to.
Other
243 stars 29 forks source link

Email notifications can't be rendered #118

Open professor opened 12 years ago

professor commented 12 years ago

I've setup very simple email notifications, but they aren't sent out due to the error listed at the end

Line 3 of app/views/build_status_mailer/status_mail.html.erb says...

Build Page URL : <%= project_build_url(@project.name,@build.number) %>

If that line is changed to

Build Page URL : <%= project_build_path(@project.name,@build.number) %>

then it functions. I suspect that the poller doesn't have access to the project's root url.

Build on project failed because of ActionView::Template::Error "...rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:474:in url_for'", ".../.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.10/lib/action_dispatch/routing/url_for.rb:131:in url_for'", ".../.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.10/lib/action_view/helpers/url_helper.rb:99:in url_for'", ".../.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:195:in project_build_url'",
".../goldberg/app/views/build_status_mailer/status_mail.html.erb:3:in `_app_views_build_status_mailer_status_mail_html_erb__833087965527713517_702850966\

srushti commented 12 years ago

Did you create an email.rb file under config/initializers (there's a .sample file for reference)? You need to set the host (and port) there. Maybe we could check for that before sending out an email, and posting a message in the logs if we don't find it. This is assuming you'd configured it correctly, and there's no other bug in this.

professor commented 12 years ago

I did not create an email.rb file under config/initializers..... I would update the directions to be more clear that this how goldberg expects emails to be configured. I did my email configuration on application.rb since I wanted it to work for both dev and production environments, ie config.action_mailer.smtp_settings. It didn't occur to me to do a "find in project" to see if there was a default way to do this in goldberg and just reused code from a recently converted rails 2 to rails 3 project.

srushti commented 12 years ago

Fair enough. I'll leave this open to until we fix the documentation so it's clearer where the configuration needs to be done.