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

PQL operators sometimes whitespace sensitive

    Details

    • Template:
    • Acceptance Criteria:
      Hide

      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content= "a"}'
      []
      

      Show
      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \ -d 'query=resources { parameters.content= "a"}' []
    • Epic Link:
    • Story Points:
      2
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      PQL previously required a space to terminate a dotted field like `facts.os.family`. As a result, the query `inventory[]{ facts.os.family="Debian" }` would fail because the `=` operator was parsed as part of the dotted field. This space is no longer required and the inventory query example is a valid PQL query.
      Show
      PQL previously required a space to terminate a dotted field like `facts.os.family`. As a result, the query `inventory[]{ facts.os.family="Debian" }` would fail because the `=` operator was parsed as part of the dotted field. This space is no longer required and the inventory query example is a valid PQL query.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When querying resources whitespace is required before the comparison operator on parameters. This is not true when using the comparison operator on, say, type.

      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content = "a"}'
      []
      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content ="a"}'
      []
      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content= "a"}'
      PQL parse error at line 1, column 33:
       
      resources { parameters.content= "a"}
                                      ^
       
      Expected one of:
       
      is not null
      is null
      in
      =
      >
      <
      <=
      >=
      ~>
      ~
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                austin.blatt Austin Blatt
                Reporter:
                daniel.parks Daniel Parks
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support