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

Update modules with defined types for variables as described in docs/Add reference.md #440

Merged
merged 9 commits into from
Oct 26, 2018

Conversation

danquack
Copy link
Contributor

@danquack danquack commented Oct 21, 2018

I couldn't find where you ran your merge script for updating the changelog, but I imagine an additional command of puppet strings generate can be run to make this automated and up to date.

Pull Request (PR) description

Based on the current docs, defined types for variables. Then executed rake strings to generate the reference markdown file for forge.

This Pull Request (PR) fixes the following issues

Fixes #439
Fixes #441

@danquack danquack changed the title added puppet string docs added yard docs Oct 21, 2018
@bastelfreak
Copy link
Member

bastelfreak commented Oct 21, 2018

Hi @danquack. We had some longer discussions in our IRC channel and at voxpupuli/modulesync_config#397. For now we want a REFERENCE.md with puppet-strings docs and maybe not the html docs. You can generate the markdown file with:

bundle exec rake strings:generate\[',,,,false,true']

The output would need some adjustments. Some comments in the pp files are in the wrong format. I you want you can contribute that.

Gemfile Outdated
@@ -66,6 +66,7 @@ group :release do
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '>= 1.0', :require => false
gem 'yard', :require => false
Copy link
Member

Choose a reason for hiding this comment

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

puppet-strings requires this so it's redundant

@danquack danquack force-pushed the dev branch 2 times, most recently from 8528862 to 8dd4a72 Compare October 22, 2018 04:33
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

A good time to review the class parameters / docs.

REFERENCE.md Outdated Show resolved Hide resolved
REFERENCE.md Outdated

##### `dev`

Data type: `Any`
Copy link
Member

Choose a reason for hiding this comment

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

Probably out of scope, but perhaps this should also be an Enum['absent', 'present', 'latest']

REFERENCE.md Outdated

Data type: `Enum['absent', 'present', 'latest']`

Desired installation state for python-virtualenv. Boolean values are deprecated
Copy link
Member

Choose a reason for hiding this comment

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

With the data type this looks outdated. Could you remove the mention of boolean values and the allowed values because Enum already tells that.

REFERENCE.md Outdated

Data type: `Enum['absent', 'present', 'latest']`

Desired installation state for Gunicorn. Boolean values are deprecated.
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

REFERENCE.md Outdated
Data type: `Optional[Enum['pip', 'scl', 'rhscl', 'anaconda', '']]`

What provider to use for installation of the packages, except gunicorn and Python itself.
Allowed values: 'pip'
Copy link
Member

Choose a reason for hiding this comment

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

Can also be removed

REFERENCE.md Outdated

Data type: `Any`

Set if the gunicorn config directory should be created. Default: false
Copy link
Member

Choose a reason for hiding this comment

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

The default is already given so can be removed here

REFERENCE.md Outdated
Data type: `Any`

Set the application module name for gunicorn to load when not using Django.
Default: app:app
Copy link
Member

Choose a reason for hiding this comment

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

Redundant default

REFERENCE.md Outdated

Allows setting environment variables for the gunicorn service. Accepts a
hash of 'key': 'value' pairs.
Default: false
Copy link
Member

Choose a reason for hiding this comment

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

Redundant default

REFERENCE.md Outdated

Allows setting the gunicorn idle worker process time before being killed.
The unit of time is seconds.
Default: 30
Copy link
Member

Choose a reason for hiding this comment

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

Redundant default

REFERENCE.md Outdated

Data type: `Any`

Specifies the PATH variable. Default: [ '/bin', '/usr/bin', '/usr/sbin' ]
Copy link
Member

Choose a reason for hiding this comment

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

Outdated and redundant default

@danquack danquack changed the title added yard docs Update modules with defined types for variables as described in docs/Add reference.md Oct 22, 2018
@danquack
Copy link
Contributor Author

All good catches @ekohl. Updated.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

So many data types could be used, but let's consider that out of scope :)

REFERENCE.md Outdated

Data type: `Enum['pip', 'pip3']`

version of pip you wish to use. Default: pip
Copy link
Member

Choose a reason for hiding this comment

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

Default can be removed

REFERENCE.md Outdated Show resolved Hide resolved
REFERENCE.md Outdated
Data type: `Enum['absent', 'present', 'latest']`

Desired installation state for the Python package.
Allowed values: absent, present and latest
Copy link
Member

Choose a reason for hiding this comment

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

Redundant?

REFERENCE.md Outdated

##### `ensure`

Data type: `Any`
Copy link
Member

Choose a reason for hiding this comment

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

The description makes it sound like it should be an enum.

REFERENCE.md Outdated

Data type: `Any`

Copy system site-packages into virtualenv. Default: don't If virtualenv version < 1.7 this flag has no effect since
Copy link
Member

Choose a reason for hiding this comment

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

Looks like something is missing at the end of the sentence.

REFERENCE.md Outdated

Data type: `Any`

reate $venv_dir
Copy link
Member

Choose a reason for hiding this comment

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

Create?

@danquack
Copy link
Contributor Author

Better?

@ekohl
Copy link
Member

ekohl commented Oct 23, 2018

Should we remove docs from README.md and only refer to REFERENCE.md?

@danquack
Copy link
Contributor Author

They were essentially duplicate. And since people look at code, might as well move it and KEEP it in code.

$log_level = 'error',
$template = 'python/gunicorn.erb',
$args = [],
Enum['present', 'abesent'] $ensure = present,
Copy link
Member

Choose a reason for hiding this comment

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

typo in absent

$access_log_format = false,
$accesslog = false,
$errorlog = false,
$log_level = 'error',
Copy link
Member

Choose a reason for hiding this comment

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

nit: odd alignment here

README.md Show resolved Hide resolved
$config = {},
Enum['absent', 'present'] $ensure = 'present',
$filename = $title,
String $owner = 'root',
Copy link
Member

Choose a reason for hiding this comment

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

Can you use String[1] here, to prohibit empty strings?

$filename = $title,
String $owner = 'root',
String $group = 'root',
String $mode = '0644',
Copy link
Member

Choose a reason for hiding this comment

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

String $owner = 'root',
String $group = 'root',
String $mode = '0644',
$config = {},
Copy link
Member

Choose a reason for hiding this comment

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

This can be enforced as a Hash?

@bastelfreak
Copy link
Member

I'm fine with this as is, thanks for the awesome contribution @danquack ! @ekohl should we merge this as is and improve datatypes in further PRs?

@ekohl
Copy link
Member

ekohl commented Oct 25, 2018

@ekohl should we merge this as is and improve datatypes in further PRs?

Yes, I also saw room for a lot of improvement but I'm fine with merging this now. Actually I'd prefer to do it now because some of those changes might be considered breaking. Probably easier to review if we split it off.

@wyardley wyardley merged commit 81e3715 into voxpupuli:master Oct 26, 2018
@danquack danquack deleted the dev branch October 26, 2018 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants