Skip to content

Update additional templates to use annotations #1287

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

Merged
merged 6 commits into from
Jul 17, 2023

Conversation

ashovlin
Copy link
Member

@ashovlin ashovlin commented Aug 26, 2022

Issue #, if available: DOTNET-6189

Description of changes:
Updates to the Visual Studio 2022 templates:

  1. Updated Lambda Empty Serverless to use annotations. Instructions are provided in the readme to manually revert to the older style.
  2. Updated Lambda Empty Serverless (.NET 6 Container Image) to use annotations. Instructions are provided in the readme to manually revert to the older style.
  3. Updated the Annotations Framework template to remove "preview" language.

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

/// <returns>The API Gateway response.</returns>
public APIGatewayProxyResponse Get(APIGatewayProxyRequest request, ILambdaContext context)
/// <remarks>
/// This uses the Lambda Annotations programming model to bridge the gap between
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a link to the README also call out that it takes care of syncing with CloudFormation. It is important users realize this change in behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added both:

  • A link to the GitHub readme
  • A line about template syncing.

I couldn't figure out how to do a <see> link to the local readme, I think because it's not a .NET object.

@@ -1,7 +1,7 @@
{
"display-name": "Annotations Framework",
"system-name": "Annotations",
"description": "(Preview) Use the .NET Lambda Annotations framework to write Lambda Functions.",
"description": "Use the .NET Lambda Annotations framework to write Lambda Functions.",
Copy link
Member

Choose a reason for hiding this comment

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

  • Rename this to Annotations Framework Sample
  • Edit the description to here to show how this is a sample to demonstrate the features of the framework.
  • Show off the DI by adding an ICalculatorService and registering it in the DI. Then updated Startup class to register it.
  • In the test project you could create a Mock ICalculatorService to show how with DI you can mocking the services.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

I only injected the ICalculatorService into the constructor since that felt more realistic, but we could also do a [FromServices] for the sake of it.

@ashovlin ashovlin force-pushed the shovlia/annotations-template-updates branch 2 times, most recently from ee17af0 to 48a3d87 Compare August 31, 2022 21:16
@ashovlin ashovlin requested a review from normj August 31, 2022 21:26
@ashovlin ashovlin changed the title Update additional templates to use annotations Update additional templates to use annotations [hold until 1.0] Sep 12, 2022
@ashishdhingra ashishdhingra added the feature-request A feature should be added or improved. label Oct 11, 2022
@ashovlin ashovlin force-pushed the shovlia/annotations-template-updates branch from 48a3d87 to 972f0d0 Compare July 14, 2023 15:12
@ashovlin ashovlin force-pushed the shovlia/annotations-template-updates branch from 972f0d0 to bec4d79 Compare July 14, 2023 15:13
@ashovlin ashovlin changed the base branch from features/annotations-templates-ga to dev July 14, 2023 15:15
@ashovlin ashovlin changed the title Update additional templates to use annotations [hold until 1.0] Update additional templates to use annotations Jul 14, 2023
@ashovlin ashovlin requested a review from philasmar July 14, 2023 21:33
@ashovlin
Copy link
Member Author

Finished a round of updates:

  • Annotations-related blueprints now rely on 1.0.0
  • serverless.Annotations was missing from the testing target in the build.proj, added it
  • Incremented Amazon.Lambda.Templates 16.13.1 -> 16.14.0

@@ -1,10 +1,18 @@
# .NET Lambda Annotations Framework (Preview)
# Amazon.Lambda.Annotations
Copy link
Member Author

Choose a reason for hiding this comment

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

This is just the entire package README copied and pasted, don't think we need to re-review content here

Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

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

I did a sanity check deployment through Visual Studio with 3 templates being updated here and they all deployed correctly.

@ashovlin ashovlin requested a review from normj July 15, 2023 01:25
@@ -15,6 +15,9 @@ public class Startup
/// </summary>
public void ConfigureServices(IServiceCollection services)
{
// Here we'll add an instance of our calculator service that be used by each function
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: missing "will" before "be used"

@ashovlin ashovlin merged commit 7e1f386 into dev Jul 17, 2023
@ashovlin ashovlin deleted the shovlia/annotations-template-updates branch July 17, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants