[PDB-3930] PQL's ~ matches incorrectly on dotted variables Created: 2018/06/02  Updated: 2018/09/13  Resolved: 2018/07/11

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: PDB 5.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Daniel Parks Assignee: Rob Browning
Resolution: Fixed Votes: 1
Labels: customer0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

2018.2.0-rc2


Issue Links:
Duplicate
duplicates PDB-3903 PQL ~ operator matches empty strings ... Closed
Relates
relates to ENTERPRISE-1183 Console classification regex behaving... Resolved
Template:
Acceptance Criteria:

The following query returns records:

resources { type = 'File' and parameters.ensure ~ '^file$' }

Team: PuppetDB
Method Found: Needs Assessment
CS Priority: Reviewed
CS Frequency: 3 - 25-50% of Customers
CS Severity: 3 - Serious
CS Business Value: 4 - $$$$$
CS Impact: CS Triage feedback on this issue replicated from: PE-24298.

Although this does not affect classification, it would cause confusion in our customer base. It will lead to customers going down rabbit holes when attempting to debug classification issues which will lead to at least frustration if not a support call.
Release Notes: Bug Fix
Release Notes Summary: PuppetDB should no longer match regular expresions against fact values incorrectly. Previously (starting with 5.2.0) the "~" operator would end up trying to match the JSON-encoded representation of a fact value rather than the value itself. So, for example,

  ~ ^something

would fail when it should succeed, while

  ~ ^"something

would match.
QA Risk Assessment: Needs Assessment

 Description   

The ~ operator treats dotted variables, e.g. parameters.ensure and facts.fqdn, as if their values were wrapped in double quotes.

Both of the following return thousands of records:

resources { type = 'File' and parameters.ensure ~ '^"file"$' }
resources { type = 'File' and parameters.ensure = 'file' }

The following returns no records:

resources { type = 'File' and parameters.ensure ~ '^file$' }

I initially reported this as PDB-3903 in PE 2018.1.0-rc14, but either I didn't understand the full scope of the problem, or it has gotten worse since then.



 Comments   
Comment by Eric Thompson [ 2018/06/20 ]

will this fix, implicitly, PE-24298?

edit: answering my own question: yes (according to Jon's investigation)

Comment by Kenn Hussey [ 2018/06/21 ]

Maggie Dreyer Eric Thompson can we please prioritize this as a Customer 0 issue?

Comment by Maggie Dreyer [ 2018/06/21 ]

I think for the time being Rob Browning is handling PDB prioritization, until he tells the rest of the team that he needs help. For the time being it sounded like he and Zak had a handle on it. But I'll keep an eye on it.

Generated at Sat Dec 14 18:00:23 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.