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 annotation path incorrectness when --project-dir is specified #410

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

okue
Copy link
Contributor

@okue okue commented Dec 2, 2024

Pull Request Details

Description

When --project-dir is specified, the output annotation path should start with the project dir path.

Related Issue

https://youtrack.jetbrains.com/issue/QD-5189/

Motivation and Context

When we specifies the --project-dir argument, the output annotation's path is incorrect, then the annotation is not working expectedly.

For example when we have a mono repo project, which is not a Gradle multi project but just has multiple directories where some are Gradle project and others are not.

root_dir/dirA -- non Gradle project
root_dir/dirB -- Gradle project

In this situation, we want to use not --source-directory but --project-dir.

When --project-dir is specified, the paths written in the output sarif file is incorrect.

actual path - ./path/to/file
expected path - ./dirA/path/to/file

If the path is incorrect, qodana-action never comments at the pull request change location.

How Has This Been Tested

I tested in my private project. (Sorry it is not public)

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

@okue
Copy link
Contributor Author

okue commented Dec 2, 2024

@tiulpin May I ask your review?

@okue okue requested a review from tiulpin as a code owner December 11, 2024 11:25
@okue okue force-pushed the fix-project-dir branch 2 times, most recently from 5947dec to c48c66c Compare December 12, 2024 06:39
@okue
Copy link
Contributor Author

okue commented Dec 12, 2024

I will add testcase...

@okue okue marked this pull request as draft December 12, 2024 06:40
@okue okue force-pushed the fix-project-dir branch 2 times, most recently from ab6c4fe to fdbaeae Compare December 12, 2024 07:00
@okue
Copy link
Contributor Author

okue commented Dec 12, 2024

Now, npm run package changes much.

 scan/dist/index.js | 21875 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 1 file changed, 9711 insertions(+), 12164 deletions(-)

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.

1 participant