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

COMMUNITY-129686 - Update program.ts #5176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ericmorand-sonarsource
Copy link
Contributor

@ericmorand-sonarsource ericmorand-sonarsource commented Mar 6, 2025

The sixth argument of ts.parseJsonConfigFileContent is wrongly set to the passed path. The method expect a resolved path. Passing a non-resolved path makes the program unable to resolve the included files.

Note that this is not the fix to COMMUNITY-129686. It is a fix required to debug the issue.

@ericmorand-sonarsource ericmorand-sonarsource force-pushed the ericmorand-sonarsource-patch-1 branch from 360f7e7 to bd5bac4 Compare March 6, 2025 13:46
The third argument of `ts.parseJsonConfigFileContent` is wrongly set to the passed path. The method expects a resolved path. Passing a non-resolved path makes the program unable to resolve the included files.
@ericmorand-sonarsource ericmorand-sonarsource force-pushed the ericmorand-sonarsource-patch-1 branch from bd5bac4 to 2c3c188 Compare March 6, 2025 13:56
Copy link

sonarqube-next bot commented Mar 6, 2025

Copy link
Contributor

@vdiez vdiez left a comment

Choose a reason for hiding this comment

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

I thought tsconfig was already the resolved path

@ericmorand-sonarsource
Copy link
Contributor Author

@vdiez , I'm not sure I understand what you mean. In any case, if the third argument passed to parseJsonConfigFileContent is resolved, the 6th one must be resolved too. Also note that the test that I had to change confirm that it was not resolved.

@vdiez
Copy link
Contributor

vdiez commented Mar 6, 2025

I mean that in prod tsconfig will always be a resolved path, or that's what I thought. I saw the test, and I see that indeed it was not properly handled if the path was not resolved.
The only way to reach that function in prod is from the the endpoints tsconfig-files and create-program, and in both cases the path comes from Java as an absolute path

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.

2 participants