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

feat: whatif input provider #1538

Merged
merged 1 commit into from
Feb 10, 2021
Merged

feat: whatif input provider #1538

merged 1 commit into from
Feb 10, 2021

Conversation

roleyfoley
Copy link
Contributor

Description

Closes: #1535

  • Creates a new input provider, the whatif provider
  • Refactors some of the input processing functions so they can be shared across providers

Motivation and Context

The whatif input provider allows you to use a composite CMDB to create and query deployments before actually deploying the changes you've made in your CMDB

Input sources are primarily handled the same way as the composite input source except for StackOutputs. The whatif provider checks to see if a composite stack output can be found and if it can't then it will return a mocked output instead

This allows you to add components to a CMDB to see what they will create before deploying any of their required components. This is really helpful when generating diagrams or running through demonstrations where you don't want to wait for deployments to complete

How Has This Been Tested?

Tested locally

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves the structure or operation of the implementation)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Followup Actions

  • None

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • None of the above.

The whatif input provider allows you to use your composite CMDB to
create and query deployments before actually deplyowing the changes
you've made in your CMDB

Input sources are primarily handled the same way as the composite input
source except for StackOutputs. The whatif provider checks to see if a
composite stack output can be found and if it can't then it will return
a mocked output instead

This allows you to add components to a CMDB to see what they will create
before deploying any of their required components
[#return result]
[/#function]

[#function internalReformatFiles key settingsFiles fileRegex]
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment here on the purpose of the reformat would be helpful. A lot of reading is required to understand the desired final format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved these functions from composite to the shared provider so they would be available to both providers. Writing these functions wasn't part of this change

@RossMurr4y RossMurr4y merged commit c97b159 into hamlet-io:master Feb 10, 2021
@roleyfoley roleyfoley deleted the whatif-input branch February 10, 2021 23:52
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.

Mockoutput input provider
2 participants