Skip to content

Conversation

@pablobm
Copy link
Contributor

@pablobm pablobm commented Dec 5, 2025

If we go for openstreetmap/openstreetmap-website#6566 (Create script for admins to manage "spammy phrases"), then this is the list of spammy phrases.

Marking as draft because I can't run the Chef tests, either in my machine or in a new VM I created only for this. I get the following error:

$ bundle exec kitchen test dns-ubuntu-2204
-----> Starting Test Kitchen (v3.9.1)
-----> Cleaning up any prior instances of <dns-ubuntu-2204>
-----> Destroying <dns-ubuntu-2204>...
       Deleting kitchen sandbox at /home/pablobm/.dokken/kitchen_sandbox/845966d96d-dns-ubuntu-2204
       Deleting verifier sandbox at /home/pablobm/.dokken/verifier_sandbox/845966d96d-dns-ubuntu-2204
       Finished destroying <dns-ubuntu-2204> (0m0.01s).
-----> Testing <dns-ubuntu-2204>
-----> Creating <dns-ubuntu-2204>...
/home/pablobm/.local/share/mise/installs/ruby/3.1.7/lib/ruby/gems/3.1.0/gems/lockfile-2.1.3/lib/lockfile.rb:308: warning: finalizer references object to be finalized
/home/pablobm/.local/share/mise/installs/ruby/3.1.7/lib/ruby/gems/3.1.0/gems/lockfile-2.1.3/lib/lockfile.rb:308: warning: finalizer references object to be finalized
       Creating container chef-latest
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [{"message":"invalid JSON: json: cannot unmarshal string into Go struct field CreateRequest.Config.Cmd of type []string"}
] on dns-ubuntu-2204
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

This happens on master too (I've only tried master on the VM) so I don't think this PR has anything to do with it. Also with any recipe I have tried. The example above is with dns-ubuntu-2204 because it's the one used in the documentation.

Working with @Firefishy into what the issue is with my setup, but if somebody has a clue it would be great to hear.

not_if { ::File.exist?("#{rails_directory}/config/example.application.yml") }
end

file "create:#{rails_directory}/config/spam_phrases.yml" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is create: supposed to be doing there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was copied from the previous declaration for config/application.yml. I'm flying blind here as I can't run the test suite and I don't know Chef, so I tried that. I see other declarations don't have it, so I guess it's not needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that was a bit of hackery by me so I could have two resources for the same file - one to create it and one to delete it. So I have them those prefixed names and then overrode the path.

The normal way to do it is just to have the file name as the resource name and not bother with the path attribute.

@tomhughes
Copy link
Member

Note that I already added the two strings that were in the old code to the database manually.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants