Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-2504

Replace the fact normalizer identification of product tag with the new product tag identification

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2024-06-12 - API
    • None
    • None
    • 5
    • False
    • Hide

      None

      Show
      None
    • True

      Replace the identification of product tag only by eng id or only by role with the new product tag identification

      At this time, we only verify facts provided by HBI using the eng id or by role and obtain the product tag. This method should be dropped in favor of the new product tag identification code, which accepts the following values: eng_id, role, and product_name, metered flag etc.

       var subscriptions = SubscriptionDefinition.lookupSubscriptionByEngId(productId);
      if (Objects.nonNull(subscriptions)) {
      subscriptions.forEach(
      subscriptionDefinition ->
      subscriptionDefinition
      .findVariantForEngId(productId)
      .ifPresent(v -> products.add(v.getTag())));

       

      private void handleRole(NormalizedFacts normalizedFacts, String role) {
        if (role != null) {
          normalizedFacts.getProducts().removeIf(FactNormalizer::isRhelVariant);
      
          var subscription = SubscriptionDefinition.lookupSubscriptionByRole(role);
          if (subscription.isPresent()) {
            var variant = subscription.get().findVariantForRole(role);
            variant.ifPresent(v -> normalizedFacts.getProducts().add(v.getTag()));
          }
        }
      } 

       

      If data comes from telemetry then treat as metered: Y, if from HBI then metered N, if there is data in both streams then metered Y wins. 

      Expected results:
      The process should identify the product tag correctly. 

              rhn-engineering-wpoteat William Poteat
              karshah@redhat.com Kartik Shah
              Diego de Oliveira Maranhao Diego de Oliveira Maranhao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: