Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-7085

On Spring Boot the KogitoBuildContext does not support yaml config

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None

      allegedly Kogito, in general, does not support in codegen the Spring's yaml as configuration format.

      I checked and I don't think we serve any test (in kogito-runtimes) or example (in kogito-examples) of using Spring's yaml format for configuration of Kogito on Spring Boot.

      I also find confirmation in the code such as: https://github.com/kiegroup/kogito-runtimes/blob/a9519c06cbf84751d3cbc16a9c99f484b245ec50/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/context/impl/AbstractKogitoBuildContext.java#L283-L300
      The load() method supports only properties file format (as can be seen here: https://github.com/kiegroup/kogito-runtimes/blob/a9519c06cbf84751d3cbc16a9c99f484b245ec50/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/context/impl/AbstractKogitoBuildContext.java#L92)

      Consequently, any Kogito codegen extension has no visibility on Spring configuration provided as yaml format.

      For example, the gap of functionality happens on a asset use-case here: https://github.com/kiegroup/kogito-runtimes/blob/a9519c06cbf84751d3cbc16a9c99f484b245ec50/kogito-codegen-modules/kogito-codegen-decisions/src/main/java/org/kie/kogito/codegen/decision/DecisionRestResourceGenerator.java#L217
      where context, is the org.kie.kogito.codegen.api.context.KogitoBuildContext from the codegen infra.
      If the server.servlet.context-path is provided in Spring's applicaiton.yaml instead of .properties, the asset-codegen cannot access the configuration value since KogitoBuildContext does not give visibility access.

      In conclusion, it seems this is a general missing feature / potential gap of Kogito on Spring Boot.

              kverlaen@redhat.com Kris Verlaenen
              mmortari@redhat.com Matteo Mortari
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: