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

spacecmd: speedup softwarechannel_removepackages #9128

Conversation

agraul
Copy link
Member

@agraul agraul commented Jul 31, 2024

What does this PR change?

Speedup softwarechannel_removepackages

Instead of converting the list of dictionaries to strings and later find each package db id from the local cache (which needs to be built first), we can build ourselves a dictionary with the same package name string as the key and the id as the value. This approach bypasses building the cache. A request to list all packages for the requested channel takes place either way and did not use the cache.

GUI diff

No difference.

  • DONE

Documentation

  • No documentation needed: only internal and user invisible changes

  • DONE

Test coverage

  • Unit tests were added

  • DONE

Links

Issue(s): https://github.com/SUSE/spacewalk/issues/24775
Port(s): https://github.com/SUSE/spacewalk/pull/24973, https://github.com/SUSE/spacewalk/pull/25203

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

Before you merge

Check How to branch and merge properly!

@agraul agraul requested a review from a team as a code owner July 31, 2024 11:56
@agraul agraul requested review from ycedres and removed request for a team July 31, 2024 11:56
Copy link
Contributor

@vzhestkov vzhestkov left a comment

Choose a reason for hiding this comment

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

LGTM 👍 and thanks for changing the naming of the values to make it more clear

@agraul agraul changed the title spacecmd: test softwarechannel_removepackages spacecmd: speedup softwarechannel_removepackages Aug 5, 2024
@agraul agraul removed the request for review from m-czernek August 5, 2024 12:06
@agraul agraul added the merge-candidate Meaning it needs to be considered for merging when the master branch is frozen label Aug 5, 2024
Copy link
Contributor

@ycedres ycedres left a comment

Choose a reason for hiding this comment

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

LGTM!

Instead of converting the list of dictionaries to strings and later find
each package db id from the local cache (which needs to be built first),
we can build ourselves a dictionary with the same package name string as
the key and the id as the value. This approach bypasses building the
cache. A request to list all packages for the requested channel takes
place either way and did not use the cache.

Fixes bsc#1227606
@agraul agraul force-pushed the spacecmd-speedup-softwarechannel_removepackages branch from 484ef89 to 2148e0e Compare September 5, 2024 12:42
@deneb-alpha deneb-alpha merged commit a52ccf6 into uyuni-project:master Sep 6, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-candidate Meaning it needs to be considered for merging when the master branch is frozen needs-translation python3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants