ibm-telemetry / telemetry-js-config-generator

Script automation for generating IBM Telemetry config files according to published schema
Apache License 2.0
0 stars 0 forks source link

Allowed attribute string value edge cases #28

Closed mattrosno closed 5 months ago

mattrosno commented 6 months ago

Description

Tell us more about the problem that you're running into. What did you see? What did you expect to see?

This likely needs broken down into more issues, but when running the config generator against this repo, here is the manual cleanup that I had to do:

https://github.com/carbon-design-system/carbon-addons-iot-react/pull/3854/commits/ec74fd5f438c9b63b629c38ecce139477f22453d

Some values had double quotes, e.g.:

        - '"lg"'
        - '"max"'
        - '"md"'
        - '"sm"'
        - '"xl"'
        - '"xs"'

I was surprised to see prop types as valid values, e.g.:

        - |-
          PropTypes.shape({
            peak: PropTypes.number,
            meterTotal: PropTypes.number,
            meterUnit: PropTypes.string,
            totalFormatter: PropTypes.func,
            legendPosition: PropTypes.string,
            ...ChartColorPropType,
          })

There were a few empty strings that shouldn't have been there? Maybe these are okay, if it's value to set a prop with an empty string.

        - ''

I'm guessing we don't want executable JS as valid values? E.g.:

        - ...Object.values(ITEM_VALUE_KEYS)

Steps to reproduce

How do we reproduce the error? Please be as specific as you can.

  1. https://github.com/carbon-design-system/carbon-addons-iot-react/pull/3854/commits/ec74fd5f438c9b63b629c38ecce139477f22453d
mattrosno commented 6 months ago

@francinelucca here's another example. Nothing net new beyond what's already documented in this issue: https://github.ibm.com/ibmcloud/cloud-pal-community/pull/562/commits/386d5f90cd2c9b8f2e2594745c631e2c9923db76