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(bundling): enclosing metafile & tsconfig paths with quotes #32725

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aaarichter
Copy link

@aaarichter aaarichter commented Jan 3, 2025

Issue # (if applicable)

No

Reason for this change

Generating the metafile in a Windows environment can fail when the path are not enclosed with quotes.

Description of changes

What code changes did you make?

Enclosed paths the bundling arguments --metafile and --tsconfig

Have you made any important design decisions?

No

What AWS use cases does this change enable? To enable the use cases, which AWS service features are utilized?

Allows safe usage of metafile and tsconfig bundling options

Describe any new or updated permissions being added

<!— What new or updated IAM permissions are needed to support the changes being introduced ? -->

Description of how you validated changes

Have you added any unit tests and/or integration tests?

No, but when you have a project path with a whitespace, and use the metafile bundling argument, the metafile path should be passed correctly within quotes to esbuild.

I updated the existing tests.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team January 3, 2025 15:27
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Jan 3, 2025
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.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aaarichter aaarichter force-pushed the fix/eslint-parameter-enclose branch from 1cc72bc to f62e4dd Compare January 3, 2025 15:37
@aaarichter
Copy link
Author

I have no idea what to do

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.
PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

why doesn't this text say what integration file needs to be adjusted ?!!?

@aws-cdk-automation aws-cdk-automation added pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run 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 Jan 3, 2025
@aaarichter aaarichter requested a review from a team as a code owner January 3, 2025 20:20
@aws-cdk-automation aws-cdk-automation added the pr/needs-cli-test-run This PR needs CLI tests run against it. label Jan 3, 2025
@@ -4,13 +4,13 @@
"private": true,
"version": "0.0.0",
"scripts": {
"build": "tsc -b && node scripts/generate.js",
"build": "cdk-build",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the cdk-build command do the same thing? I am not familiar with it. Do you mind pointing me to where the command is implemented? 🙏

Copy link
Author

Choose a reason for hiding this comment

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

@samson-keung hey - sry I'm not sure how this ended up here. I might have run some commands from the markdown files but I'm going to revert anything that is not related to adding quotes

"integ": "integ-runner --language javascript",
"lint": "cdk-lint",
"package": "cdk-package",
"awslint": "cdk-awslint",
"pkglint": "pkglint -f",
"test": "jest",
"test": "cdk-test",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@@ -730,7 +729,7 @@ export function parseCommandLineArguments(args: Array<string>): any {
type: 'string',
alias: 'l',
desc: 'The language to be used for the new project (default can be configured in ~/.cdk.json)',
choices: ['csharp', 'fsharp', 'go', 'java', 'javascript', 'python', 'typescript'],
choices: ['app.iml', 'csharp', 'fsharp', 'go', 'java', 'javascript', 'python', 'typescript'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional? Do you mind explaining what this change does?

Copy link
Author

Choose a reason for hiding this comment

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

hey @samson-keung this change somehow got generated by some of the script commands in the package.json. It is unintentional.

I'll revert this and other unintended changes.

@aaarichter
Copy link
Author

@samson-keung reverted accidental changes. I'm not sure about the artifacts for/of the integration changes and how to generate these

@samson-keung
Copy link
Contributor

Thanks for updating the PR. LGTM. I have pinged the CLI team to review as well.

@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

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

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

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

@samson-keung samson-keung assigned samson-keung and unassigned iliapolo Jan 8, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: e2a7db8
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@samson-keung
Copy link
Contributor

@aaarichter I see two integ tests failed. The relevant log snippet:

@aws-cdk-testing/framework-integ: Snapshot Results: 
@aws-cdk-testing/framework-integ: Tests:    2 failed, 1043 total
@aws-cdk-testing/framework-integ: Failed: /codebuild/output/src1910170678/src/github.com/aws/aws-cdk/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.dependencies-bun.js
@aws-cdk-testing/framework-integ: Failed: /codebuild/output/src1910170678/src/github.com/aws/aws-cdk/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js
@aws-cdk/aws-scheduler-targets-alpha: Verifying integration test snapshots...
@aws-cdk-testing/framework-integ: Error: Some tests failed!
@aws-cdk-testing/framework-integ: To re-run failed tests run: integ-runner --update-on-failed
@aws-cdk-testing/framework-integ:     at main (/codebuild/output/src1910170678/src/github.com/aws/aws-cdk/packages/@aws-cdk/integ-runner/lib/cli.js:192:19)
@aws-cdk-testing/framework-integ: Error: integ-runner exited with error code 1
@aws-cdk-testing/framework-integ: Tests failed. Total time (2m19.6s) | integ-runner (2m10.4s) | /codebuild/output/src1910170678/src/github.com/aws/aws-cdk/node_modules/jest/bin/jest.js (8.3s)

Are you able to run and update them? Instructions can be found in https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md#testing

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 p2 pr/needs-cli-test-run This PR needs CLI tests run against it. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants