Skip to content

Commit

Permalink
[api] report also operation on binary release search results
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jul 9, 2014
1 parent c44e33b commit c4ce2b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/api/app/models/binary_release.rb
Expand Up @@ -45,6 +45,7 @@ def render_xml
builder = Nokogiri::XML::Builder.new
builder.binary(render_attributes) do |b|
r={}
b.operation self.operation
if self.release_package
# r[:project] = self.release_package.project.name # pointless, it is our binary project
r[:package] = self.release_package.name
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/repository.rb
Expand Up @@ -92,7 +92,7 @@ def update_binary_releases_via_json(json, time = Time.now)
existing = oldlist.where(hash)
raise SaveError if existing.count > 1

# complete data
# compare with existing entry
if existing.count == 1
entry = existing.first
if entry.binary_disturl == binary["disturl"] and
Expand Down
10 changes: 10 additions & 0 deletions src/api/test/functional/maintenance_test.rb
Expand Up @@ -638,6 +638,16 @@ def test_mbranch_and_maintenance_per_package_request
:tag => 'disturl', :content => "obs://testsuite/BaseDistro/repo/ce167c27b536e6ca39f8d951fa02a4ff-package"
assert_xml_tag :tag => 'product', :attributes => { project: "BaseDistro", name: "fixed" }

assert_xml_tag :parent => { :tag => 'binary', :attributes =>
{ name: 'package', project: "BaseDistro3", repository: "BaseDistro3_repo", arch: "i586" } },
:tag => 'operation', :content => "modified"
assert_xml_tag :parent => { :tag => 'binary', :attributes =>
{ name: 'package', project: "BaseDistro3", repository: "BaseDistro3_repo", arch: "src" } },
:tag => 'operation', :content => "added"
assert_xml_tag :parent => { :tag => 'binary', :attributes =>
{ name: 'dropped', project: "BaseDistro3", repository: "BaseDistro3_repo", arch: "i586" } },
:tag => 'operation', :content => "removed"

#cleanup
login_king
delete '/source/BaseDistro3Channel'
Expand Down

0 comments on commit c4ce2b2

Please sign in to comment.