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 chef-licensing, syncing from inspec-prime repo inspec-6 branch #6559

Merged
merged 88 commits into from
Jul 7, 2023

Conversation

clintoncwolfe
Copy link
Contributor

Description

This PR integrates the chef-licensing gem into inspec. This will cause InSpec 6 to require a license key on first run, or else require the use of a local license server. Several tiers of licenses, including free, trial, and commerial licenses, are available.

This PR pulls the privately developed inspec-6 branch from the till-now private inspec/inspec-prime repo, which was used to integrate with the chef-licensing gem.

Related Issue

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.

clintoncwolfe and others added 30 commits March 10, 2023 11:52
* Move old expeditor config out of the way in prep for syncing

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Introduce basic expeditor config (#2)

* CONFIG: Introduce basic expeditor config

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* CONFIG: Introduce release branches, changelog updates and slack notification

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Sonu Saha <98935583+ahasunos@users.noreply.github.com>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Sonu Saha <sonu.saha@progress.com>
Signed-off-by: Sean Simmons <ssimmons@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
…ibus release (#15)

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Sean Simmons <ssimmons@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Obvious fix; these changes are the result of automation not creative thinking.
* Enable secrets mode on verify pipelines, which apparently works on ruby3.0 image anyway on coverage pipeline

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Fetch chef licensing server and API key from vault, linux implementation

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Fetch chef licensing server and API key from vault, windows implementation

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Add diagnostic to test whether API key has been set and exit if not

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Secrets missed on two jobs

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add diagnostic to test whether API key has been set on windows

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Add license key to env var list and gate verify pipeline on it

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

---------

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
* Add invocation for chef licensing to fetch and persist license

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Flow changes of licensing with EULA acceptance

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Changed empty to blank safe check

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Exit code changes in case of invalid licenses

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Update temporary gempath to use relatiive path

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* CFINSPEC-506 license execution check

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Handling in inspec for invalid licenses

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Handling of client error

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Replaced subclasses of exceptions with super class error

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Chef licensing gem changes pointing to git url

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Configured chef licensing with inspec

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Local chef licensing gem configuration removed

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Removed logger configuration for chef licensing

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Require changes for new library chef-licensing

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
Obvious fix; these changes are the result of automation not creative thinking.
* CFINSPEC-24:Integrate License Software Entitlment.

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* CFINSPEC-506 license execution check

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Software entitlement call changes and handling of error

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Error handling from chef licensing error to standard error

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Updated Gemfile to pick the chef licensing changes from git url

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Trying with https url

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Revert "Trying with https url"

This reverts commit 33f1f4c0ecacf9ba2826e25e55b41219903ea736.

* Adds the license not entitled exit code

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Updates the require statement

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Fix typo

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Set the licensing configure for entitlement id failure

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Use ChefLicensing::Error instead of standard error

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* REFACTOR Move out licensing cong=fig to its own file and make unconditional

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* FIX TESTS - Add reference to licensing config for places where we call runner explicitly.

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Update inputs_test to use license configuration from utils

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Obvious fix; these changes are the result of automation not creative thinking.
* Initial commit to set inspec cli command license

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* INTEGRATE: Use chef_licensing endpoint to list licenses info

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* CHORE: Update chef-licensing gem name, update description

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* CHEF-56 License add command integrated (#11)

* Added license add command in inspec license command plugin

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Chef licensing gem changes pointing to url and branch

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* EXEC_NAME is always inspec as set in Dist,
check is not required

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* DOCS: Update docs for the plugin

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* DOCS: Update docs for the plugin

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Nikita Mathur <Nik08@users.noreply.github.com>
Obvious fix; these changes are the result of automation not creative thinking.
* CHEF-LICENSING: Add licensing flags info in help output

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* INFO: Add chef-licensing info to help message

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
* KITCHEN: Remove kitchen group from Gemfile,
revert this change when required

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* LINT: Remove trailing whitespace

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
…ist (#30)

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
…licensing (#34)

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Co-authored-by: Vasundhara Jagdale <vasundhara.jagdale@chef.io>
Obvious fix; these changes are the result of automation not creative thinking.
clintoncwolfe and others added 16 commits July 4, 2023 15:58
…ashing due to error log rename (#74)

* Error logging changes to fix renaming of files in windows

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Parallel rename, delete and logging fix for windows

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Log path changes reverted after testing with static logs directory

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fix lint

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Logic to rename error log files on interrupt

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* An attempt to reduce the delay on control c interrupt by killing child process instantly

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Only rename existing file of the child process to avoid conficts in renaming

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fix in renaming with control-c interrupt by invoking from command library itself

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added logic to wait for processes to die after process kill, to fix error on interrupt

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Removed idle inititation on status super reporter for parallel - needs future improvements

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fileutils Mkdir usage refactoring

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Co-authored-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
Obvious fix; these changes are the result of automation not creative thinking.
Bumps [omnibus-software](https://github.com/chef/omnibus-software) from `88169e3` to `4b08f0b`.
- [Commits](chef/omnibus-software@88169e3...4b08f0b)

---
updated-dependencies:
- dependency-name: omnibus-software
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Obvious fix; these changes are the result of automation not creative thinking.
…t connection (#6494) (#40)

* Add support for custom port with a socket connection



* Add tests for the postgres_session with custom port



---------

Signed-off-by: Pg <pg.developper.fr@gmail.com>
Co-authored-by: Pg <pg.developper.fr@gmail.com>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Obvious fix; these changes are the result of automation not creative thinking.
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
* Adds test for licensing_config

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Fix lint

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Read the value of license server url from env for test

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Spell InSpec corrrectly in test

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Linting

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Obvious fix; these changes are the result of automation not creative thinking.
…xception during `license add` (#77)

* FIX: Handle invalid license exception as handled in base_cli:57

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Use 174 error code when exiting with license subsystem error from license add

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

---------

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
@clintoncwolfe clintoncwolfe requested review from a team as code owners July 7, 2023 19:41
@github-actions github-actions bot added the Documentation ZH multi-repo label for the docs-team label Jul 7, 2023
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
@clintoncwolfe clintoncwolfe merged commit d64488f into inspec-6 Jul 7, 2023
3 of 4 checks passed
@clintoncwolfe clintoncwolfe deleted the inspec-6-from-prime-2 branch July 7, 2023 21:13
chef-expeditor bot pushed a commit that referenced this pull request Jul 7, 2023
Obvious fix; these changes are the result of automation not creative thinking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants