Skip to content

Commit

Permalink
[api] get rid of "removed" operation state for binary tracking
Browse files Browse the repository at this point in the history
the obsolete tag is enough and we do not want to override existing data
in operation element
  • Loading branch information
adrianschroeter committed Sep 17, 2014
1 parent 39742b4 commit c84a0ae
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions docs/api/api/binary_released.rng
Expand Up @@ -44,8 +44,7 @@
<element name="operation">
<choice>
<value>added</value> <!-- this is a new binary -->
<value>removed</value> <!-- this binary got removed later. check obsolete time. -->
<value>modified</value> <!-- this binary modified a former released one, which became obsolete -->
<value>modified</value> <!-- this binary modifies a former released one, which became obsolete -->
</choice>
</element>
<optional>
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/binary_release.rb
Expand Up @@ -188,7 +188,6 @@ def self.update_binary_releases_via_json(repository, json, time = Time.now)
# and mark all not processed binaries as removed
oldlist.each do |e|
next if processed_item[e.id]
e.operation = "removed"
e.obsolete_time = time
e.save!
end
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/fixtures/binary_releases.yml
Expand Up @@ -20,7 +20,7 @@ BaseDistro3_BaseDistro3_repo:
BaseDistro3_BaseDistro3_repo_droped:
id: 2
repository_id: 93
operation: 'removed'
operation: 'added'
obsolete_time: 2013-09-31 15:50:30.000000000 Z
binary_name: dropped
binary_version: 1.0
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/maintenance_test.rb
Expand Up @@ -673,7 +673,7 @@ def test_mbranch_and_maintenance_per_package_request
:tag => 'operation', :content => "added"
assert_xml_tag :parent => { :tag => 'binary', :attributes =>
{ name: 'dropped', project: "BaseDistro3", repository: "BaseDistro3_repo", arch: "i586" } },
:tag => 'operation', :content => "removed"
:tag => 'operation', :content => "added"

# search via official updateinfo id tag
get '/search/released/binary', match: "updateinfo/@id = 'UpdateInfoTagNew-patch_name-#{Time.now.utc.year.to_s}-1'"
Expand Down

0 comments on commit c84a0ae

Please sign in to comment.