Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-41928

Refactor API code generation in Web-Rca

XMLWordPrintable

    • Future Sustainability
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • None
    • Important

      While working on a new feature for Web-RCA, we discovered that the API generation process had some hand-written scripts to make the generation work with golang pointer expectations. Part of this post-generation scripting was, as it turned out, deleting the bulk of the generated API code for the new feature functionality.

      The post-generation processing scripts are as follows:

        - https://gitlab.cee.redhat.com/service/web-rca/-/blob/main/Makefile?ref_type=heads#L183-185

        - https://gitlab.cee.redhat.com/service/web-rca/-/blob/main/Makefile?ref_type=heads#L188-190

        - https://gitlab.cee.redhat.com/service/web-rca/-/blob/main/openapi-mods.sh?ref_type=heads

      Rather than manually modify the scripts to work with these new pieces, leaving a future time-bomb for other feature work, I made the decision to dig into the reason for these scripts and settled on moving to a new, more golang focused OpenAPI generator, oapi-codegen rather than the current openapi-generator-cli.

      This will be a HUGE lift in the code change required, but should make future work much safer along with generating more go-native code. 

              rhn-support-cmitchel Chris Mitchell
              rhn-support-cmitchel Chris Mitchell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: