Project

General

Profile

"Invalid RSS Feed" on Simple CI plugin to TeamCity feed.

Added by Ted Lilley over 14 years ago

Since I'm unfamiliar with troubleshooting Redmine, I'm mostly looking for info on how to find more specifics as to where the problem might lie.

I've followed the directions for installing the Simple CI plugin and when trying to read a build feed from JetBrains TeamCity.

It's an RSS 2.0 feed that correctly updates Outlook. So the feed appears to be working. I closely followed the installation directions (I remembered to restart the Redmine service despite the fact that the instructions skip that). I also noted one difference, that the project property is specified as "string" in the directions, but I was only allowed to choose "Text" or "Long Text" in the UI. I figured this was no big deal and went with text.

I also tried making sure that a build was done after configuring the URL so the plugin would have something to process, but no dice.

I'm running Bitnami Redmine 0.8.4 on Windows.

Any idea on where to look for a more specific error message? Seems like I'm close to the finish line, but not quite there.

Thanks,

Ted


Replies (3)

RE: "Invalid RSS Feed" on Simple CI plugin to TeamCity feed. - Added by Mark B over 14 years ago

I had the same problem. Simple CI expects your feed to use RSS. Unfortunately, TeamCity delivers your feed as Atom.

I'm a Java programmer, and I've never written a line of Ruby in my life before today. So, this might be all wrong, but I modified the file simple_ci_controller.rb in <REDMINE_HOME>/vendor/plugins/simple_ci/app/controllers to use the feed-normalizer Ruby gem, instead of RSS/1.0 and RSS/2.0. Now it can read Atom feeds as well as RSS feeds. In other words, it works fine with TeamCity. Here's the modified code. Use it at your own risk.

@require 'feed-normalizer'
require 'open-uri'

class SimpleCiController < ApplicationController
layout 'base'
before_filter :find_project, :authorize

def show
  # Build the regular expression used to detect successfull builds
success_re = Regexp.new(Setting.plugin_simple_ci['success_keyword'].strip, Regexp::IGNORECASE) # Find the project's CI RSS feed URL # This URL is stored in a 'regular' project custom field
feed_url = @project.custom_values.detect {|v| v.custom_field_id == Setting.plugin_simple_ci['feed_url_custom_field'].to_i}
feed_url = feed_url.value if feed_url
if !feed_url.blank?
begin
content = '' # Open the feed and parse it
rss = FeedNormalizer::FeedNormalizer.parse open(feed_url.strip)
if rss
@builds = rss.entries.collect do |item|
build = {
:time => item.date_published,
:title => item.title,
:description => item.description,
:link => item.url
}
build[:success] = (success_re.match(item.title) ? true : false)
build
end
else
flash.now[:error] = 'Invalid RSS feed.' unless @builds
end
rescue SocketError
flash.now[:error] = 'Unable to connect to remote host.'
end
@show_descriptions = Setting.plugin_simple_ci[:show_descriptions].to_i
else
flash.now[:error] = 'The feed URL is not defined for this project.'
end
end

private
def find_project
project = Project.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
end

RE: "Invalid RSS Feed" on Simple CI plugin to TeamCity feed. - Added by Mark B over 14 years ago

ugh. sorry.

I think the x x in the code messed up the quoting, but you get the idea.

RE: "Invalid RSS Feed" on Simple CI plugin to TeamCity feed. - Added by Mark B over 14 years ago

here. i attached the file.

You can back up your old one in <REDMINE_HOME>/vendor/plugins/simple_ci/app/controllers and replace it with this one. Make sure you have the feed-normalizer ruby gem installed.

    (1-3/3)