Bug 2044946 - compliance status hash column overwritten by the syspurpose compliance hash
Summary: compliance status hash column overwritten by the syspurpose compliance hash
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 4.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.0
Assignee: candlepin-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-25 11:19 UTC by Nikos Moumoulidis
Modified: 2022-02-22 08:09 UTC (History)
2 users (show)

Fixed In Version: candlepin-4.0.16-1
Clone Of: 2044944
Environment:
Last Closed: 2022-02-22 08:09:48 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 3208 0 None open 2044946: System purpose compliance updates to correct db column [4.0] 2022-01-26 08:26:45 UTC

Internal Links: 1982970

Description Nikos Moumoulidis 2022-01-25 11:19:39 UTC
+++ This bug was initially created as a clone of Bug #2044944 +++

Description of problem:
"syspurpose compliance" and the "subscription compliance" are sharing the same "compliancestatushash" column in the cp_consumer table so after calculating the syspurpose compliance, Candlepin will replace the column with its digest

Version-Release number of selected component (if applicable):
All versions of candlepin that support system purpose so far

How reproducible:
100%

Steps to Reproduce:
1. Register a client
2. Set a syspurpose attribute on the client (e.g. role)
3. Check the database column cp_consumer.sp_status_hash for that consumer

Actual results:
It is null

Expected results:
It should contain a hash value

Additional info:
The offending code is here: https://github.com/candlepin/candlepin/blob/50b7144dc13c9688add43c3e716851f6430e5dfc/src/main/java/org/candlepin/policy/SystemPurposeComplianceRules.java#L274-L277
the getSystemPurposeStatusHash/setSystemPurposeStatusHash methods should be used instead.


Note You need to log in before you can comment on or make changes to this bug.