Merge pull request #311 from travis-ci/fix_sentry_errors

Fix sentry errors
This commit is contained in:
Renée Hendricksen 2016-08-14 20:51:11 -04:00 committed by GitHub
commit a9f84c27b0
3 changed files with 7 additions and 6 deletions

View File

@ -4,15 +4,15 @@ module Travis::Api::App::Responders
class Atom < Base class Atom < Base
ATOM_FEED_ERB = ERB.new <<-EOF ATOM_FEED_ERB = ERB.new <<-EOF
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<title><%= resource.first.repository.slug %> Builds</title> <title><%= resource.first.repository.slug %> Builds</title>
<link href="<%= endpoint.url %>" type="application/atom+xml" rel = "self" /> <link href="<%= endpoint.url %>" type="application/atom+xml" rel = "self" />
<id>repo:<%= resource.first.repository.id %></id> <id>repo:<%= resource.first.repository.id %></id>
<rights>Copyright (c) <%= DateTime.now.strftime("%Y") %> Travis CI GmbH</rights> <rights>Copyright (c) <%= DateTime.now.strftime("%Y") %> Travis CI GmbH</rights>
<updated><%= DateTime.now.rfc3339 %></updated> <updated><%= DateTime.now.rfc3339 %></updated>
<% resource.each do |build| %> <% resource.each do |build| %>
<entry> <entry>
<title><%= build.repository.slug %> Build #<%= build.number %></title> <title><%= build.repository.slug %> Build #<%= build.number %></title>
@ -21,7 +21,7 @@ module Travis::Api::App::Responders
<updated><%= ::DateTime.parse(build.updated_at.to_s).rfc3339 %></updated> <updated><%= ::DateTime.parse(build.updated_at.to_s).rfc3339 %></updated>
<summary type="html"> <summary type="html">
&lt;p&gt; &lt;p&gt;
<%= build.commit.message.encode(:xml => :text) %> (<%= build.commit.committer_name %>) <%= build.commit.message.encode(:xml => :text) if build.commit.message %> (<%= build.commit.committer_name %>)
&lt;br/&gt;&lt;br/&gt; &lt;br/&gt;&lt;br/&gt;
State: <%= build.state %> State: <%= build.state %>
&lt;br/&gt; &lt;br/&gt;
@ -36,7 +36,7 @@ module Travis::Api::App::Responders
</author> </author>
</entry> </entry>
<% end %> <% end %>
</feed> </feed>
EOF EOF

View File

@ -123,7 +123,7 @@ module Travis
end end
def owner_key(feature, owner) def owner_key(feature, owner)
suffix = owner.class.table_name suffix = owner.class.table_name if owner
"#{key(feature)}:#{suffix}" "#{key(feature)}:#{suffix}"
end end

View File

@ -174,6 +174,7 @@ class Job < Travis::Model
end end
def normalize_config(config) def normalize_config(config)
config = YAML.load(config) if config.is_a? String
config = config ? config.deep_symbolize_keys : {} config = config ? config.deep_symbolize_keys : {}
if config[:deploy] if config[:deploy]