Skip to content

bug: various structure fields (e.g., NlxPlan) inaccurate #234

@techfg

Description

@techfg

There are several structures within the code that are "re-used" across retrieve and deploy and MetadataService and CloudDataService that contain fields that are not applicable in all scenarios that they are used in.

For example, the NlxPlan structure defines the response expected from the server when executing Get Retrieve Plan and Get Deploy Plan for both the MetadataService and CloudDataService plans.

Unfortunately, the actual response from the server and the NlxPlan definition different between the MetadataService and the CloudDataService and also across Get Retrieve Plan and Get Deploy Plan:

  1. MetadataService - Response never appears to contain Host, Port, appSpecific or allPermissionSets for either Get deploy Plan or Get Retrieve Plan
  2. CloudDataService - Response never appears to contain allPermissionSets and only contains appSpecific on Get Retrieve Plan

Another example is NlxPlanFilter which includes since field which is only applicable to retrieve APIs.

The generic "catch-all" approach to structure definition and usage results in numerous issues, especially considering there is no documentation on the APIs themselves publicly available, for example:

  1. Increases code complexity and cost of maintenance as anyone (internal to Skuid or external) trying to properly utilize these fields needs to have intimate knowledge of the actual response structure per API, when fields will have a value, when they won't, etc. It should not take inspecting the physical response returned and/or reviewing all the areas currently in the code (which may themselves be inaccurate) to see how fields are used and when they may (or may not be reliable) just to utilize a field in a structure
  2. Conditional statements (e.g., Host != "") are required in "generic handlers" because nothing can be explicit even the service (meta or data) or api (retrieve or deploy) is known
  3. Fields that do not even apply to certain APIs are sent to (or attempted to be marshalled back from) when they should not be sent and/or will never exist. For example, when --app flag is passed, the value of appSpecific is NEVER correct for MetadataService but it is false everywhere and sent to the server as false when executing the MetadataService retrieve plan.

In order to eliminate incorrect fields being (un)marshalled and in order to decrease code complexity and ensure that anyone that is maintaining the code can clearly understand in/out expectations, data structures should not be shared unless their send/receive's are identical. The absolute worst case, and far from ideal, would be that the code at least contains comments in the structures that indicates when fields are reliable (e.g., they are sent to/returned from server) and when they are not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions