Bug 2127134
Summary: | The default "Katello Sync" webhook template has @object.task.action_output defined which is not a valid safemode method in Satellite 6.12 | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Sayan Das <saydas> |
Component: | Hooks and Webhooks | Assignee: | Adam Ruzicka <aruzicka> |
Status: | CLOSED ERRATA | QA Contact: | Peter Ondrejka <pondrejk> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.12.0 | CC: | ahumbe, aruzicka, egolov, lhellebr, lzap, mhulan, ofedoren, pcreech, rlavi |
Target Milestone: | 6.14.0 | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | rubygem-foreman_webhooks-3.1.1, rubygem-foreman_webhooks-3.2.1 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-11-08 14:18:02 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Sayan Das
2022-09-15 12:33:35 UTC
The exact same problem is there for "Katello Publish" and "Katello Promote". Need to fix this there or else remove it: Task action output <%= @object.task.action_output %> Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35867 has been resolved. Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35867 has been resolved. Already present in stream from snap 8. @object.task.action_output got changed in the templates to @object.task.action_continuous_output in Sat 6.14. What is it supposed to contain? Currently, template [0] renders to [1], i.e. that variable is empty. [0] ``` <%# name: Katello Sync description: Example payload for actions.katello.repository.sync_succeeded snippet: false model: WebhookTemplate -%> # Example webhook template, @object carries Action instance. # For more information about available helpers visit /templates_doc Repository id <%= @object.repository_id %> Repository label <%= @object.repository_label %> Repository contents_changed <%= @object.contents_changed %> Repository sync_result <%= @object.sync_result %> Product id <%= @object.product_id %> Product name <%= @object.product_name %> Product label <%= @object.product_label %> Organization id <%= @object.organization_id %> Organization name <%= @object.organization_name %> Organization label <%= @object.organization_label %> Task label <%= @object.task.label %> Task started at <%= @object.task.started_at %> Task ended at <%= @object.task.ended_at %> Task resulted with <%= @object.task.result %> Task state <%= @object.task.state %> Task action output START:<%= @object.task.action_continuous_output %>:END Debug: Task object START:<%= @object.task %>:END Object object START:<%= @object %>:END ``` [1] ``` # Example webhook template, @object carries Action instance. # For more information about available helpers visit /templates_doc Repository id 1 Repository label Red_Hat_Satellite_Client_6_for_RHEL_8_x86_64_RPMs Repository contents_changed false Repository sync_result {"publication_provided"=>false, "contents_changed"=>false} Product id 6 Product name Red Hat Enterprise Linux for x86_64 Product label Red_Hat_Enterprise_Linux_for_x86_64 Organization id 1 Organization name Default Organization Organization label Default_Organization Task label Actions::Katello::Repository::Sync Task started at 2023-07-19 16:17:50 +0200 Task ended at 2023-07-19 16:17:54 +0200 Task resulted with success Task state stopped Task action output START::END Debug: Task object START:Synchronize repository 'Red Hat Satellite Client 6 for RHEL 8 x86_64 RPMs'; product 'Red Hat Enterprise Linux for x86_64'; organization 'Default Organization':END Object object START:#<Actions::Katello::Repository::Sync:0x000056306925f0b8>:END ``` @object.task.action_continuous_output is only relevant for tasks backing remote execution. It is expected that it is empty in the context of repository actions. It is included as an option in the template because it is in attribute exposed on the generic task jail, even though it doesn't really add any value in here. In that case, it shouldn't be in an EXAMPLE of a webhook template. That's a very bad, misleading example and I consider it a bug. Sure, the example needs to be updated. Verified on Satellite 6.14 snap 11, @object.task.action_output was replaced with @object.task.action_continuous_output, and now appears as an example only in remote_execution_-_host_job.erb Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Satellite 6.14 security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:6818 |