Skip to content

fix(amplify-alpha): removing customResponseHeaders property does not remove the headers from the app#31844

Open
georeeve wants to merge 8 commits intoaws:mainfrom
georeeve:amplify-default-custom-headers
Open

fix(amplify-alpha): removing customResponseHeaders property does not remove the headers from the app#31844
georeeve wants to merge 8 commits intoaws:mainfrom
georeeve:amplify-default-custom-headers

Conversation

@georeeve
Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes #31783.

Reason for this change

After setting the customResponseHeaders property to some value in the App construct, removing it again does not remove the headers in the Amplify console.

Description of changes

I have set the customHeaders property to a default value of an empty string. This sets the relevant CloudFormation property when customResponseHeaders is not provided, therefore overriding any previous values with an empty string. I took a look at a similar issue of removing basic auth from an app and saw we did something similar there - #15243.

Description of how you validated changes

Updated the existing tests with the new default value.

Checklist


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

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Oct 22, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team October 22, 2024 08:34
Copy link
Copy Markdown
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 fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@georeeve
Copy link
Copy Markdown
Contributor Author

Exemption Request - I have updated the existing unit test, and integration test snapshots with the new default values. I'm not really sure what I could put in a new integration test, as it'd test the same values as the existing integration tests.

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Oct 22, 2024
This was referenced Oct 28, 2024
Copy link
Copy Markdown
Contributor

@gracelu0 gracelu0 left a comment

Choose a reason for hiding this comment

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

Hi @georeeve , thanks for working on this! For the integration tests, I noticed integ.app.ts and integ.codecommit.ts don't use the integ testing framework - would you be up for refactoring these tests to use the IntegTest construct?

@gracelu0 gracelu0 removed the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Jan 7, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 7, 2025
@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@georeeve
Copy link
Copy Markdown
Contributor Author

georeeve commented Jan 8, 2025

Hi @gracelu0, sure, I'm happy to do that. I did add a few tests in #31771, so maybe it's worth waiting for that to progress first?

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Jan 29, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2025
@aaythapa aaythapa reopened this Feb 10, 2025
@aaythapa aaythapa added the pr-linter/do-not-close The PR linter will not close this PR while this label is present label Feb 10, 2025
georeeve added 2 commits April 4, 2025 16:55
# Conflicts:
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdk-amplify-app-asset-deployment.assets.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdk-amplify-app-asset-deployment.template.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdk.out
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdkamplifyappassetdeploymentcomamazonawscdkcustomresourcesamplifyassetdeploymentprovider02396C99.nested.template.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdkamplifyappintegtestDefaultTestDeployAssert8ED3E8A4.assets.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/integ.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/manifest.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/tree.json
@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

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

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

@Abogical Abogical self-assigned this Aug 4, 2025
Copy link
Copy Markdown
Member

@Abogical Abogical left a comment

Choose a reason for hiding this comment

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

Hi @georeeve, Thank you for your contribution!

Currently there are merge conflicts with this PR as snapshots are not sync with the main branch. To resolve this, rebase your changes from main and update the aws-amplify-alpha test snapshots.

# Conflicts:
#	packages/@aws-cdk/aws-amplify-alpha/lib/app.ts
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdk-amplify-app-asset-deployment.assets.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdk.out
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/cdkamplifyappintegtestDefaultTestDeployAssert8ED3E8A4.assets.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/integ.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/manifest.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js.snapshot/tree.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/amplifyappcachecofigintegDefaultTestDeployAssert14075C62.assets.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/cdk-amplify-app-cache-config.assets.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/cdk.out
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/integ.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/manifest.json
#	packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/tree.json
Copy link
Copy Markdown
Member

@Abogical Abogical left a comment

Choose a reason for hiding this comment

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

The following integ snapshots still need to be updated:

@aws-cdk/aws-amplify-alpha: Failed: /codebuild/output/src65737127/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk/aws-amplify-alpha/test/integ.app-asset-deployment.js
@aws-cdk/aws-amplify-alpha: !!! This test contains destructive changes !!!
@aws-cdk/aws-amplify-alpha:     Stack: cdkamplifyappassetdeploymentcomamazonawscdkcustomresourcesamplifyassetdeploymentprovider02396C99 - Resource: amplifyassetdeploymenthandlerproviderwaiterstatemachineLogGroupC4BDAC97 - Impact: WILL_DESTROY
@aws-cdk/aws-amplify-alpha: !!! If these destructive changes are necessary, please indicate this on the PR !!!
@aws-cdk/aws-amplify-alpha: Failed: /codebuild/output/src65737127/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js
@aws-cdk/aws-amplify-alpha: Failed: /codebuild/output/src65737127/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk/aws-amplify-alpha/test/integ.app-codecommit.js
@aws-cdk/aws-amplify-alpha: Failed: /codebuild/output/src65737127/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk/aws-amplify-alpha/test/integ.app-compute-role.js
@aws-cdk/aws-amplify-alpha: Failed: /codebuild/output/src65737127/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk/aws-amplify-alpha/test/integ.app-custom-domain.js
@aws-cdk/aws-amplify-alpha: Failed: /codebuild/output/src65737127/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk/aws-amplify-alpha/test/integ.branch-compute-role.js
@aws-cdk/aws-amplify-alpha: Failed: /codebuild/output/src65737127/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk/aws-amplify-alpha/test/integ.branch-skew-protection.js

@georeeve
Copy link
Copy Markdown
Contributor Author

georeeve commented Aug 8, 2025

@Abogical I'm not entirely sure why it's failing that integ test, or even detecting any changes after I've merged in main as I haven't changed it at all. Any ideas?

@Abogical
Copy link
Copy Markdown
Member

Abogical commented Aug 11, 2025

@Abogical I'm not entirely sure why it's failing that integ test, or even detecting any changes after I've merged in main as I haven't changed it at all. Any ideas?

@georeeve Try cleaning the repo and rebuilding:

rm packages/@aws-cdk-testing/framework-integ/tsconfig.tsbuildinfo && git clean -f -X **/integ.*.js && npx lerna run build --scope=@aws-cdk-testing/framework-integ

Then rerun and generate the integ test snapshots.

@Abogical Abogical added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 27, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This PR has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Oct 27, 2025
@georeeve
Copy link
Copy Markdown
Contributor Author

Sorry for the delay, I'll try and get this done this week

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Oct 29, 2025
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. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p2 pr-linter/do-not-close The PR linter will not close this PR while this label is present

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(amplify-alpha): Removing customResponseHeaders property does not remove the headers from the app

5 participants