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(apigateway): race condition exists between stage and cfnaccount in specrestapi #22671

Merged
merged 5 commits into from Oct 28, 2022

Conversation

nwinans
Copy link
Contributor

@nwinans nwinans commented Oct 27, 2022

This PR is based off of #18011, which fixed a race condition between RestApi stages and CloudWatch roles. The mentioned PR fixed the issue for RestApi, but not SpecRestApi, which this PR aims to fix.

The fix was largely implemented in RestApiBase. Since SpecRestApi inherits the same RestApiBase as RestApi, all we need to do is swap the order of resource creation so that the CloudWatch role is created before the RestApi stage, and can be attached correctly.

This PR also updates the integration tests to reflect the new dependency RestApi stage has on RestApi account.

Fixes #18925

All Submissions:

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

@gitpod-io
Copy link

gitpod-io bot commented Oct 27, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team October 27, 2022 16:50
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. p1 labels Oct 27, 2022
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

@nwinans
Copy link
Contributor Author

nwinans commented Oct 27, 2022

I think an exemption to the linter error should be granted for this package. The actual integration tests themselves don't need to be touched given the nature of the bug fix, but the relevant integration test snapshots have been updated to reflect the behavior of the API.

@TheRealAmazonKendra
Copy link
Contributor

I think an exemption to the linter error should be granted for this package. The actual integration tests themselves don't need to be touched given the nature of the bug fix, but the relevant integration test snapshots have been updated to reflect the behavior of the API.

That't reasonable. Providing the exemption.

@TheRealAmazonKendra TheRealAmazonKendra added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Oct 27, 2022
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 27, 2022 17:08

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

@TheRealAmazonKendra
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Oct 27, 2022

update

✅ Branch has been successfully updated

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Given the limited updates to the integ test output, it doesn't look like the tests were actually run. Please revert the output of the integ tests and then run yarn integ --update-on-failed and commit the output.

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review October 28, 2022 17:54

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2022

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).

@TheRealAmazonKendra TheRealAmazonKendra changed the title fix(apigateway): racecondition between stage and cfnaccount in specrestapi fix(apigateway): race condition exists between stage and cfnaccount in specrestapi Oct 28, 2022
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 4e30681
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 4cb008b into aws:main Oct 28, 2022
@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. p1 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-apigateway): race condition between Stage and CfnAccount on SpecRestApi
3 participants