Bug 2044944 - 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
high
high
Target Milestone: ---
: ---
Assignee: candlepin-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-25 11:17 UTC by Nikos Moumoulidis
Modified: 2022-02-10 11:57 UTC (History)
1 user (show)

Fixed In Version: candlepin-4.1.11-1
Clone Of:
: 2044946 (view as bug list)
Environment:
Last Closed: 2022-02-10 11:57:54 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 3206 0 None Merged 2044944: System purpose compliance updates to correct db column; ENT-4600 2022-01-25 11:22:17 UTC

Internal Links: 1982970

Description Nikos Moumoulidis 2022-01-25 11:17:31 UTC
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.