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 development and testing option to permit installing unsupported PE versions #204

Merged
merged 2 commits into from
Sep 29, 2021

Conversation

jarretlavallee
Copy link

@jarretlavallee jarretlavallee commented Sep 9, 2021

Prior to this PR, there was no way to force an override to the PE version assertion. This PR adds a new parameter that will override the PE version check and output a warning when enabled. This is useful in testing new PE versions that are not yet supported by the module.

Note that the installation plan will emit two copies of the warning due to the function call in the install and subplan::install plans. I did not correct this as it seems acceptable to emit the warning multiple times.

Starting: plan peadm::install
WARNING: Permitting unsafe PE versions. This is not supported or tested.
  Proceeding with this action could result in a broken PE Infrastructure.

WARNING: Permitting unsafe PE versions. This is not supported or tested.
  Proceeding with this action could result in a broken PE Infrastructure.

Starting: plan peadm::subplans::install

@jarretlavallee jarretlavallee requested a review from a team as a code owner September 9, 2021 14:50
@CLAassistant
Copy link

CLAassistant commented Sep 9, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@reidmv reidmv left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @jarretlavallee!

I'd like to request some minor changes.

  1. Please rename peadm::install::enable_unsafe_versions to peadm::install::permit_unsafe_versions. I think "permit" better describes what is going on here compared to "enable".
  2. Please use the same parameter name, permit_unsafe_versions, in the function - it isn't as meaningful there, but it would be good for consistency.
  3. In the function, please change the warning text "Enabling" to "Permitting".

Thanks!!

Prior to this commit, there was no way to force an override to the PE
version assertion. This commit adds a new parameter that will override
the PE version check and output a warning when enabled. This is useful
in testing new PE versions that are not yet supported by the module.
@jarretlavallee jarretlavallee force-pushed the sup_2643_version_override branch from c6572e5 to d98c551 Compare September 24, 2021 14:55
@jarretlavallee
Copy link
Author

@reidmv Sorry for the delayed response as I somehow missed the email. Thank you for taking the time to review this. I made the changes as you described.

Copy link
Contributor

@reidmv reidmv left a comment

Choose a reason for hiding this comment

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

Thanks @jarretlavallee!

I just realized looking at the specs that what should happen here when $permit_unsafe_versions = true is, the assertion should not fail the plan, but the return data should actually state { supported => false }.

If you have time to make that tweak I think that'll make this ready to merge. If not, I can probably sneak it in soon myself, after which we can merge it.

Lemme know if you start working on that change. I'll do the same; just wanna avoid duplicating effort :D


context 'unsafe versions' do
it 'accepts PE versions that are too old' do
is_expected.to run.with_params('2018.1.0', true).and_return({ 'supported' => true })
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, shoot. Just realized that the intuitive result here is that the assert function does NOT raise (good so far), but the return value should actually be { 'supported' => false }.

The new $permit_unsafe_versions parameter allows the
assert_supported_pe_version() function to not raise on failure, but it
should always return accurate data about whether or not the given
version is or isn't supported.
@reidmv reidmv self-requested a review September 29, 2021 04:46
@reidmv reidmv changed the title (SUP-2643) Add option to override version assertion Add development and testing option to permit installing unsupported PE versions Sep 29, 2021
@reidmv reidmv added the feature label Sep 29, 2021
@reidmv reidmv merged commit c0908a2 into puppetlabs:main Sep 29, 2021
@jarretlavallee jarretlavallee deleted the sup_2643_version_override branch September 29, 2021 16:00
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.

3 participants