Skip to content

Commit

Permalink
Merge pull request #197 from SUSE/fix_duplicate_migrations
Browse files Browse the repository at this point in the history
Fix duplicate migration paths
  • Loading branch information
ikapelyukhin authored Jul 2, 2018
2 parents c430086 + aa15e6e commit 30e4fe2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = rmt-server
VERSION = 1.0.2
VERSION = 1.0.3

all:
@:
Expand Down
1 change: 1 addition & 0 deletions app/models/migration_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def sort_migrations(migrations)
.map { |migration| sort_migration(migration) }
.sort_by { |migration| migration.map(&:version) }
.reverse!
.uniq
end

# we sort the migration products, so clients will activate them in the right dependency order
Expand Down
2 changes: 1 addition & 1 deletion lib/rmt.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module RMT
VERSION ||= '1.0.2'.freeze
VERSION ||= '1.0.3'.freeze

DEFAULT_USER = '_rmt'.freeze
DEFAULT_GROUP = 'nginx'.freeze
Expand Down
6 changes: 6 additions & 0 deletions package/rmt-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 27 12:18:16 UTC 2018 - [email protected]

- Version 1.0.3
- Fix duplicate migration paths (bsc#1097824)

-------------------------------------------------------------------
Tue Jun 19 15:01:19 UTC 2018 - [email protected]

Expand Down
2 changes: 1 addition & 1 deletion package/rmt-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
%define is_sle_12_family 1
%endif
Name: rmt-server
Version: 1.0.2
Version: 1.0.3
Release: 0
Summary: Repository mirroring tool and registration proxy for SCC
License: GPL-2.0-or-later
Expand Down
9 changes: 9 additions & 0 deletions spec/models/migration_engine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -463,4 +463,13 @@
end
end
end

describe '#sort_migrations' do
let(:installed_products) { [sle12] }
let(:system) { FactoryGirl.create(:system, :with_activated_base_product) }

it 'removes duplicate migration paths' do
expect(engine.send(:sort_migrations, [[sle12], [sle12], [sle12]])).to eq([[sle12]])
end
end
end

0 comments on commit 30e4fe2

Please sign in to comment.