Issue
I've found and issue with gettext and heredocs in voxbox validate when it attempts to validate Puppet manifests. e.g.
$ docker run --rm -it -v ".:/repo:Z" ghcr.io/voxpupuli/voxbox:8 -f /Rakefile validate
...
---> syntax:manifests
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !
The issue seems to be caused by gettext-setup which adds its own default domain master_domain that overrides the puppet domain default-text-domain as the default domain.
When we call Puppet::Test::TestHelper.after_each_test in lib/puppet-syntax/manifests.rb it deletes the domain master_domain but doesn't update the FastGettext.default_text_domain
Not sure why it only triggers with a heredoc (special actions around heredocs and gettext maybe?)
Workaround
I'm not sure what the best fix is for this, one option is adding
Puppet::GettextConfig.delete_all_text_domains
Puppet::GettextConfig.create_default_text_domain
into lib/puppet-syntax/manifests.rb so it resets the domains to how puppet expects them to be. This is what I've done with sed temporarily internally.
Reproduction
GHA Example: https://github.com/markeganfuller/openvox_textdomain_issue/actions/runs/18281701359/job/52046188764
Example code
manifests/init.pp
# Don't need anything here
class example () {
}
manifests/log.pp
# The bit that breaks
class example::log () {
$example_config = @(EXAMPLE)
example here doc
| EXAMPLE
}
Command
docker run --rm -it -v ".:/repo:Z" ghcr.io/voxpupuli/voxbox:8 -f /Rakefile validate
Issue
I've found and issue with gettext and heredocs in voxbox validate when it attempts to validate Puppet manifests. e.g.
The issue seems to be caused by
gettext-setupwhich adds its own default domainmaster_domainthat overrides the puppet domaindefault-text-domainas the default domain.When we call
Puppet::Test::TestHelper.after_each_testin lib/puppet-syntax/manifests.rb it deletes the domainmaster_domainbut doesn't update theFastGettext.default_text_domainNot sure why it only triggers with a heredoc (special actions around heredocs and gettext maybe?)
Workaround
I'm not sure what the best fix is for this, one option is adding
into lib/puppet-syntax/manifests.rb so it resets the domains to how puppet expects them to be. This is what I've done with
sedtemporarily internally.Reproduction
GHA Example: https://github.com/markeganfuller/openvox_textdomain_issue/actions/runs/18281701359/job/52046188764
Example code
manifests/init.ppmanifests/log.ppCommand
docker run --rm -it -v ".:/repo:Z" ghcr.io/voxpupuli/voxbox:8 -f /Rakefile validate