-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(appsync): resolver unable to set pipelineConfig #9093
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
Conversation
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
/** | ||
* type of resolver | ||
* | ||
* @default - UNIT resolver, single data source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @default - UNIT resolver, single data source | |
* @default ResolverType.UNIT |
/** | ||
* configuration of the pipeline resolver | ||
* | ||
* @default - create a UNIT resolver | ||
* @default - No pipelineConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @default - No pipelineConfig | |
* @default - no pipeline resolver configuration |
@@ -19,3 +19,27 @@ test('should not throw an Error', () => { | |||
// Then | |||
expect(when).not.toThrow(); | |||
}); | |||
|
|||
test('should not throw an Error', () => { | |||
// Given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Given | |
// GIVEN |
// Given | ||
const stack = new cdk.Stack(); | ||
|
||
// When |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// When | |
// WHEN |
}); | ||
}; | ||
|
||
// Then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Then | |
// WHEN |
@@ -19,3 +19,27 @@ test('should not throw an Error', () => { | |||
// Then | |||
expect(when).not.toThrow(); | |||
}); | |||
|
|||
test('should not throw an Error', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about a more descriptive name that contain the conditions under test
}; | ||
|
||
// Then | ||
expect(when).not.toThrow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we verify the expected cloudformation template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also add a README example to cover usage of the pipeline config?
*/ | ||
readonly pipelineConfig?: CfnResolver.PipelineConfigProperty | IResolvable; | ||
readonly pipelineConfig?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be more strongly typed? or is there a good reason why strings would be ideal?
this motivation for this is not covered in the commit body, can we add that?
it's especially important since this is a breaking change (also needs mention in commit body)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmmm originally the type would have been this:
{
functions: [...]
}
where the functions parameter just took a string []
anyways, so changed it to just a string []
after following Mitch's suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also is this a breaking change?
the pipelineConfig
prop doesn't actually do anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have an issue for pipelineConfig doing nothing?
consider this:
- user has a CDK application where they have specified a pipelineConfig of type
PipelineConfigProperty
after this change, when they "upgrade" and just build.. it will fail saying the type is not a match. They have not changed anything about their application other than upgrade, but their build is now failing.
I think it would break which is why I'd consider this to be a breaking change. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flattening out the object is a convenience I think since it's the only property. Technically cfn could add more optional properties in the future and we would have to handle those but that happens either way.
I think the more strongly typed could be 'IFunction[]'. @BryanPan342 does that make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. added a do-not-merge so @MrArnoldPalmer can also have a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think typing to 'IFunction[]' for pipelineConfig probably makes sense. We can also change the property name to 'pipelineFunctions' to make it more descriptive and different to the L1 prop.
@MrArnoldPalmer so See documentation on See documentation on See documentation on I opened up an issue #9092 for a feature request for AppSync function creation. Currently you can make an L1 version of it. But the |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
**[ISSUE]** `pipelineConfig` was be labeled as `undefined` while using the `Resolver` class instead of `createResolver`. Also, no way to set `kind` parameter for resolvers, so implemented that as well. **[APPROACH]** Created a property that takes `pipelineConfig` for `AppSync` functions. **[NOTE]** `pipelineConfig` takes a string array for the name of `AppSync Functions` not `Lambda Functions` Fixes aws#6923 BREAKING CHANGE: `pipelineConfig` is now an array of `string` instead of `CfnResolver.PipelineConfigProperty` for usability. - **appsync**: `pipelineConfig` parameter takes in `string []` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
[ISSUE]
pipelineConfig
was be labeled asundefined
while using theResolver
class instead ofcreateResolver
. Also, no way to setkind
parameter for resolvers, so implemented that as well.[APPROACH]
Created a property that takes
pipelineConfig
forAppSync
functions.[NOTE]
pipelineConfig
takes a string array for the name ofAppSync Functions
notLambda Functions
Fixes #6923
BREAKING CHANGE:
pipelineConfig
is now an array ofstring
instead ofCfnResolver.PipelineConfigProperty
for usability.pipelineConfig
parameter takes instring []
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license