Bug 1353730

Summary: Truncate miq_request user_message length.
Product: Red Hat CloudForms Management Engine Reporter: Tina Fitzgerald <tfitzger>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Milan Falešník <mfalesni>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.6.0CC: cpelland, jhardy, mfalesni, mkanoor, obarenbo, simaishi, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1353974 (view as bug list) Environment:
Last Closed: 2017-01-11 19:49:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1353974    
Attachments:
Description Flags
Automate Simulate options
none
test automate method
none
new_instance_shown_in_nav_bar
none
new_instance_showing_method_call none

Description Tina Fitzgerald 2016-07-07 20:27:24 UTC
Created attachment 1177444 [details]
Automate Simulate options

Description of problem:

Each automate method that sets the user_message has to truncate the message length to 255. Fixing it in the mixin makes more sense.


Steps to Reproduce:
1. Create small automate method in writable domain to test user message length(see attachment)
2. Create an instance in the same class as the newly created method and set the method name in method slot.(see attachment)
3. Run Simulate to call method created in step 1.(see attachment)
4. Check automation.log for message:
example message:
[----] I, [2016-07-07T16:10:50.805849 #17716:3fe445430b0c]  INFO -- : <AEMethod test_user_message> request user message length 320 user_message: ReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongString

Actual results: 
message length exceeds 255

Expected results:
message length does not exceed 255

Comment 2 Tina Fitzgerald 2016-07-07 20:28:34 UTC
Created attachment 1177445 [details]
test automate method

Comment 3 Tina Fitzgerald 2016-07-07 20:31:08 UTC
Created attachment 1177446 [details]
new_instance_shown_in_nav_bar

Comment 4 Tina Fitzgerald 2016-07-07 20:31:56 UTC
Created attachment 1177447 [details]
new_instance_showing_method_call

Comment 6 CFME Bot 2016-07-08 16:51:24 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/aec4220437be54727fae8e53f868f39b99ca916b

commit aec4220437be54727fae8e53f868f39b99ca916b
Author:     Tina Fitzgerald <tfitzger>
AuthorDate: Thu Jun 30 10:57:32 2016 -0400
Commit:     Tina Fitzgerald <tfitzger>
CommitDate: Thu Jul 7 16:36:25 2016 -0400

    Truncate request user_message and add test.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1353730

 app/models/mixins/miq_request_mixin.rb                             | 1 +
 .../miq_ae_service_service_template_provision_request_spec.rb      | 7 +++++++
 2 files changed, 8 insertions(+)

Comment 7 Milan Falešník 2016-10-03 11:59:42 UTC
Verified in 5.7.0.3

[----] I, [2016-10-03T08:01:17.541748 #11860:de5710]  INFO -- : <AEMethod testmeth> request user message length 255 user_message: ReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongStringReallyLongSt...