Skip to content

Fixes #39539 - Host actions are disabled after bulk action#11801

Open
MariaAga wants to merge 1 commit into
Katello:masterfrom
MariaAga:39539
Open

Fixes #39539 - Host actions are disabled after bulk action#11801
MariaAga wants to merge 1 commit into
Katello:masterfrom
MariaAga:39539

Conversation

@MariaAga

@MariaAga MariaAga commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

depends on theforeman/foreman#11110
to test:
user has permissions to edit hosts
go to new host index
click on host kebab - edit is enabled
run X action
edit is still enabled.

Summary by CodeRabbit

  • Bug Fixes
    • Host lists now refresh automatically after completing bulk actions, including package, errata, repository, collection, trace, and system-purpose operations.
    • Updated data appears immediately after bulk changes without requiring a manual page refresh.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Bulk host action modals now receive table refresh callbacks from host action contexts. Wizard contexts propagate the same callback to review footers, which invoke it after bulk operations and before closing.

Changes

Bulk host refresh integration

Layer / File(s) Summary
Modal refresh callback wiring
webpack/components/extensions/Hosts/BulkActions/*Modal/*
Bulk assignment, collection, trace, and system-purpose modals use injected refresh callbacks, with optional no-op defaults and updated scene wiring.
Wizard refresh context propagation
webpack/components/extensions/Hosts/BulkActions/*Wizard/*Wizard.js
Errata, package, and repository-set wizard contexts expose the table refresh callback.
Wizard completion refresh actions
webpack/components/extensions/Hosts/BulkActions/*Wizard/04_ReviewFooter.js, webpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/03_ReviewFooter.js
Wizard review actions refresh table data after bulk operations and before closing their modals.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: host actions no longer stay disabled after bulk actions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/BulkAssignCVEnvsModal.js

Error: Cannot read config file: /webpack/.eslintrc.js
Error: Foreman directory cannot be found! This action requires Foreman to be present in either a parent, sibling, or child directory relative to the plugin.
at foremanLocation (/node_modules/.pnpm/@theforeman+find-foreman@4.15.2/node_modules/@theforeman/find-foreman/index.js:27:13)
at Object. (/webpack/.eslintrc.js:3:21)
at Module._compile (/node_modules/.pnpm/v8-compile-cache@2.4.0/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1576:12)
at module.exports (/node_modules/.pnpm/import-fresh@3.3.1/node_modules/import-fresh/index.js:33:91)
at loadJSConfigFile (/node_modules/.pnpm/eslint@6.8.0/node_modules/eslint/lib/cli-engine/config-array-factory.js:201:16)

webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/index.js

Error: Cannot read config file: /webpack/.eslintrc.js
Error: Foreman directory cannot be found! This action requires Foreman to be present in either a parent, sibling, or child directory relative to the plugin.
at foremanLocation (/node_modules/.pnpm/@theforeman+find-foreman@4.15.2/node_modules/@theforeman/find-foreman/index.js:27:13)
at Object. (/webpack/.eslintrc.js:3:21)
at Module._compile (/node_modules/.pnpm/v8-compile-cache@2.4.0/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1576:12)
at module.exports (/node_modules/.pnpm/import-fresh@3.3.1/node_modules/import-fresh/index.js:33:91)
at loadJSConfigFile (/node_modules/.pnpm/eslint@6.8.0/node_modules/eslint/lib/cli-engine/config-array-factory.js:201:16)

webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js

Error: Cannot read config file: /webpack/.eslintrc.js
Error: Foreman directory cannot be found! This action requires Foreman to be present in either a parent, sibling, or child directory relative to the plugin.
at foremanLocation (/node_modules/.pnpm/@theforeman+find-foreman@4.15.2/node_modules/@theforeman/find-foreman/index.js:27:13)
at Object. (/webpack/.eslintrc.js:3:21)
at Module._compile (/node_modules/.pnpm/v8-compile-cache@2.4.0/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1576:12)
at module.exports (/node_modules/.pnpm/import-fresh@3.3.1/node_modules/import-fresh/index.js:33:91)
at loadJSConfigFile (/node_modules/.pnpm/eslint@6.8.0/node_modules/eslint/lib/cli-engine/config-array-factory.js:201:16)

  • 11 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js`:
- Line 197: Move the refreshTableData() call in the BulkManageTracesModal flow
into the success path of resolveBulkTraces, after the PUT request completes
successfully. Remove the earlier unconditional invocation so table data
refreshes only after the backend update is confirmed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b59a4732-9ca3-40ca-a5b5-1f78dd4629c0

📥 Commits

Reviewing files that changed from the base of the PR and between 5d06d15 and d9bccdd.

📒 Files selected for processing (14)
  • webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/BulkAssignCVEnvsModal.js
  • webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/index.js
  • webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js
  • webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.js
  • webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_ReviewFooter.js
  • webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js
  • webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js
  • webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/index.js
  • webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_ReviewFooter.js
  • webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js
  • webpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/03_ReviewFooter.js
  • webpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/BulkRepositorySetsWizard.js
  • webpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/BulkSystemPurposeModal.js
  • webpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/index.js

},
},
}));
refreshTableData();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the definition of resolveBulkTraces to see if it accepts a callback or returns a Promise.
rg -A 10 'export const resolveBulkTraces'

Repository: Katello/katello

Length of output: 153


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== resolveBulkTraces matches ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'resolveBulkTraces' .

printf '\n== refreshTableData call sites in BulkActions modals ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'refreshTableData\(\)' webpack/components/extensions/Hosts/BulkActions

printf '\n== files for BulkManageTracesModal ==\n'
fd -a 'BulkManageTracesModal.js|BulkManage.*Modal.js' webpack/components/extensions/Hosts/BulkActions

Repository: Katello/katello

Length of output: 1733


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== BulkManageTracesActions.js ==\n'
cat -n webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesActions.js

printf '\n== BulkManageTracesModal.js around dispatch ==\n'
sed -n '160,215p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js

printf '\n== similar modal patterns ==\n'
sed -n '145,185p' webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js
printf '\n---\n'
sed -n '100,135p' webpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/BulkSystemPurposeModal.js

Repository: Katello/katello

Length of output: 6275


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the exact implementation of resolveBulkTraces and the surrounding modal callback.
sed -n '1,120p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesActions.js
printf '\n---\n'
sed -n '170,205p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js

# Check whether nearby bulk-action modals wait for async completion via callbacks/promises.
printf '\n== search for success callbacks in bulk action modals ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'successCallback|then\(|await |callback' webpack/components/extensions/Hosts/BulkActions

Repository: Katello/katello

Length of output: 20069


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== BulkManageTracesModal.js top/middle ==\n'
sed -n '1,260p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js

printf '\n== BulkManageTracesModal.test.js relevant cases ==\n'
sed -n '1,420p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/__tests__/BulkManageTracesModal.test.js

printf '\n== search for refreshTableData prop usage in traces area ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'refreshTableData' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal webpack/components/extensions/Hosts -g '!**/__tests__/**'

Repository: Katello/katello

Length of output: 26506


Move refreshTableData() into the resolveBulkTraces success path. It currently runs before the PUT request finishes, so the refresh can race the backend and re-read stale data; this should follow the same completion timing as the other bulk modals.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js`
at line 197, Move the refreshTableData() call in the BulkManageTracesModal flow
into the success path of resolveBulkTraces, after the PUT request completes
successfully. Remove the earlier unconditional invocation so table data
refreshes only after the backend update is confirmed.

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.

1 participant