-
Notifications
You must be signed in to change notification settings - Fork 4k
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(api-gateway): allow configuration of deployment description #21207
feat(api-gateway): allow configuration of deployment description #21207
Conversation
remove trailing spaces
@peterwoodworth since RestApi already has a description (it was just never passed to |
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.
Thank you for your contribution. Please see my comment below. We will provide a more thorough review once the build is fixed and tests have been written.
@@ -554,7 +561,7 @@ export abstract class RestApiBase extends Resource implements IRestApi { | |||
if (deploy) { | |||
|
|||
this._latestDeployment = new Deployment(this, 'Deployment', { | |||
description: 'Automatically created by the RestApi construct', | |||
description: props.description? props.description :'Automatically created by the RestApi construct', |
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.
Take a closer look at where this function is called. It's in two constructors, SpecRestApi
and RestApi
. The props for one of these doesn't have the description
field. You'll need to add it there and then add some tests in both places for the output of description
being set and not being set.
I will exempt a README change for this but it will require an update to the expected output of the integ tests as this will change the 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.
Thank you @TheRealAmazonKendra ! That raises another question I had - how do I update those integration test outputs? Do I have to run a CDK synth, and if so, what do I need to pass to it?
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.
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.
If RestApiProps
has a description var, and SpecRestApiProps
extends RestApiBaseProps
(where I added the var), do I need to add code to those constructors? Is it problematic that this description would possibly overlap with a description in the OpenAPI specification?
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 interpreted the both the error message and the code wrong. Scratch everything I said and sorry for the confusion on my part.
The issue here is that RestApiProps
extends RestApiOptions
which extends RestApiBaseProps
. So, description
is being declared twice in the context of RestApiProps
. Since you are (correctly) adding it to RestApiBaseProps
it should be removed from RestApiProps
. I think that will solve the error.
Two additional quick notes: This PR needs a body that aligns with our guidelines in the Pull Request section of the contributing guide. Please review that and revise the PR body. The title is great and needs no update. Since you're not writing new integration tests, you don't really have to do the whole process in the file I linked to. Just run the build, see where the failures are, and update the expected values in those files as long as it aligns with what you'd expect to see as output. You can either push changes and let CodeBuild run until failure and push another change to fix that failure (this will likely take a few attempts) or you can do it locally. If you do it locally, I highly recommend using the Once the builds are complete, run |
Pull request has been modified.
Thanks for the helpful info - running the full build locally now, but I committed that change and edited the PR body. I don't think I can see anything from CodeBuild? It wants me to authenticate first. |
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.
Thanks for the helpful info - running the full build locally now, but I committed that change and edited the PR body. I don't think I can see anything from CodeBuild? It wants me to authenticate first.
You can read the output once the build completes. In this case, no integ test updates were needed so I'll exempt that. Please do add tests for both the case when you add a description and when you don't. Once we get that, I see this as done.
added tests for: - instantiating RestApi with description - instantiating RestAPI with no description - calling _configureDeployment with a custom description - calling _configureDeployment with no description
…loyment-description
Pull request has been modified.
I added tests for creating a RestApi with and without a description, and tests for calling _configureDeployment with and without a description (since calling _configureDeployment defaults to 'Automatically created by the RestApi construct' instead of being blank). Linter still wants an update to the integration tests - I was running those but wasn't sure if you wanted me to update the snapshots, then I dropped it when I saw your message. |
Removed double quotations
…cription' of https://github.com/josephedward/aws-cdk into feat(api-gateway)-allow-configuration-of-deployment-description
removing _configureDeployment
Oooops. You're totally right that I said I'd exempt integ test updates and then forgot to. It is possible, though, that the output will be impacted and an update will need to be made to the snapshots. Without looking through the tests themselves, I can't say for sure. |
@@ -333,6 +333,23 @@ export interface SecureStringParameterAttributes extends CommonStringParameterAt | |||
* @example | |||
* | |||
* const ssmParameter = new ssm.StringParameter(this, 'mySsmParameter', { | |||
<<<<<<< HEAD |
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.
Looks like the merge went wrong here.
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.
Sorry about that! I must have pulled from main on my local fork.
trailing spaces and semicolon
…loyment-description
…loyment-description
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…loyment-description
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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…#21207) ---- Closes aws#20934 Motivation: Customer would like to be able to set the description per deployment. From inside their pipeline, they could get the commit hash / commit message, timestamp, custom text, and other git-related metadata that they would like to set as description. Thanks to @TheRealAmazonKendra for help cleaning this PR up and providing some pointers on locally building the CDK. ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…#21207) ---- Closes aws#20934 Motivation: Customer would like to be able to set the description per deployment. From inside their pipeline, they could get the commit hash / commit message, timestamp, custom text, and other git-related metadata that they would like to set as description. Thanks to @TheRealAmazonKendra for help cleaning this PR up and providing some pointers on locally building the CDK. ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…#21207) ---- Closes aws#20934 Motivation: Customer would like to be able to set the description per deployment. From inside their pipeline, they could get the commit hash / commit message, timestamp, custom text, and other git-related metadata that they would like to set as description. Thanks to @TheRealAmazonKendra for help cleaning this PR up and providing some pointers on locally building the CDK. ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…#21207) ---- Closes aws#20934 Motivation: Customer would like to be able to set the description per deployment. From inside their pipeline, they could get the commit hash / commit message, timestamp, custom text, and other git-related metadata that they would like to set as description. Thanks to @TheRealAmazonKendra for help cleaning this PR up and providing some pointers on locally building the CDK. ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Closes #20934
Motivation: Customer would like to be able to set the description per deployment. From inside their pipeline, they could get the commit hash / commit message, timestamp, custom text, and other git-related metadata that they would like to set as description.
Thanks to @TheRealAmazonKendra for help cleaning this PR up and providing some pointers on locally building the CDK.
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license