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

Fix duplicated types in the kessel access checks SDK

XMLWordPrintable

    • Product / Portfolio Work
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • None
    • HCC Framework Sprint 52, HCC Framework Sprint 53

      There are a bunch of duplicate types and unused types in the api-client.ts.

      A few examples:

      We should be using this type in the hook: https://github.com/project-kessel/kessel-sdk-browser/blob/master/packages/react-kessel-access-check/src/types.ts#L22-L26
      However it is not used/imported: https://github.com/project-kessel/kessel-sdk-browser/blob/master/packages/react-kessel-access-check/src/core/api-client.ts#L74-L77

      We have a type for APIErrorResponse in the api-client: https://github.com/project-kessel/kessel-sdk-browser/blob/master/packages/react-kessel-access-check/src/core/api-client.ts#L27-L31
      However it should be pulled from the common types (duplicated): https://github.com/project-kessel/kessel-sdk-browser/blob/master/packages/react-kessel-access-check/src/types.ts#L16-L20

      We should try to de-duplicate the types. I would prefer to structure things the way they are in src/types.ts and remove the types in the api-client as the way it was architected was to reduce duplication across the single/bulk access check (and drive consistency). It doesn't look like the types in api-client are enforcing that.

              tefaz-insights Tahmid Efaz
              bflorkie@redhat.com Bryan Florkiewicz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: