Page MenuHomePhabricator

Cumin: allow to query for Puppet primitive types
Closed, ResolvedPublic

Description

The PuppetDB backend in cumin does force every resource parameter's value to be a string, not allowing to match parameters that have other Puppet primitive types.

We should improve it to at least allow for the basic types:

  • Boolean
  • Integer
  • Float
  • [optionally] Octal, Hexadecimal
  • undef
  • default

Allowing of course the user to "force" the string type by adding quotes to it so that a query for = true means boolean true and a query for = "true" means string "true".

Event Timeline

Volans created this task.Oct 15 2018, 2:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 15 2018, 2:18 PM
Volans triaged this task as Normal priority.Oct 15 2018, 2:20 PM
Volans updated the task description. (Show Details)
Volans added a subscriber: Joe.

https://puppet.com/docs/puppet/4.8/lang_data_type.html documentation about types

Plan:

  • communicate enquotedness of values from top level parser
  • if enquoted -> fall to string
  • if not, if bareword (undef, true, false etc) -> bareword
  • if not if parses as numeric -> numeric
  • else -> fall to string
crusnov claimed this task.Oct 23 2018, 7:05 PM
crusnov moved this task from Backlog to In Progress on the SRE-tools board.

Change 474087 had a related patch set uploaded (by CRusnov; owner: CRusnov):
[operations/software/cumin@master] Make the puppetdb backend process primitive types for queries.

https://gerrit.wikimedia.org/r/474087

Volans moved this task from In Progress to In Code Review on the SRE-tools board.Dec 19 2018, 11:18 AM

would love to see this happen as well.. i've been banging my head against this trying to figure out why =true wouldn't work until I found this ticket. :) as a stopgap, documenting this limitation would be a good start...

For the record, the latest patchset was just pending on me testing null values work in puppetdb queries, which I've done now so this should be coming soon.

Change 474087 had a related patch set uploaded (by Volans; owner: CRusnov):
[operations/software/cumin@master] Make the puppetdb backend process primitive types for queries

https://gerrit.wikimedia.org/r/474087

Change 474087 merged by jenkins-bot:
[operations/software/cumin@master] Make the puppetdb backend process primitive types for queries

https://gerrit.wikimedia.org/r/474087

Volans closed this task as Resolved.Jul 19 2019, 9:24 PM

Resolving as this was merged already. The release process is out of scope for this task.