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

[RHELC-1330] Port list_non_red_hat_pkgs_left to Action framework #1292

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

jochapma
Copy link
Contributor

@jochapma jochapma commented Jul 5, 2024

Port list_non_red_hat_pkgs_left to the Action framework

Jira Issues:

Checklist

  • PR has been tested manually in a VM (either author or reviewer)
  • Jira issue has been made public if possible
  • [RHELC-] or [HMS-] is part of the PR title
  • GitHub label has been added to help with Release notes
  • PR title explains the change from the user's point of view
  • Code and tests are documented properly
  • The commits are squashed to as few commits as possible (without losing data)
  • When merged: Jira issue has been updated to Release Pending if relevant

@jochapma jochapma added enhancement New feature or request tests-run-sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. labels Jul 5, 2024
@has-bot
Copy link
Member

has-bot commented Jul 5, 2024

/packit test --labels sanity


Comment generated by an automation.

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.18%. Comparing base (b7ddd96) to head (6f5692f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1292      +/-   ##
==========================================
+ Coverage   96.13%   96.18%   +0.04%     
==========================================
  Files          57       58       +1     
  Lines        4818     4826       +8     
  Branches      846      847       +1     
==========================================
+ Hits         4632     4642      +10     
+ Misses        107      106       -1     
+ Partials       79       78       -1     
Flag Coverage Δ
centos-linux-7 91.44% <100.00%> (+0.05%) ⬆️
centos-linux-8 92.36% <100.00%> (+0.05%) ⬆️
centos-linux-9 92.40% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Red Hat-signed ones during the conversion.
"""
super(ListNonRedHatPkgsLeft, self).run()
pkghandler.list_non_red_hat_pkgs_left()
Copy link
Member

Choose a reason for hiding this comment

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

Since this is used only for this action, we can move the code from list_non_red_hat_pkgs_left to run inside this run method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deliberately didn't do that because I thought we were moving towards having all the package management stuff in pkgmanager (so we move all the code that makes decisions about yum vs dnf into a nice polymorphic OO system).

Copy link
Member

Choose a reason for hiding this comment

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

We will, eventually. But this function does not contain any difficult logic for yum/dnf to be ported. It is merely getting the packages from the system based on the gpg fingerprint and then printing it's information.

What I meant was to just do:

run(self): 
   loggerinst.info("Listing packages not signed by Red Hat")
   non_red_hat_pkgs = get_installed_pkgs_w_different_fingerprint(system_info.fingerprints_rhel)
   if non_red_hat_pkgs:
      loggerinst.info("The following packages were left unchanged.\n")
      print_pkg_info(non_red_hat_pkgs)
   else:
      loggerinst.info("All packages are now signed by Red Hat.")

@jochapma jochapma marked this pull request as ready for review July 18, 2024 13:56
Copy link
Member

@r0x0d r0x0d left a comment

Choose a reason for hiding this comment

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

Looks very good!

@pre-commit-ci pre-commit-ci bot requested a review from a team as a code owner August 6, 2024 13:54
@r0x0d
Copy link
Member

r0x0d commented Aug 7, 2024

/packit test --labels sanity

@pr-watson pr-watson changed the title [RHEL-1330] Port list_non_red_hat_pkgs_left to Action framework [RHELC-1330] Port list_non_red_hat_pkgs_left to Action framework Aug 7, 2024
@Venefilyn
Copy link
Member

@jochapma merge conflicts here to take care of. Once fixed and the rpm builds are done, retrigger tests in a comment

@r0x0d
Copy link
Member

r0x0d commented Aug 8, 2024

@jochapma merge conflicts here to take care of. Once fixed and the rpm builds are done, retrigger tests in a comment

Ando also remove the merge commits, thanks!

Copy link
Member

@r0x0d r0x0d left a comment

Choose a reason for hiding this comment

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

Looks good! Just please remove the merge commits.

@jochapma
Copy link
Contributor Author

jochapma commented Aug 8, 2024

/packit build

@jochapma
Copy link
Contributor Author

jochapma commented Aug 8, 2024

/packit test --labels sanity

@r0x0d
Copy link
Member

r0x0d commented Aug 12, 2024

/packit test --labels sanity

@jochapma jochapma merged commit 3ee8b8f into oamg:main Aug 12, 2024
29 checks passed
@jochapma jochapma deleted the bugs/rhelc-1330 branch August 12, 2024 14:24
pr-watson pushed a commit to pr-watson/convert2rhel that referenced this pull request Aug 13, 2024
…g#1292)

Port list_non_red_hat_pkgs_left to Action framework.

---------

Co-authored-by: Rodolfo Olivieri <[email protected]>
This was referenced Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request merge-after-tests-ok tests-run-sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants