Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

CHEF-52: Add licensing information to help output #27

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

ahasunos
Copy link
Contributor

@ahasunos ahasunos commented Mar 24, 2023

Description

This PR adds the chef-licensing cli flags to InSpec's cli class, enabling users to view licensing-related flags when they enter inspec help, inspec --help, or inspec. Additionally, PR #10 introduces the license plugin to InSpec, which displays further chef-licensing related help information.

Output of inspec help

Commands:
  inspec archive PATH                                  # Archive a profile to a tar file (default) or zip file.
  inspec automate SUBCOMMAND or compliance SUBCOMMAND  # Chef Automate commands
  inspec check PATH                                    # Verify the metadata in the `inspec.yml` file, verify that control blocks have the correct fields (title, description, impact), and define that all controls have visible tests and the co...
  inspec clear_cache                                   # clears the InSpec cache. Useful for debugging.
  inspec detect                                        # detects the target OS.
  inspec env                                           # Outputs shell-appropriate completion configuration.
  inspec exec LOCATIONS                                # Run all test files at the specified locations.
  inspec export PATH                                   # read the profile in PATH and generate a summary in the given format.
  inspec habitat SUBCOMMAND                            # Manage Habitat with Chef InSpec
  inspec help [COMMAND]                                # Describe available commands or one specific command
  inspec init SUBCOMMAND                               # Generate InSpec code
  inspec json PATH                                     # read all tests in the PATH and generate a JSON summary.
  inspec license SUBCOMMAND [options]                  # Manage Chef InSpec license
  inspec parallel SUBCOMMAND [options]                 # Runs Chef InSpec operations parallely
  inspec plugin SUBCOMMAND                             # Manage Chef InSpec and Train plugins
  inspec shell                                         # open an interactive debugging shell.
  inspec sign SUBCOMMAND                               # Manage Chef InSpec profile signing.
  inspec supermarket SUBCOMMAND ...                    # Supermarket commands
  inspec vendor PATH                                   # Download all dependencies and generate a lockfile in a `vendor` directory
  inspec version                                       # prints the version of this tool.

Options:
  l, [--log-level=LOG_LEVEL]                         # Set the log level: info (default), debug, warn, error
      [--log-location=LOG_LOCATION]                  # Location to send diagnostic log messages to. (default: $stdout or Inspec::Log.error)
      [--diagnose], [--no-diagnose]                  # Show diagnostics (versions, configurations)
      [--color], [--no-color]                        # Use colors in output.
      [--interactive], [--no-interactive]            # Allow or disable user interaction
      [--disable-user-plugins]                       # Disable loading all plugins that the user installed.
      [--enable-telemetry], [--no-enable-telemetry]  # Allow or disable telemetry
      [--chef-license=CHEF_LICENSE]                  # Accept the license for this product and any contained products: accept, accept-no-persist, accept-silent
      [--chef-license-key=CHEF_LICENSE_KEY]          # Add a new Chef License Key to the license store. Ignores duplicates.

Chef Compliance has three tiers of licensing:

* Free-Tier
  Users are limited to audit maximum of 10 targets
  Entitled for personal or non-commercial use

* Trial
  Entitled for unlimited number of targets
  Entitled for 30 days only
  Entitled for commercial use

* Commercial
  Entitled for purchased number of targets
  Entitled for period of subscription purchased
  Entitled for commercial use

inspec license add: This command helps users to generate or add an additional license

For more information please visit:
www.chef.io/licensing/faqs

About Chef InSpec:
  Patents: chef.io/patents

Output of inspec license help

Commands:
  inspec license add             # Add a new license
  inspec license help [COMMAND]  # Describe subcommands or one specific subcommand
  inspec license list            # List licenses

Options:
  [--log-level=LOG_LEVEL]        # Set the log level: info (default), debug, warn, error
  [--log-location=LOG_LOCATION]  # Location to send diagnostic log messages to. (default: $stdout or Inspec::Log.error)

Chef Compliance has three tiers of licensing:

* Free-Tier
  Users are limited to audit maximum of 10 targets
  Entitled for personal or non-commercial use

* Trial
  Entitled for unlimited number of targets
  Entitled for 30 days only
  Entitled for commercial use

* Commercial
  Entitled for purchased number of targets
  Entitled for period of subscription purchased
  Entitled for commercial use

inspec license add: This command helps users to generate or add an additional license

For more information please visit:
www.chef.io/licensing/faqs

About Chef InSpec:
  Patents: chef.io/patents

Related Issue

CHEF-52: Add licensing information to help output in inspec

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.

@ahasunos ahasunos requested a review from a team as a code owner March 24, 2023 06:35
@ahasunos ahasunos requested review from clintoncwolfe and sathish-progress and removed request for a team March 24, 2023 06:35
Copy link
Contributor

@Nik08 Nik08 left a comment

Choose a reason for hiding this comment

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

I guess the tests need to run on this, else looks good!

@ahasunos ahasunos force-pushed the ss/add-licensing-info-to-help branch from 0f01896 to 16f3f7e Compare March 24, 2023 07:06
@Vasu1105
Copy link
Contributor

It's not very clear in this PR what inspec --help will show.

@ahasunos
Copy link
Contributor Author

It's not very clear in this PR what inspec --help will show.

Updated the description. Please check @Vasu1105

@Vasu1105
Copy link
Contributor

As per the feature request help should show information about how to add a license and how licensing work "When you run inspec -h, inspec help, or inspec (no options), and you see the big help message, it should include information about how to add a license, and how licensing works.". After reading the feature description, I am slightly doubtful whether this is the desired outcome. If "yes" then LGTM

Base automatically changed from nm/license-list-cmd to inspec-6 March 31, 2023 07:51
@ahasunos ahasunos changed the title CHEF-52: Add licensing information to help output [WIP] CHEF-52: Add licensing information to help output Apr 5, 2023
@ahasunos ahasunos marked this pull request as draft April 5, 2023 10:20
@ahasunos ahasunos force-pushed the ss/add-licensing-info-to-help branch from 16f3f7e to 51277d6 Compare April 5, 2023 10:36
@ahasunos ahasunos marked this pull request as ready for review April 12, 2023 14:11
@ahasunos ahasunos changed the title [WIP] CHEF-52: Add licensing information to help output CHEF-52: Add licensing information to help output Apr 12, 2023
@clintoncwolfe
Copy link
Contributor

The help text has been updated with the current text according to Lokesh, which does cover the licensing approach.

@clintoncwolfe clintoncwolfe merged commit 8e26441 into inspec-6 Apr 12, 2023
@clintoncwolfe clintoncwolfe deleted the ss/add-licensing-info-to-help branch April 12, 2023 14:14
sathish-progress pushed a commit that referenced this pull request May 17, 2023
* CHEF-LICENSING: Add licensing flags info in help output

Signed-off-by: Sonu Saha <[email protected]>

* INFO: Add chef-licensing info to help message

Signed-off-by: Sonu Saha <[email protected]>

---------

Signed-off-by: Sonu Saha <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants