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

[Bug]: No files selected, nothing to do. Version 1.0.1 #766

Closed
1 task
abu450 opened this issue Feb 20, 2024 · 7 comments · Fixed by #767
Closed
1 task

[Bug]: No files selected, nothing to do. Version 1.0.1 #766

abu450 opened this issue Feb 20, 2024 · 7 comments · Fixed by #767
Labels
bug Something isn't working p1 This is a high priority issue

Comments

@abu450
Copy link

abu450 commented Feb 20, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

Date: 2024-02-20T08:42:32.865Z
Tried the command with both relative and absolute paths. It was working till two days ago, but today, it just doesn't find the file and shows the:
No files selected, nothing to do.
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 0.001seconds

Steps to reproduce

Run:
npx aws-sdk-js-codemod@latest -t v2-to-v3 PATH

Observed behavior

No files selected, nothing to do.
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 0.001seconds

Expected behavior

Does the migration

Environment

aws-sdk-js-codemod@latest

Additional context

No response

@abu450 abu450 added bug Something isn't working triage Triaging bugs labels Feb 20, 2024
@abu450 abu450 changed the title [Bug?]: No files selected, nothing to do. [Bug?]: No files selected, nothing to do. Version 1.0.1 Feb 20, 2024
@abu450
Copy link
Author

abu450 commented Feb 20, 2024

Just tried Version 1.0.0 instead of latest(1.0.1) and that worked

@trivikr trivikr added triage Triaging bugs p1 This is a high priority issue and removed triage Triaging bugs labels Feb 20, 2024
@trivikr
Copy link
Member

trivikr commented Feb 20, 2024

Verified that this issue exists with v1.0.1

$ cat example.ts
import AWS from "aws-sdk";
const client = new AWS.DynamoDB();
const response = await client.listTables({}).promise();

$ npx aws-sdk-js-codemod@1.0.1 -t v2-to-v3 example.ts
Need to install the following packages:
aws-sdk-js-codemod@1.0.1
Ok to proceed? (y) y

╔════════════════════════════════════════════════════════╗
║ Please review the code change thoroughly for required  ║
║ functionality before deploying it to production.       ║
║                                                        ║
║ If the transformation is not complete or is incorrect, ║
║ please report the issue on GitHub.                     ║
╚════════════════════════════════════════════════════════╝

No files selected, nothing to do. 
All done. 
Results: 
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 0.001seconds

@trivikr trivikr changed the title [Bug?]: No files selected, nothing to do. Version 1.0.1 [Bug]: No files selected, nothing to do. Version 1.0.1 Feb 20, 2024
@trivikr trivikr removed the triage Triaging bugs label Feb 20, 2024
@trivikr
Copy link
Member

trivikr commented Feb 20, 2024

The v1.0.1 updated jscodeshift from v0.15.0 to v0.15.1
Release Notes https://github.com/aws/aws-sdk-js-codemod/releases/tag/v1.0.1

Looks like the PATH variable is not sent to the transformer post the update.
In addition to finding root cause and fixing this, a test will need to be written to ensure that files are always processed.

@trivikr
Copy link
Member

trivikr commented Feb 20, 2024

Diff between jscodeshift v0.15.0 and v0.15.1

facebook/jscodeshift@v0.15.0...0.15.1

@trivikr
Copy link
Member

trivikr commented Feb 20, 2024

The issue appears to be fix for respecting extensions in facebook/jscodeshift#562

The CLI succeeds if ts is explicitly passed as extensions

$ cat example.ts 
import AWS from "aws-sdk";
const client = new AWS.DynamoDB();
const response = await client.listTables({}).promise();

$ npx aws-sdk-js-codemod@1.0.1 -t v2-to-v3 --extensions=ts example.ts

╔════════════════════════════════════════════════════════╗
║ Please review the code change thoroughly for required  ║
║ functionality before deploying it to production.       ║
║                                                        ║
║ If the transformation is not complete or is incorrect, ║
║ please report the issue on GitHub.                     ║
╚════════════════════════════════════════════════════════╝

Processing 1 files... 
Spawning 1 workers...
Sending 1 files to free worker...
All done. 
Results: 
0 errors
0 unmodified
0 skipped
1 ok
Time elapsed: 0.252seconds

The issue with jscodeshift is that it sets js as default in extensions, and ignores ts files even if they're explicitly passed in PATH. We should report this upstream, but at the same time populate extensions option when calling jscodeshift to fix bug in aws-sdk-js-codemod.

@trivikr
Copy link
Member

trivikr commented Feb 20, 2024

The bug reported upstream at facebook/jscodeshift#582

Copy link
Contributor

github-actions bot commented Mar 6, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working p1 This is a high priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants