Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-5104

Fix schemas that don't handle to_string function data

    XMLWordPrintable

    Details

    • Template:
    • Team:
      Ghost
    • Story Points:
      5
    • Sprint:
      ghost-30.06.2021
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      `to_string` function didn't worked on facts & fact-contents endpoint because there was a schema validation that failed in this case. Change schema validation to allow `to_string` as a column of the query result.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Validation done by the row-schema for fact-contents endpoint
      (https://github.com/puppetlabs/puppetdb/blob/6.x/src/puppetlabs/puppetdb/query/fact_contents.clj#L10-L24)

      fails for rows on which we apply the to_string function.
      We also need to make sure that there are no other schemas that might throw errors because of this.

      This can be reproduced with this query:

      ["extract", [["function", "to_string", "value", "9999999"]], ["=","name", "uptime_seconds"]]
      

      on the facts endpoint.

      If you add a formatting mask, like "9,999", the query won't fail, but no result is given. Do we need a default formatting mask for integers?

      There is a disabled unit test with this ticket id. It has to be enabled once this is fixed.

        Attachments

          Activity

            People

            Assignee:
            sebastian.miclea Sebastian Miclea
            Reporter:
            andrei.filipovici Andrei Filipovici
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support