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 #37347 - Add Packages wizard to All Hosts page #10962

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jeremylenz
Copy link
Member

@jeremylenz jeremylenz commented Apr 16, 2024

Requires theforeman/foreman#10128

What are the changes introduced in this pull request?

Add the Packages Wizard to the new All Hosts page, based on designs.

image

There are 4 steps in the wizard:

  1. Select action
  2. Select packages to update / install
  3. Review hosts
  4. Review
  • Based on your selected action, step 2 may or may not be shown

And there are 3 flows:

  1. Update all packages
  2. Update packages
  3. Install packages

This also required adding features in Foreman React components, and adding new capabilities here:

  • Add :distinct and :select options to api_controller.rb so that you can get back a list distinct by package name. I had to write some SQL fragments myself since Active Record wasn't playing nice with .count.
  • Add errors in package_names_for_job_template if the package search turns up empty. This is to prevent the template from updating all packages when you only wanted to update one package.
  • Extend RemoteExecutionActions to handle host searches instead of just single hostnames
  • Extend customizedRexUrlHelpers to handle host searches instead of just single hostnames

Considerations taken when implementing this change?

For the wizard itself, I used the "React next" implementation in PF4. I thought this was a much cleaner API because of the handy wizardContext it provides, and also thought it might be easier to migrate once we move to PF5.

For most of the wizard, I use a React Context, BulkPackagesWizardContext, to share values between all the wizard steps and components. But the <HostReview> component should be reusable in other wizards, and using context would have made it nonreusable. So for <HostReview> I made sure not to use any context values, and instead passed all values through props.

Originally I had the useBulkSelect calls within each separate component (BulkPackagesTable and HostReview). And I was trying to share values by adding state to the top-level context. But I quickly realized that was a bad decision. Maybe surprisingly, things got a lot cleaner and more elegant once I moved both useBulkSelects to the top level.

What are the testing steps for this pull request?

  1. Test all the flows!!
  2. Make sure all the wizard step validations make sense
  3. When you're on step 4 (Review), make sure the "Edit" buttons both take you back to the appropriate step, and remember your selections
  4. Test both "via remote execution" and "via customized remote execution". The "via remote execution" should poll the job and give you a toast notification when the job is complete. "Via customized remote execution" will take you to the job wizard, where you can verify the host and package inputs are correct.
  5. Test other pages that use TableIndexPage, like HW Models, and make sure they still work

@jeremylenz jeremylenz force-pushed the 37347-packages-wizard branch 3 times, most recently from 7841521 to 9f40035 Compare April 30, 2024 13:25
@jeremylenz jeremylenz marked this pull request as ready for review April 30, 2024 13:26
@jeremylenz jeremylenz changed the title 37347 packages wizard Fixes #37347 - Add Packages wizard to All Hosts page Apr 30, 2024
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.

Seeing this following when hitting Next for all options except "Upgrade packages":
image

TypeError: isSelected is not a function
    in RowSelectTd (created by Table)
    in tr (created by TrBase)
    in TrBase (created by Tr)
    in Tr (created by Table)
    in tbody (created by TbodyBase)
    in TbodyBase (created by Tbody)
    in Tbody (created by Table)
    in table (created by TableComposableBase)
    in TableComposableBase (created by TableComposable)
    in TableComposable (created by Table)
    in Table (created by TableIndexPage)
    in section (created by PageSection)
    in PageSection (created by TableIndexPage)
    in div (created by TableIndexPage)
    in TableIndexPage (created by HostReview)
    in HostReview (created by BulkPackagesWizard)
    in div (created by WizardBody)
    in div (created by WizardBody)
    in WizardBody (created by WizardToggle)
    in div (created by WizardToggle)
    in div (created by WizardToggle)
    in WizardToggle (created by WizardInternal)
    in WizardInternal (created by Wizard)
    in div (created by Wizard)
    in WizardContextProvider (created by Wizard)
    in Wizard (created by BulkPackagesWizard)
    in BulkPackagesWizard (created by BulkPackagesWizardModal)
    in div (created by ModalBox)
    in ModalBox (created by ModalContent)
    in div (created by FocusTrap)
    in FocusTrap (created by ForwardRef)
    in ForwardRef (created by ModalContent)
    in div (created by Backdrop)
    in Backdrop (created by ModalContent)
    in ModalContent (created by Modal)
    in Modal (created by BulkPackagesWizardModal)
    in BulkPackagesWizardModal
    in Slot (created by ConnectFunction)
    in ConnectFunction (created by HostsIndex)
    in section (created by PageSection)
    in PageSection (created by TableIndexPage)
    in div (created by TableIndexPage)
    in TableIndexPage (created by HostsIndex)
    in HostsIndex (created by Context.Consumer)
    in Route (created by AppSwitcher)
    in Switch (created by ForemanSwitcher)
    in ForemanSwitcher (created by AppSwitcher)
    in AppSwitcher (created by ReactApp)
    in ErrorBoundary (created by ReactApp)
    in main (created by Page)
    in div (created by Page)
    in Page (created by Layout)
    in div (created by FlexItem)
    in FlexItem (created by Layout)
    in div (created by Flex)
    in Flex (created by Layout)
    in Layout (created by ConnectedLayout)
    in ConnectedLayout (created by ReactApp)
    in Router (created by ConnectedRouter)
    in ConnectedRouter (created by Context.Consumer)
    in ConnectedRouterWithContext (created by ConnectFunction)
    in ConnectFunction (created by ReactApp)
    in ApolloProvider (created by ReactApp)
    in div (created by ReactApp)
    in ReactApp (created by I18nProviderWrapper(ReactApp))
    in IntlProvider (created by I18nProviderWrapper(ReactApp))
    in I18nProviderWrapper(ReactApp) (created by StoreProvider(I18nProviderWrapper(ReactApp)))
    in Provider (created by StoreProvider(I18nProviderWrapper(ReactApp)))
    in StoreProvider(I18nProviderWrapper(ReactApp)) (created by DataProvider(StoreProvider(I18nProviderWrapper(ReactApp))))
    in DataProvider(StoreProvider(I18nProviderWrapper(ReactApp)))
    in AwaitedMount

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.

The "Cancel" button seems to be non-functional

@jeremylenz
Copy link
Member Author

The "Cancel" button seems to be non-functional

oh yeah I've been meaning to fix that 😄 I think it works on the review page at least

@jeremylenz
Copy link
Member Author

Seeing this following when hitting Next for all options except "Upgrade packages":

Do you have the Foreman PR checked out?

@ianballou
Copy link
Member

Do you have the Foreman PR checked out?

That must be it :)

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.

Packages here seem to be referred to by name alone. Users would probably like to select and see the version that they're installing or upgrading to.
Could packages be referred to by their full NEVRA? Or, perhaps the package selector could mirror what's on the host details page:

image

@ianballou
Copy link
Member

Looks like users can currently filter package versions by using the search bar, but I'm guessing they'd like to be able to see what versions are available.

@jeremylenz
Copy link
Member Author

Looks like users can currently filter package versions by using the search bar, but I'm guessing they'd like to be able to see what versions are available.

This bulk wizard only allows upgrading to the latest version. I can't think of a sane way to allow any granularity there, when you're dealing with multiple hosts that may have different versions installed and different versions available.

@jeremylenz
Copy link
Member Author

Users would probably like to select and see the version that they're installing or upgrading to.

That would be nice! But the version they're installing or upgrading to could vary from host to host, depending on that host's LCE/CV.

@ianballou
Copy link
Member

ianballou commented May 2, 2024

Hit an error trying to install 4 RPMs on two hosts:

(Really odd that it's bookmark related?)

2024-05-02T17:26:03 [I|app|1d601299] Backtrace for 'Action failed' error (ActiveRecord::RecordNotSaved): Validation failed: Targeting: Bookmark Must select a bookmark or enter a search query, Search query Must select a bookmark or enter a search query
 1d601299 | /home/vagrant/foreman_remote_execution/app/models/job_invocation_composer.rb:460:in `save!'
 1d601299 | /home/vagrant/foreman_remote_execution/app/models/job_invocation_composer.rb:433:in `trigger'
 1d601299 | /home/vagrant/foreman_remote_execution/app/models/job_invocation_composer.rb:441:in `trigger!'
 1d601299 | /home/vagrant/foreman_remote_execution/app/controllers/api/v2/job_invocations_controller.rb:93:in `create'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/abstract_controller/base.rb:228:in `process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal/rendering.rb:30:in `process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
 1d601299 | /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 1d601299 | /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 1d601299 | /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/audited-5.6.0/lib/audited/sweeper.rb:16:in `around'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/audited-5.6.0/lib/audited/sweeper.rb:16:in `around'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:137:in `run_callbacks'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/abstract_controller/callbacks.rb:41:in `process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal/rescue.rb:22:in `process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/notifications.rb:203:in `block in instrument'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/notifications.rb:203:in `instrument'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activerecord-6.1.7.7/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/abstract_controller/base.rb:165:in `process'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionview-6.1.7.7/lib/action_view/rendering.rb:39:in `process'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal.rb:190:in `dispatch'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_controller/metal.rb:254:in `dispatch'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/journey/router.rb:32:in `each'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/journey/router.rb:32:in `serve'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/routing/route_set.rb:842:in `call'
 1d601299 | /home/vagrant/katello/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 1d601299 | /home/vagrant/katello/lib/katello/middleware/event_daemon.rb:10:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/static.rb:24:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/static.rb:24:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/apipie-dsl-2.6.2/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/apipie-rails-1.3.0/lib/apipie/static_dispatcher.rb:74:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/bullet-7.1.6/lib/bullet/rack.rb:17:in `call'
 1d601299 | /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 1d601299 | /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/apipie-rails-1.3.0/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-openid-1.4.2/lib/rack/openid.rb:98:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/etag.rb:27:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/conditional_get.rb:40:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/head.rb:12:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 1d601299 | /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266:in `context'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activerecord-6.1.7.7/lib/active_record/migration.rb:601:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:98:in `run_callbacks'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/executor.rb:14:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/railties-6.1.7.7/lib/rails/rack/logger.rb:37:in `call_app'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/railties-6.1.7.7/lib/rails/rack/logger.rb:28:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 1d601299 | /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 1d601299 | /home/vagrant/katello/lib/katello/prevent_json_parsing.rb:12:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/method_override.rb:24:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/runtime.rb:22:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/executor.rb:14:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/static.rb:24:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/sendfile.rb:110:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/actionpack-6.1.7.7/lib/action_dispatch/middleware/host_authorization.rb:148:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/railties-6.1.7.7/lib/rails/engine.rb:539:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/railties-6.1.7.7/lib/rails/railtie.rb:207:in `public_send'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/railties-6.1.7.7/lib/rails/railtie.rb:207:in `method_missing'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/urlmap.rb:74:in `block in call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/urlmap.rb:58:in `each'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/rack-2.2.9/lib/rack/urlmap.rb:58:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/puma-6.4.2/lib/puma/configuration.rb:272:in `call'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/puma-6.4.2/lib/puma/request.rb:100:in `block in handle_request'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/puma-6.4.2/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/puma-6.4.2/lib/puma/request.rb:99:in `handle_request'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/puma-6.4.2/lib/puma/server.rb:464:in `process_client'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/puma-6.4.2/lib/puma/server.rb:245:in `block in run'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/puma-6.4.2/lib/puma/thread_pool.rb:155:in `block in spawn_thread'
 1d601299 | /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2024-05-02T17:26:03 [D|app|1d601299]   Rendering layout api/v2/layouts/error_layout.json.erb
2024-05-02T17:26:03 [D|app|1d601299]   Rendering api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
2024-05-02T17:26:03 [I|app|1d601299]   Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 1.3ms | Allocations: 300)
2024-05-02T17:26:03 [I|app|1d601299]   Rendered layout api/v2/layouts/error_layout.json.erb (Duration: 1.8ms | Allocations: 488)
2024-05-02T17:26:03 [I|app|1d601299] Completed 500 Internal Server Error in 105ms (Views: 5.9ms | ActiveRecord: 24.3ms | Allocations: 43711)

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.

Confirmed that updating all & selected packages works fine. Also confirmed that the edit buttons work, along with run via rex and customized rex.

@jeremylenz
Copy link
Member Author

Must select a bookmark or enter a search query

@ianballou Can you choose 'via customized' and see what you end up with for the host search query? Does it resolve to 0 or 2 hosts?

@ianballou
Copy link
Member

Must select a bookmark or enter a search query

@ianballou Can you choose 'via customized' and see what you end up with for the host search query? Does it resolve to 0 or 2 hosts?

image

@ianballou
Copy link
Member

The bookmark issue does not appear for custom REX.

@jeremylenz
Copy link
Member Author

@ianballou Bookmark error issue should be fixed now.

@ianballou
Copy link
Member

ianballou commented May 2, 2024

Bookmark error is fixed, up next:

Failed to initialize: RuntimeError - Failed rendering template: error during rendering: No available packages found for search term 'name ^ (vim-minimal,vim-filesystem,vim-enhanced,vim-common)'. Check the host's content view environments.

Confirmed vim-enhanced is available.

Edit: vim-enhanced was installed on both hosts, which triggered the error. I was a little confused since it made it sound like the RPM wasn't among the synced content. I wonder if the error could be improved.

@ianballou
Copy link
Member

I just tested:

  1. Update yum on one host but not another
  2. Update yum via the UI
  3. On the host with latest yum, all packages got updated

hostname, search, hostSearch, versions, descriptionFormat,
} = options;
const searchQuery = hostSearch ?? `name ^ (${hostname})`;
console.log(versions)
Copy link
Member

Choose a reason for hiding this comment

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

console.log

@ianballou
Copy link
Member

Things all seem to be working now!

@m-bucher
Copy link
Contributor

m-bucher commented May 3, 2024

image
Bookmark-menu within wizard is clipped to wizard window.

I must admit it took me some time to find the wizard 🙈

Also, Update Packages package selection only shows RPMs (/packages) and not DEBs (/debs) 😁

@ianballou
Copy link
Member

Looks like the bookmark clipping issue only happens when your screen is pretty narrow at least. But having it work with the side scroller would be cool if possible.

@ianballou
Copy link
Member

Also, Update Packages package selection only shows RPMs (/packages) and not DEBs (/debs) 😁

I think we may need some help here on this part like with host details page :)

@jeremylenz
Copy link
Member Author

Bookmark-menu within wizard is clipped to wizard window.

Flipped the bookmark dropdown so it's entirely within the wizard window. This should fix the issue. (Will require updating both Foreman and Katello PR branches.)

@evgeni
Copy link
Member

evgeni commented May 7, 2024

/packit build

Copy link

Account evgeni has no write access nor is author of PR!

@jeremylenz
Copy link
Member Author

/packit build

@evgeni
Copy link
Member

evgeni commented May 7, 2024

RPMs were built successfully. \o/

@ianballou
Copy link
Member

ianballou commented May 8, 2024

Still working just fine for me! The bookmark menu is now visible at all times.

Copy link
Contributor

@parthaa parthaa left a comment

Choose a reason for hiding this comment

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

APJ. Nice work 💯

@@ -25,3 +25,4 @@ jobs:
plugin: katello
postgresql_container: ghcr.io/theforeman/postgresql-evr
test_existing_database: false
foreman_version: refs/pull/10128/head
Copy link
Member Author

Choose a reason for hiding this comment

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

Added this to run tests with the Foreman PR. Tests are green, except that our "React Tests" check seems to ignore the Foreman version specified. However, npm run test passes locally (with the Foreman PR checked out):

Test Suites: 137 passed, 137 total
Tests:       584 passed, 584 total
Snapshots:   165 passed, 165 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants