Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch scc request timeout exception #64

Merged
merged 11 commits into from
Mar 26, 2024

Conversation

lcaparroz
Copy link
Collaborator

@lcaparroz lcaparroz commented Mar 1, 2024

Problem

Sync changes from branch SLE-15-SP6 to master.

Test

You can use the same instructions given on the Pull Request above, but using a container with a Tumbleweed image:

# Image: registry.opensuse.org/yast/head/containers_tumbleweed/yast-ruby

docker run -v "$(pwd):/usr/src/app" -w "/usr/src/app" -it registry.opensuse.org/yast/head/containers_tumbleweed/yast-ruby sh

lcaparroz and others added 6 commits February 8, 2024 16:23
This commit adds proper timeout exception treatment on the method
`RMT::WizardSCCPage#scc_credentials_valid?`:

* Before: an "Internal error" message would be shown if a request timed
  out when contacting SCC to validate the credentials.
* Now: a popup dialog will be shown, giving the user the choice to retry
  the request or cancel the operation.

Additionally, the request has been enriched with a proper "user agent"
to allow better debugging with SCC.
To enhance the 'User-Agent' used in the request headers, this commit
adds the module constant `RMT::Version`, which must always match the
package version specified in 'package/yast2-rmt.spec'.

Additionally, a unit test was created to ensure the versions always
match each other; if there is a version bump in packge spec file, the
RSpec tests will break if 'src/lib/rmt.rb' is not updated accordingly.
@lcaparroz lcaparroz changed the title Catch scc request timeout exception master Catch scc request timeout exception Mar 1, 2024
@coveralls
Copy link

coveralls commented Mar 1, 2024

Pull Request Test Coverage Report for Build 8359903887

Details

  • 62 of 62 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 98.556%

Totals Coverage Status
Change from base Build 6769267296: 0.04%
Covered Lines: 1638
Relevant Lines: 1662

💛 - Coveralls

This commit updates the gem version of 'bundler' to match the one
provided in Tumbleweed.
This commit removes the gem 'scc-codestyle' from the project, and adds
'rubocop-rspec' as a direct dependency to continue having the a similar
set of linter rules.

The 'scc-codestyle' version in use was too outdated, and updating it to
a newer one would require a heavy restyling of the code.
After removing the gem 'scc-codestyle' (outdated version), Rubocop's
default configuration caused a lot of warnings/errors when linting the
project.

This commit adds rules to 'rubocop.yml' so that the current code passes
the linting process in the CI. Though I agree some of the rules are
important to keep a good style for the project, the idea is just to
adjust our CI process for Tumbleweed at the moment.
This commit bumps the Rubocop gem version to the latest one that is
supported for ruby 2.5 (system version for SLES 15 SP6), according to
the information available at:

https://docs.rubocop.org/rubocop/compatibility.html
@lcaparroz lcaparroz force-pushed the catch-scc-request-timeout-exception-master branch from 38f1f42 to 84fc4b2 Compare March 20, 2024 13:33
Copy link
Collaborator

@ngetahun ngetahun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lcaparroz lcaparroz merged commit c5ca0d0 into master Mar 26, 2024
8 checks passed
@lcaparroz lcaparroz deleted the catch-scc-request-timeout-exception-master branch March 26, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants