Skip to content

Fix regex node lookup regression from PUP-11515#481

Merged
corporate-gadfly merged 1 commit into
OpenVoxProject:mainfrom
corporate-gadfly:complex-regex
Jul 6, 2026
Merged

Fix regex node lookup regression from PUP-11515#481
corporate-gadfly merged 1 commit into
OpenVoxProject:mainfrom
corporate-gadfly:complex-regex

Conversation

@corporate-gadfly

@corporate-gadfly corporate-gadfly commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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: use downcased lookaround operators.

Fixes: #14

Checklist

I have:

@corporate-gadfly corporate-gadfly marked this pull request as draft June 9, 2026 23:26
@corporate-gadfly corporate-gadfly added the bug Something isn't working label Jun 10, 2026
@corporate-gadfly corporate-gadfly force-pushed the complex-regex branch 4 times, most recently from 7b6ffab to b629bd0 Compare June 17, 2026 01:18
@binford2k

Copy link
Copy Markdown
Contributor

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

# Determines if the output file is up-to-date with respect to the input file.
# @param [String, nil] The path to output to, or nil if determined by input
# @return [Boolean] Returns true if the output is up-to-date or false if not.
def up_to_date?(outputdir)
f = effective_output_path(outputdir)
Puppet::FileSystem.exist?(f) && (Puppet::FileSystem.stat(@path) <=> Puppet::FileSystem.stat(f)) <= 0
end

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 Puppet::Node::Environment to identify where to look at files. If you have a Windows node handy, you might see if there's any difference in Puppet.lookup(:current_environment) in the context of that test.

@corporate-gadfly

Copy link
Copy Markdown
Contributor Author

Thankfully, my life is devoid of Windows at the moment 🤷.

@corporate-gadfly corporate-gadfly force-pushed the complex-regex branch 3 times, most recently from 19444e3 to b7c5aaa Compare July 6, 2026 12:04
- 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: use downcased lookaround operators.

  Fixes: OpenVoxProject#14

Signed-off-by: Corporate Gadfly <haroon.rafique@gmail.com>
Co-authored-by: GitHub Copilot <noreply@github.com>
@corporate-gadfly corporate-gadfly marked this pull request as ready for review July 6, 2026 12:49
@corporate-gadfly corporate-gadfly added the backport 8.x backports the merged PR to the 8.x branch label Jul 6, 2026
@corporate-gadfly corporate-gadfly merged commit 6419f1e into OpenVoxProject:main Jul 6, 2026
14 checks passed
@corporate-gadfly corporate-gadfly deleted the complex-regex branch July 6, 2026 13:23
@corporate-gadfly corporate-gadfly added backport 8.x backports the merged PR to the 8.x branch and removed backport 8.x backports the merged PR to the 8.x branch labels Jul 6, 2026
@OpenVoxProjectBot

Copy link
Copy Markdown
Contributor

Successfully created backport PR for 8.x:

@corporate-gadfly

Copy link
Copy Markdown
Contributor Author

FYI, flaky test failure was fixed by PR #522.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 8.x backports the merged PR to the 8.x branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Puppet 8 introduced a regex node definition regression

4 participants