Fix regex node lookup regression from PUP-11515#481
Conversation
8037b48 to
d207f5c
Compare
903a80a to
7b6ffab
Compare
- The LOOKAROUND_OPERATORS tokens introduced in 5d09d7f are uppercase, but TypeCollection#munge_name() lowercases all lookup keys, so regex nodes with group syntax (e.g. (?:-test)) were stored under a key that could never be found again, producing "Cannot find definition Node". Fix: downcase the generated synthetic name before storing it. Fixes: OpenVoxProject#14 Signed-off-by: Corporate Gadfly <haroon.rafique@gmail.com> Co-authored-by: GitHub Copilot <noreply@github.com>
7b6ffab to
b629bd0
Compare
Instead of replacing with uppercase keys and then downcasing the result, let's just use lowercase to begin with. (I don't see how this would affect anything in the test results, but I don't know why the original test is failing either.)
|
This is a relatively harmless failure. It just means that on Windows / Ruby 3.2 that the generate face will do more work than it has to do. It should only be generating types for changed files, but with this change it's generating for all. It's still generating properly. I don't have time to keep digging just now, but you might poke at openvox/lib/puppet/generate/type.rb Lines 47 to 53 in acd591a Either something about this patch changes how the path is calculated or something about this patch changes how mtime works. The only link I found between node name and the generate types command is that it uses |
|
Thankfully, my life is devoid of Windows at the moment 🤷. |
Short description
The LOOKAROUND_OPERATORS tokens introduced in 5d09d7f are uppercase, but TypeCollection#munge_name() lowercases all lookup keys, so regex nodes with group syntax (e.g. (?:-test)) were stored under a key that could never be found again, producing "Cannot find definition Node".
Fix: downcase the generated synthetic name before storing it.
Fixes: #14
Checklist
I have:
Signed-off-byannotation to each of my commitsGenerated-byorAssisted-byannotations to each of my commits created with the help of an AI agent