Hello community, here is the log from the commit of package yast2-registration for openSUSE:Factory checked in at 2019-03-21 09:51:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old) and /work/SRC/openSUSE:Factory/.yast2-registration.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-registration" Thu Mar 21 09:51:31 2019 rev:34 rq:685972 version:4.1.21 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes 2019-03-04 09:15:46.412650665 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-registration.new.28833/yast2-registration.changes 2019-03-21 09:51:33.410817145 +0100 @@ -1,0 +2,15 @@ +Fri Mar 15 18:03:43 UTC 2019 - Ladislav Slezak <[email protected]> + +- Run the solver to correctly initialize the product statuses + (fixes displaying SUMA RN during a SLES upgrade) (bsc#1129029) +- 4.1.21 + +------------------------------------------------------------------- +Sun Mar 10 18:58:40 UTC 2019 - [email protected] + +- Permit to retry the registration in case of a timeout or a json + parse error and hide the error details which will be accesible + through the 'details' button (bsc#1058375, bsc#1126045). +- 4.1.20 + +------------------------------------------------------------------- Old: ---- yast2-registration-4.1.19.tar.bz2 New: ---- yast2-registration-4.1.21.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.449d6R/_old 2019-03-21 09:51:34.818816764 +0100 +++ /var/tmp/diff_new_pack.449d6R/_new 2019-03-21 09:51:34.838816759 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.1.19 +Version: 4.1.21 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-registration-4.1.19.tar.bz2 -> yast2-registration-4.1.21.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/package/yast2-registration.changes new/yast2-registration-4.1.21/package/yast2-registration.changes --- old/yast2-registration-4.1.19/package/yast2-registration.changes 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/package/yast2-registration.changes 2019-03-18 10:12:22.000000000 +0100 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Fri Mar 15 18:03:43 UTC 2019 - Ladislav Slezak <[email protected]> + +- Run the solver to correctly initialize the product statuses + (fixes displaying SUMA RN during a SLES upgrade) (bsc#1129029) +- 4.1.21 + +------------------------------------------------------------------- +Sun Mar 10 18:58:40 UTC 2019 - [email protected] + +- Permit to retry the registration in case of a timeout or a json + parse error and hide the error details which will be accesible + through the 'details' button (bsc#1058375, bsc#1126045). +- 4.1.20 + +------------------------------------------------------------------- Fri Mar 1 09:50:20 UTC 2019 - [email protected] - Skip SLP discovery when going back after registering the system, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/package/yast2-registration.spec new/yast2-registration-4.1.21/package/yast2-registration.spec --- old/yast2-registration-4.1.19/package/yast2-registration.spec 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/package/yast2-registration.spec 2019-03-18 10:12:22.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.1.19 +Version: 4.1.21 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/src/lib/registration/connect_helpers.rb new/yast2-registration-4.1.21/src/lib/registration/connect_helpers.rb --- old/yast2-registration-4.1.19/src/lib/registration/connect_helpers.rb 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/src/lib/registration/connect_helpers.rb 2019-03-18 10:12:22.000000000 +0100 @@ -82,11 +82,10 @@ log.error "Timeout error: #{e.message}" # FIXME: to not break existing translation, this typo should be fixed # later after SP2: time -> timed - Yast::Report.Error( - error_with_details(message_prefix + _("Connection time out.") + "\n", - _("Make sure that the registration server is reachable and\n" \ - "the connection is reliable.")) - ) + retry if report_error_and_retry?(message_prefix + _("Connection time out."), + _("Make sure that the registration server is reachable and\n" \ + "the connection is reliable.")) + false rescue SUSE::Connect::ApiError => e log.error "Received error: #{e.response.inspect}" @@ -142,7 +141,8 @@ log.error "JSON parse error" # update the message when an old SMT server is found check_smt_api(e.message) - report_error(message_prefix + _("Cannot parse the data from server."), e.message) + details_error(message_prefix + _("Cannot parse the data from server."), e.message) + false rescue StandardError => e log.error("SCC registration failed: #{e.class}: #{e}, #{e.backtrace}") Yast::Report.Error( @@ -157,6 +157,24 @@ Yast::Report.Error(error_with_details(msg, error_message)) end + def self.details_error(msg, error_message, retry_button: false) + if Yast::Mode.auto + report_error(msg, error_message) + else + buttons = + if retry_button + { retry: Yast::Label.RetryButton, cancel: Yast::Label.CancelButton } + else + :ok + end + Yast2::Popup.show(msg, details: error_message, headline: :error, buttons: buttons) + end + end + + def self.report_error_and_retry?(msg, details_message) + details_error(msg, details_message, retry_button: true) == :retry + end + # Report a pkg-bindings error. Display a message with error details from # libzypp. # @param msg [String] error message (translated) @@ -295,7 +313,7 @@ if Yast::NetworkService.isNetworkRunning # FIXME: use a better message, this one has been reused after the text freeze report_error(message_prefix + _("Invalid URL."), e.message) - elsif Helpers.network_configurable && !(Yast::Mode.autoinst || Yast::Mode.autoupgrade) + elsif Helpers.network_configurable && !Yast::Mode.auto if Yast::Popup.YesNo( # Error popup _("Network is not configured, the registration server cannot be reached.\n" \ @@ -338,6 +356,7 @@ end private_class_method :report_error, :error_with_details, :import_ssl_certificate, - :report_ssl_error, :check_smt_api, :handle_network_error + :report_ssl_error, :check_smt_api, :handle_network_error, :details_error, + :report_error_and_retry? end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/src/lib/registration/registration_ui.rb new/yast2-registration-4.1.21/src/lib/registration/registration_ui.rb --- old/yast2-registration-4.1.19/src/lib/registration/registration_ui.rb 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/src/lib/registration/registration_ui.rb 2019-03-18 10:12:22.000000000 +0100 @@ -54,8 +54,10 @@ # items: boolean (true on success), remote service (or nil) def register_system_and_base_product product_service = nil + # TRANSLATORS: Popup error message prefix + error_options = { message_prefix: _("Registration failed.") + "\n\n" } - success = ConnectHelpers.catch_registration_errors do + success = ConnectHelpers.catch_registration_errors(error_options) do register_system if !Registration.is_registered? # then register the product(s) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/src/lib/registration/sw_mgmt.rb new/yast2-registration-4.1.21/src/lib/registration/sw_mgmt.rb --- old/yast2-registration-4.1.19/src/lib/registration/sw_mgmt.rb 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/src/lib/registration/sw_mgmt.rb 2019-03-18 10:12:22.000000000 +0100 @@ -589,6 +589,9 @@ select_default_product_patterns unless Mode.update + # run the solver to recalculate the product statuses + Pkg.PkgSolve(false) + ret end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/test/connect_helpers_spec.rb new/yast2-registration-4.1.21/test/connect_helpers_spec.rb --- old/yast2-registration-4.1.19/test/connect_helpers_spec.rb 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/test/connect_helpers_spec.rb 2019-03-18 10:12:22.000000000 +0100 @@ -46,18 +46,51 @@ expect(ret).to eq(false) end - it "reports an error with details on timeout" do - details = _("Make sure that the registration server is reachable and\n" \ - "the connection is reliable.") - - expect(subject).to receive(:wrap_text).with("Details: #{details}", screen_width - 4) - .and_return("Details wrapped text") - expect(Yast::Report).to receive(:Error).with( - "Registration: " + _("Connection time out.") + "\n\n\nDetails wrapped text" - ) + context "on timeout" do + let(:details) do + _("Make sure that the registration server is reachable and\n" \ + "the connection is reliable.") + end + let(:autoinst) { false } - helpers.catch_registration_errors(message_prefix: "Registration: ") do - raise Timeout::Error + before do + allow(Yast::Mode).to receive(:autoinst).and_return(:autoinst?) + end + + context "and in AutoYaST mode" do + let(:autoinst?) { true } + + it "reports an error with details on timeout" do + expect(subject).to receive(:wrap_text).with("Details: #{details}", screen_width - 4) + .and_return("Details wrapped text") + expect(Yast::Report).to receive(:Error).with( + "Registration: " + _("Connection time out.") + "\n\nDetails wrapped text" + ) + + helpers.catch_registration_errors(message_prefix: "Registration: ") do + raise Timeout::Error + end + end + end + + context "and in a common installation" do + it "shows an error dialog with a retry and details button" do + expect(helpers).to receive(:report_error_and_retry?) + .with("Registration: " + _("Connection time out."), details) + + helpers.catch_registration_errors(message_prefix: "Registration: ") do + raise Timeout::Error + end + end + + it "retries the given block if selected by the user" do + expect(helpers).to receive(:report_error_and_retry?).twice + .with("Registration: " + _("Connection time out."), details).and_return(true, false) + + helpers.catch_registration_errors(message_prefix: "Registration: ") do + raise Timeout::Error + end + end end end @@ -110,7 +143,28 @@ end context "JSON parse error is received" do - include_examples "old registration server", JSON::ParserError.new("error message") + let(:autoinst?) { true } + + before do + allow(Yast::Mode).to receive(:autoinst).and_return(autoinst?) + allow(Registration::UrlHelpers).to receive(:registration_url) + .and_return(SUSE::Connect::YaST::DEFAULT_URL) + end + + include_examples "old registration server", JSON::ParserError.new("error message") + + context "and in interactive installation" do + let(:autoinst?) { false } + + it "hiddes the error details in a details button" do + expect(helpers).to receive(:details_error) + .with("Registration: " + _("Cannot parse the data from server."), "error message") + + helpers.catch_registration_errors(message_prefix: "Registration: ") do + raise JSON::ParserError, "error message" + end + end + end end [400, 401, 500, 42].each do |error_code| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/test/registration/ui/failed_certificate_popup_test.rb new/yast2-registration-4.1.21/test/registration/ui/failed_certificate_popup_test.rb --- old/yast2-registration-4.1.19/test/registration/ui/failed_certificate_popup_test.rb 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/test/registration/ui/failed_certificate_popup_test.rb 2019-03-18 10:12:22.000000000 +0100 @@ -34,6 +34,7 @@ before do allow(Yast::Report).to receive(:LongError) allow(Yast::Stage).to receive(:initial).and_return(false) + allow(Registration::UrlHelpers).to receive(:registration_url) end # the instance method diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.19/test/sw_mgmt_spec.rb new/yast2-registration-4.1.21/test/sw_mgmt_spec.rb --- old/yast2-registration-4.1.19/test/sw_mgmt_spec.rb 2019-03-01 13:40:15.000000000 +0100 +++ new/yast2-registration-4.1.21/test/sw_mgmt_spec.rb 2019-03-18 10:12:22.000000000 +0100 @@ -336,6 +336,7 @@ allow(Yast::Pkg).to receive(:ResolvableProperties) .and_return(load_yaml_fixture("products_legacy_installation.yml")) allow(Yast::Pkg).to receive(:ResolvableInstall).with("sle-module-legacy", :product) + allow(Yast::Pkg).to receive(:PkgSolve) end it "selects new addon products for installation" do @@ -349,6 +350,12 @@ subject.select_addon_products(legacy_services) end + + it "runs the solver to initialize the product statuses" do + expect(Yast::Pkg).to receive(:PkgSolve) + + subject.select_addon_products(legacy_services) + end context "when no services list is given" do before do
