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

Reorganize package structure to avoid having common packages name between swatch-metrics-hbi and swatch-model-metrics-hbi modules

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • swatch-metrics-hbi
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • subs-swatch-thunder

      We need to clean up our code organization in the metrics HBI modules to follow Java best practices and avoid Quarkus compilation issues.

      Right now, we have the same package name (com.redhat.swatch.hbi.events.normalization) shared between two different modules: swatch-metrics-hbi and swatch-model-metrics-hbi. This is called a "split package" and it's considered bad practice because it can cause confusing errors down the road, especially as Java's module system becomes more strict.

      From Quarkus 3.31, this kind of issues is detected and the build compilation fails. In order to avoid the compilation failure, we added the property "quarkus.arc.split-package-handling=ignore" in swatch-metrics-hbi. This property will log a warning instead of causing the build to fail:

      WARN: Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives: 
      - "com.redhat.swatch.hbi.events" found in [com.redhat.swatch:swatch-metrics-hbi:1.1.0-SNAPSHOT, com.redhat.swatch:swatch-model-metrics-hbi:1.1.0-SNAPSHOT]
      - "com.redhat.swatch.hbi.events.dtos.hbi" found in [com.redhat.swatch:swatch-metrics-hbi:1.1.0-SNAPSHOT, com.redhat.swatch:swatch-model-metrics-hbi:1.1.0-SNAPSHOT]
      - "com.redhat.swatch.hbi.events.normalization.facts" found in [com.redhat.swatch:swatch-metrics-hbi:1.1.0-SNAPSHOT, com.redhat.swatch:swatch-model-metrics-hbi:1.1.0-SNAPSHOT]
      - "com.redhat.swatch.hbi.events.normalization" found in [com.redhat.swatch:swatch-metrics-hbi:1.1.0-SNAPSHOT, com.redhat.swatch:swatch-model-metrics-hbi:1.1.0-SNAPSHOT]
      

      Acceptance Criteria

      • The proper fix is to reorganize the code so that each package lives in only one module
      • Remove the property "quarkus.arc.split-package-handling=ignore" from swatch-metrics-hbi

              Unassigned Unassigned
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: