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

Fixes #36789 - Add actions to force applicability refresh #10757

Merged

Conversation

jeremylenz
Copy link
Member

@jeremylenz jeremylenz commented Sep 29, 2023

Goes with theforeman/foreman#9847

What are the changes introduced in this pull request?

Until now, the 'Recalculate' button on the Errata tab only did the server-side recalculation. This means that if you've changed the host content view, content overrides, etc. it might use an out-of-date installed package list to calculate applicability.

See https://community.theforeman.org/t/list-of-packages-to-install-not-up-to-date/35153

In this PR, we add new kebab actions to the host details page:

  • main kebab - 'Refresh applicability'
  • Packages kebab - 'Refresh package applicability'
  • Errata kebab - 'Refresh errata applicability'. This replaces the "Recalculate" button on the Errata kebab.
  • Errata happy empty state - 'Refresh errata applicability' link. This replaces the 'Recalculate' link that was recently added.

The button will do the same thing in all four places - run 'subscription-manager repos' on the host via REX. This will also trigger (as it always has) errata applicability recalculation, and the web UI will be updated immediately.

Considerations taken when implementing this change?

Turns out the hardest part of this was getting the main kebab menu to close when you click on it. Never woulda thought. (See the linked PR) I considered several solutions including Redux and slot and fill, but the React context solution I arrived at seems the most elegant.

On the ErrataTab, the new action replaces the "Recalculate" action, which used to just do the server-side recalculation. We thought this is what most users would want, since recalculating without refreshing the host's installed package list is only useful in certain situations.

Server-side-only recalculation will still be available via Hammer. (maybe we should also make that available as a host bulk action in the new UI)

What are the testing steps for this pull request?

Check out theforeman/foreman#9847 in Foreman
Get REX working on at least one host
Test the recalculate action in all three places
Make sure everything works

@theforeman-bot
Copy link

Issues: #36789

@jeremylenz jeremylenz force-pushed the 36789-sub-man-repos-all-day-every-day branch from d7ea735 to ee15098 Compare October 3, 2023 20:36
@jeremylenz
Copy link
Member Author

rebased after merging #10756

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Working great! We'll probably want to make sure that there's some documentation around this change at Katello 4.11 release time.

Is it okay to assume that users will have remote execution set up? The applicability calculation button is sorta useless now since we always update applicability unless there is some error, so I think it's okay. Just makes me wonder if users are going to miss the old button for whatever reason.

@jeremylenz
Copy link
Member Author

Is it okay to assume that users will have remote execution set up? The applicability calculation button is sorta useless now since we always update applicability unless there is some error, so I think it's okay. Just makes me wonder if users are going to miss the old button for whatever reason.

I think it's somewhat safe to assume that REX is present, since it's now the only way to patch hosts with Katello and is included by default with Satellite. I suppose I could make sure to hide the actions if REX isn't enabled; let me know if you want me to add that.

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

@jeremylenz after some thought I think this is good as-is. Mind just putting in a request for a docs update to warn that server-side applicability calcs are going hammer-only? Probably a release note. I can't believe that that button is useful for anyone anymore, especially after the move to Pulp 3.

@jeremylenz jeremylenz merged commit a578284 into Katello:master Oct 12, 2023
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