Description of changes: This change makes some request fields optional/removes certain fields so that contract testing via cfn test can complete successfully without library errors. Below are a list of the changes to the request:
Made resourceType, resourceTypeVersion, and stackId optional. Making resourceType optional led to some issues with metrics publishing, so I had to refactor the MetricPublisher and MetricsPublisherProxy. This led to the layout being much more in line with the java plugin, where the proxy has no required arugments for construction and simply loops through available publishers when publishing. Any arguments pertinent to metric publishing are now passed into the actual publisher class, like resource type name and provider session. The changes to metrics publishing also conditionally create the publisher and logging when there are provider logging credentials and a log group name.
requestContext is removed as this is a relic of the original protocol and no longer relevant.
The first commit contains the bulk of these changes. The second commit just changes MetricPublisher->MetricsPublisher so the spelling is in line with the java plugin and the proxy :)
Testing done:
Created a dummy resource with the latest cloudformation-cli and ran cfn-test on a resource with this new support lib. Tests did not fail in the handler support lib like previously.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: #112 #109
Description of changes: This change makes some request fields optional/removes certain fields so that contract testing via
cfn test
can complete successfully without library errors. Below are a list of the changes to the request:Made
resourceType
,resourceTypeVersion
, andstackId
optional. MakingresourceType
optional led to some issues with metrics publishing, so I had to refactor the MetricPublisher and MetricsPublisherProxy. This led to the layout being much more in line with the java plugin, where the proxy has no required arugments for construction and simply loops through available publishers when publishing. Any arguments pertinent to metric publishing are now passed into the actual publisher class, like resource type name and provider session. The changes to metrics publishing also conditionally create the publisher and logging when there are provider logging credentials and a log group name.requestContext
is removed as this is a relic of the original protocol and no longer relevant.The first commit contains the bulk of these changes. The second commit just changes MetricPublisher->MetricsPublisher so the spelling is in line with the java plugin and the proxy :)
Testing done:
Created a dummy resource with the latest cloudformation-cli and ran cfn-test on a resource with this new support lib. Tests did not fail in the handler support lib like previously.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.