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

sync foss changes #2359

Merged
merged 2 commits into from Apr 8, 2022
Merged

sync foss changes #2359

merged 2 commits into from Apr 8, 2022

Conversation

mingkun2020
Copy link
Contributor

@mingkun2020 mingkun2020 commented Mar 23, 2022

Description of changes:
Sync foss public repo with recent changes.

Description of how you validated changes:
Tested in local and success

  • make pr passes
  • Update documentation
  • Verify transformed template deploys and application functions as expected

Examples?

Please reach out in the comments, if you want to add an example. Examples will be
added to sam init through https://github.com/awslabs/aws-sam-cli-app-templates/

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

@jfuss
Copy link
Contributor

jfuss commented Mar 23, 2022

@mingkun2020 builds are failing due to improper formatting. Can you run make black?

@mingkun2020
Copy link
Contributor Author

@jfuss Just wanna do the reformatting after second reviewer's approvals. If I do reformat now it may hide the actual changes which might confuse the reviewer.

@jfuss
Copy link
Contributor

jfuss commented Mar 23, 2022

@mingkun2020 Please do the reformatted and I can review. Reformatting through black shouldn't hide changes, or I am miss understanding your concern.

I am not comfortable approving or reviewing while the builds do not work.

"""
CloudWatch Client
"""
with self._lock:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have a lock? First reaction is this seems odd but don't understand why we would need to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This client provider may call by multi threads, so we add lock here to prevent concurrency issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there is a different way but not critical for this. Thanks for explaining.

@@ -1,10 +1,10 @@
[
{"LogicalResourceId": "MyApi", "ResourceType": "AWS::ApiGateway::RestApi"},
{"LogicalResourceId": "MyApiDeploymentb30ecf9df1", "ResourceType": "AWS::ApiGateway::Deployment"},
{"LogicalResourceId": "MyApiDeployment", "ResourceType": "AWS::ApiGateway::Deployment"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are the hashes removed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The LogicalResourceId are generated with random suffix. We only compare the LogicalResourceId without the suffix to see if they match. So we don't need to include the random suffix here.

Copy link
Contributor

Choose a reason for hiding this comment

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

So the hashes are their to help guard against changes that accidentally change how SAM hashes those values. When the hashes change, this causes new resources in the stacks and can cause impact to. We had an event where we changed how Layers hashing was done and this caused throttling for customers.

Can we add these back?

@jfuss
Copy link
Contributor

jfuss commented Apr 8, 2022

Approving with the condition we add back the hashing, otherwise our tests are not validating we are not spontaneously changing how the logical id's are generated. This causes unknowing deployments on customers, so the logical ids should always be deterministic.

@jfuss jfuss merged commit c1a6690 into aws:develop Apr 8, 2022
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.

None yet

3 participants