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

Add graph_facts variable to enable graphing (pie/bar) of Puppet facts #377

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

Conversation

bschonec
Copy link

Pull Request (PR) description

The extra_settings is somewhat cumbersome to use for GRAPH_FACTS in the settings.py file because it necessitates escaping the single quote character around the facts to be graphed. This PR adds the graph_facts variable as an array, sorts and unique-ifies the array and wraps the result in a set of single quotes:

GRAPH_FACTS = 'kernel,operatingsystem,operatingsystemmajrelease'

REFERENCE.md Outdated

Data type: `Optional[Variant[String[1], Array[String[1]]]]`

A list of the puppet facts to graph. See ''https://github.com/voxpupuli/puppetboard''
Copy link
Member

Choose a reason for hiding this comment

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

This file needs to be regenerated since it doesn't match the documentation comment.

Copy link
Author

@bschonec bschonec Jan 4, 2023

Choose a reason for hiding this comment

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

Pardon my ignorance but I don't know what you mean by "needs to be regenerated." How does one regenerate this file?

Copy link
Member

Choose a reason for hiding this comment

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

bundle exec rake reference

@bschonec bschonec force-pushed the add_graph_facts_option branch from b8bfc09 to 6a4c27b Compare January 4, 2023 12:51
@@ -63,6 +63,9 @@ DEFAULT_ENVIRONMENT = '<%= @default_environment %>'
<% if @reports_count -%>
REPORTS_COUNT = <%= @reports_count %>
<% end -%>
<% if @graph_facts -%>
GRAPH_FACTS = '<%= @graph_facts.sort.uniq.join(',') %>'
Copy link
Member

Choose a reason for hiding this comment

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

please add a unit test for the change with a string as input and one with an array. We need to ensure the sort.uniq.join construct works with strings as well.

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.

3 participants