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

Updated db defined type strings documentation (#1) #1456

Merged
merged 3 commits into from
Mar 23, 2022

Conversation

benjamin-robertson
Copy link
Contributor

Updates to Puppet strings documentation for mysql module.

Regenerated Reference.md

Fixes issue #1455

@benjamin-robertson benjamin-robertson requested a review from a team as a code owner March 18, 2022 05:31
@CLAassistant
Copy link

CLAassistant commented Mar 18, 2022

CLA assistant check
All committers have signed the CLA.

@puppet-community-rangefinder
Copy link

mysql::db is a type

Breaking changes to this file WILL impact these 67 modules (exact match):
Breaking changes to this file MAY impact these 16 modules (near match):

This module is declared in 140 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@chelnak
Copy link
Contributor

chelnak commented Mar 18, 2022

Hey! Thanks for your contribution. Would you be able to provide a little more context around your proposed change?

Thanks 😊

@chelnak chelnak self-assigned this Mar 18, 2022
@benjamin-robertson
Copy link
Contributor Author

Hi Craig,

It appears that both the charset and collate parameters both need to be set. If only charset is set we continually receive corrective changes on Puppet runs.

For example if you configure the following

  mysql::db { 'bensdb':
    user     => ben,
    password => lookup('mysql::server::root_password'),
    host     => 'localhost',
    grant    => 'ALL',
    charset  => 'latin1',
  }

Corrective changes will continually occur for collate.

See notes from below issue ticket.

Thanks

Ben

Currently, charset and collate parameters for the defined type mysql::db don't mention in the docs they need to both set to the same charset. EG

  mysql::db { 'bensdb':
    user     => ben,
    password => lookup('mysql::server::root_password'),
    host     => 'localhost',
    grant    => 'ALL',
    charset  => 'latin1',
    collate  => 'latin1_swedish_ci',
  }

If they are not both set; corrective changes continually occur.

Notice: /Stage[main]/Profile::Lab::Mysql/Mysql::Db[bensdb]/Mysql_database[bensdb]/collate: collate changed 'latin1_swedish_ci' to 'utf8_general_ci' (corrective)
Next run
Notice: /Stage[main]/Profile::Lab::Mysql/Mysql::Db[bensdb]/Mysql_database[bensdb]/charset: charset changed 'utf8mb3' to 'latin1' (corrective)
Next run
Notice: /Stage[main]/Profile::Lab::Mysql/Mysql::Db[bensdb]/Mysql_database[bensdb]/collate: collate changed 'latin1_swedish_ci' to 'utf8_general_ci' (corrective)

I propose changing the parameter descriptions from

# @param charset
#   The character set for the database.
# @param collate
#   The collation for the database.

To

# @param charset
#   The character set for the database. Must be set with collate to avoid corrective changes.
# @param collate
#   The collation for the database. Must be set with charset to avoid corrective changes.

@chelnak
Copy link
Contributor

chelnak commented Mar 21, 2022

Hey Ben, thanks for such a detailed response.

I think what you are suggesting makes sense and I also think that we could probably do some more in that area to make the defined type a bit more robust.

That would take some time right now so I think a docs update is a good interim solution.

How about we make the descriptions read something like:

"Must have the same value as X to avoid corrective changes"

I think that makes the intention a little more explicit.

What do you think?

* Updated db defined type strings documentation

* Updated collate and charset description

* Update REFERENCE.md
@benjamin-robertson
Copy link
Contributor Author

Hi Craig,

Updated as suggested; I also provided a link to the mysql page which explains how to view the charset and collate pairs. Since the names don't match exactly.

Thoughts?

Ben

@chelnak
Copy link
Contributor

chelnak commented Mar 22, 2022

This is great.

There is a double space at the start of "Must" on line 23. If you could fix that so it matches the previous description then we can get this merged!

Copy link
Contributor

@chelnak chelnak left a comment

Choose a reason for hiding this comment

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

Just one small change then we are looking good!

* Updated db defined type strings documentation

* Updated collate and charset description

* Update REFERENCE.md

* Fixed space issue

* Update REFERENCE.md
@benjamin-robertson
Copy link
Contributor Author

Space fixed. Sneaky space.

@chelnak chelnak merged commit 2eec9bd into puppetlabs:main Mar 23, 2022
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.

charset and collate must both be set if specifying a non default charset for a database
4 participants