Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWATCH-1624: Remove qpc_certs from HBI query #2604

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
@ColumnResult(name = "system_profile_arch"),
@ColumnResult(name = "is_marketplace"),
@ColumnResult(name = "qpc_products"),
@ColumnResult(name = "qpc_product_ids"),
@ColumnResult(name = "system_profile_product_ids"),
@ColumnResult(name = "syspurpose_role"),
@ColumnResult(name = "syspurpose_sla"),
Expand Down Expand Up @@ -120,7 +119,6 @@
h.canonical_facts->>'insights_id' as insights_id,
rhsm_products.products,
qpc_prods.qpc_products,
qpc_certs.qpc_product_ids,
system_profile.system_profile_product_ids,
h.stale_timestamp,
coalesce(
Expand All @@ -138,9 +136,6 @@ from jsonb_array_elements_text(h.facts->'rhsm'->'RH_PROD') as items) rhsm_produc
cross join lateral (
select string_agg(items, ',') as qpc_products
from jsonb_array_elements_text(h.facts->'qpc'->'rh_products_installed') as items) qpc_prods
cross join lateral (
select string_agg(items, ',') as qpc_product_ids
from jsonb_array_elements_text(h.facts->'qpc'->'rh_product_certs') as items) qpc_certs
cross join lateral (
select string_agg(items->>'id', ',') as system_profile_product_ids
from jsonb_array_elements(h.system_profile_facts->'installed_products') as items) system_profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class InventoryHostFacts {
private String subscriptionManagerId;
private String insightsId;
private Set<String> qpcProducts;
private Set<String> qpcProductIds;
private Set<String> systemProfileProductIds;
private String syspurposeRole;
private String syspurposeSla;
Expand Down Expand Up @@ -88,7 +87,6 @@ public InventoryHostFacts(
String systemProfileArch,
String isMarketplace,
String qpcProducts,
String qpcProductIds,
String systemProfileProductIds,
String syspurposeRole,
String syspurposeSla,
Expand All @@ -114,7 +112,6 @@ public InventoryHostFacts(
this.orgId = orgId;
this.products = asStringSet(products);
this.qpcProducts = asStringSet(qpcProducts);
this.qpcProductIds = asStringSet(qpcProductIds);
this.syncTimestamp = StringUtils.hasText(syncTimestamp) ? syncTimestamp : "";
this.systemProfileInfrastructureType = systemProfileInfrastructureType;
this.systemProfileCoresPerSocket = asInt(systemProfileCores);
Expand Down Expand Up @@ -176,10 +173,6 @@ public void setQpcProducts(String qpcProducts) {
this.qpcProducts = asStringSet(qpcProducts);
}

public void setQpcProductIds(String qpcProductIds) {
this.qpcProductIds = asStringSet(qpcProductIds);
}

public void setSystemProfileProductIds(String productIds) {
this.systemProfileProductIds = asStringSet(productIds);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ private void normalizeQpcFacts(NormalizedFacts normalizedFacts, InventoryHostFac
if (hostFacts.getQpcProducts() != null && hostFacts.getQpcProducts().contains("RHEL")) {
normalizedFacts.addProduct("RHEL");
}
getProductsFromProductIds(normalizedFacts, hostFacts.getQpcProductIds());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class InventoryRepositoryIT implements ExtendWithInventoryService, ExtendWithSwa
private static final String INSIGHTS_ID = "INSIGHTS_ID test";
private static final Set<String> RH_PROD = Set.of("a1", "a2", "a3");
private static final Set<String> RH_PRODUCTS_INSTALLED = Set.of("b1", "b2", "b3");
private static final Set<String> RH_PRODUCT_CERTS = Set.of("c1", "c2", "c3");
private static final Set<Map<String, String>> INSTALLED_PRODUCTS =
Set.of(Map.of("id", "d1"), Map.of("id", "d2"));
private static final int CUT_OFF_DAYS = 3;
Expand Down Expand Up @@ -117,7 +116,6 @@ void testStreamFacts() { // NOSONAR
assertEquals(VIRTUAL_HOST_UUID, fact.getHardwareSubmanId());
assertEquals(RH_PROD, fact.getProducts());
assertEquals(RH_PRODUCTS_INSTALLED, fact.getQpcProducts());
assertEquals(RH_PRODUCT_CERTS, fact.getQpcProductIds());
assertEquals(Set.of("d1", "d2"), fact.getSystemProfileProductIds());
}

Expand Down Expand Up @@ -195,13 +193,7 @@ private UUID givenHost() {
"system_purpose_usage",
SYSTEM_PURPOSE_USAGE),
"qpc",
of(
"IS_RHEL",
"true",
"rh_products_installed",
RH_PRODUCTS_INSTALLED,
"rh_product_certs",
RH_PRODUCT_CERTS)),
of("IS_RHEL", "true", "rh_products_installed", RH_PRODUCTS_INSTALLED)),
of("subscription_manager_id", SUBSCRIPTION_MANAGER_ID, "insights_id", INSIGHTS_ID),
of(
"infrastructure_type",
Expand Down