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 #36256 - Allow user to force profile upload when changing host content view #10501

Merged

Conversation

jeremylenz
Copy link
Member

@jeremylenz jeremylenz commented Mar 30, 2023

What are the changes introduced in this pull request?

When changing a host's content view, normally the host's package and errata information isn't updated until the next package action or host check-in. This PR adds a checkbox allowing the user to force that update immediately, by running a subscription-manager command on the host via remote execution.

https://www.awesomescreenshot.com/video/16089294?key=99f6cd115d69a6ed97698284c4074dfe

Considerations taken when implementing this change?

Does this also require a change to the 'Change content source' workflow? I don't think so, because the job invocation that it provides already includes 'subscription-manager facts' which also updates the host. But double-check this to be safe :)

What are the testing steps for this pull request?

Check out the Foreman Remote Execution PR: theforeman/foreman_remote_execution#803

Load the updated job template: In rails console, run

ForemanInternal.all.first.destroy

Then run bundle exec rails db:seed and restart the server.

Check out this PR and go to the new host detail page > Content view card > Edit content view assignment

Test the following:

  1. REX job is started when you check the checkbox and click Save
  2. Content view card is updated with the new content view at the beginning of REX job
  3. You receive a toast notification when the job is completed
  4. On the errata card, Installable errata (NOT applicable errata) will update when the REX job completes
  5. The Recent Communication card will update with the new "Last check-in" time
  6. None of this happens when you don't check the checkbox

@theforeman-bot
Copy link

Issues: #36256

@jeremylenz
Copy link
Member Author

[test katello]

@jeremylenz
Copy link
Member Author

@sjha4 Updated 👍

Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

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

Ack..Works great..Rex job gets started and updates the /etc/yum.repos.d/redhat.repo file with checkbox checked, updates last checkin and errata cards. Old behavior when left uncehecked as expected. 👍🏼

@jeremylenz jeremylenz force-pushed the 36256-update-content-view-immediately branch from 8ee6f53 to a5f0d6f Compare April 4, 2023 20:15
@jeremylenz jeremylenz merged commit 18d404c into Katello:master Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants