Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stringify fact keys by default #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bastelfreak
Copy link
Member

for a long long time, the first level of keys in a factsets were symbols. Following nested hashes always had strings. This doesn't make sense and looks confusing. Also the original data contains only strings, we we actually iterated on the data and converted it to symbols. We now flip the default. This saves performance and makes code more readable.

@ekohl
Copy link
Member

ekohl commented Jun 24, 2024

I'd prefer to start with converting some modules to use symbols to see how it goes.

@bastelfreak
Copy link
Member Author

@ekohl I've one example here: voxpupuli/puppet-autofs#217
We need a major release of rspec-puppet-facts to get the latest FacterDB version. And I think it makes sense to switch to stringified facts already. That will save us one major release.

@bastelfreak
Copy link
Member Author

Another one: voxpupuli/puppet-ca_cert#113

@bastelfreak
Copy link
Member Author

Another one: voxpupuli/puppet-archive#527

@ekohl
Copy link
Member

ekohl commented Jun 27, 2024

I've summarized my thoughts in #188 (review)

for a long long time, the first level of keys in a factsets were
symbols. Following nested hashes always had strings. This doesn't make
sense and looks confusing. Also the original data contains only strings,
we we actually iterated on the data and converted it to symbols. We now
flip the default. This saves performance and makes code more readable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants