Bug 744970

Summary: The serial number of comment are mismatched between Reviewer side and vendor side
Product: [Retired] Red Hat Hardware Certification Program Reporter: Yunlong Xue <yxue>
Component: Hardware CatalogAssignee: Tony Fu <tfu>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1CC: hwcert-catalog, pxue, rlandry, sgreen, wshen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-20 00:36:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 807440    
Attachments:
Description Flags
fix the mismatched comment number
none
bug fix patch tfu: review? (rlandry), wshen: review+, pxue: review+

Description Yunlong Xue 2011-10-11 02:57:28 UTC
Take a look at https://hardware.redhat.com/show.cgi?id=740023#c16 .

From vendor side, the comment13 is comment4 since the private comment can not be seen by vendor.

I think the serial number of comments should keep identical to every one even private comment can not be seen by vendor.

Comment 1 Tony Fu 2011-12-22 04:25:22 UTC
The current code use bz xmlrpc function to get comments.  If the log in user is not in "private_comment" group, the returned result of bz xmlrpc call won't include private comments.  Therefore, the comment serial number will not match with the result of bz xmlrpc function calling from a user who is in "private_comment" group.

In bugzilla code, it simply gets all comments from db, then hide private comments if the user is not in "private_comment" group.  We can use the similar approach by using a dummy user who are in "private_comment" and use this user to call xmlrpc function to get all comments, then we hide the private comments if the real user is not in "private_comment" group.

I have worked out a patch to do so.  It will need
1. add a dummy user who is in "private_comment" and "redhat" group.  (I created one "hwcert-private-xmlrpc" on web2 and used it in my patch)
2. add the dummy user's user name and password in localhost file as following
$hwcert_private_user = 'hwcert-private-xmlrpc';
$hwcert_private_password = '';

Comment 2 Tony Fu 2011-12-22 04:26:37 UTC
Created attachment 549126 [details]
fix the mismatched comment number

Comment 3 Tony Fu 2012-01-10 01:25:56 UTC
Since the new patch need a private group account and it can bring some security issues without a comprehensive test, we move it to hybrid4.  Also, I have discussed it with reviewers and they are ok with the move.

Comment 4 Tony Fu 2012-02-09 06:14:17 UTC
make some changed on old patch and applied the new patch on web2.  The patch requires a dummy account which is in private_comment group, so if the user is not in "private_comment" group, the correct total comments number can still be returned by using the dummy account and the "private" comments will be properly hidden.  (it is pretty much the same approach as bz handles the comments serial number).

Comment 5 Tony Fu 2012-02-09 06:15:15 UTC
Created attachment 560459 [details]
bug fix patch

Comment 6 Pengfei Xue 2012-02-10 05:05:06 UTC
Comment on attachment 560459 [details]
bug fix patch

looks good

Comment 7 Wei Shen 2012-02-10 05:57:12 UTC
Comment on attachment 560459 [details]
bug fix patch

good to me

Comment 8 Rob Landry 2012-03-14 19:57:57 UTC
Is this patch applied anywhere?  Have we compared it to the BZ behavior?

Comment 15 Wei Shen 2012-04-11 03:28:54 UTC
verified on partner