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

fix: dotnet lambda templates compilation issues #11562

Merged
merged 8 commits into from
Dec 8, 2022

Conversation

sobolk
Copy link
Member

@sobolk sobolk commented Dec 8, 2022

Description of changes

This PR fixes existing dotnet templates and makes sure that they work (i.e. compile and return something).

Current samples (except Hello World) don't compile due to dependency conflicts.
image

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sobolk sobolk requested a review from a team as a code owner December 8, 2022 05:39
}); // will throw if successString is not in output
});

it('add dotnet crud function and invoke in the cloud', async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

crud template is not able to use amplify mock function. it requires ddb table reference at runtime. Hence this test pushes and calls real lambda.

expect(JSON.parse(response.Payload.toString())).toEqual(helloWorldSuccessObj);
});

it('add dotnet serverless function and mock locally', async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

new coverage is base on mock as it compiles and runs dotnet code locally. this is best effort, some templates like crud don't work locally.

@@ -1,7 +1,7 @@
{
"body": null,
"resource": "<%= props.functionTemplate.parameters.path %>/{proxy+}",
"path": "<%= props.functionTemplate.parameters.path %>/",
"path": "<%= props.functionTemplate.parameters.path %>/<%= props.functionTemplate.parameters.database.tableDefinition.partitionKeyName %>:foo",
Copy link
Member Author

Choose a reason for hiding this comment

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

while we don't use this event in test I was playing a bit with this in aws console to invoke resulting lambda.
previous version was leading to error response asking for missing path parameter - this change fixes this.

@sobolk sobolk changed the title fix: fix dotnet lambda templates fix: dotnet lambda templates Dec 8, 2022
@sobolk sobolk changed the title fix: dotnet lambda templates fix: dotnet lambda templates compilation issues Dec 8, 2022
jhockett
jhockett previously approved these changes Dec 8, 2022
Copy link
Contributor

@jhockett jhockett left a comment

Choose a reason for hiding this comment

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

LGTM, I left 1 suggestion for consideration, but not blocking

@sobolk sobolk merged commit 2b81f92 into aws-amplify:dev Dec 8, 2022
@sobolk sobolk deleted the fix-dotnet-templates branch December 8, 2022 21:17
sobolk added a commit that referenced this pull request Dec 8, 2022
* fix: fix dotnet lambda templates

* fix: fix naming

* fix: split function_3

* fix: cover triggers

* fix: fix tests

* fix: fix tests

* fix: add kinesis test

* chore: pr feedback
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.

3 participants