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

feat: add option to skip by path by project name and project type #73

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

Conversation

jmvtrinidad
Copy link

No description provided.

Copy link
Owner

@koliveira15 koliveira15 left a comment

Choose a reason for hiding this comment

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

@jmvtrinidad thanks for the contribution! Please fix & address the comments below with a passing build and I will merge

packages/nx-sonarqube/src/executors/scan/schema.json Outdated Show resolved Hide resolved
packages/nx-sonarqube/src/executors/scan/schema.json Outdated Show resolved Hide resolved
packages/nx-sonarqube/src/executors/scan/schema.d.ts Outdated Show resolved Hide resolved
packages/nx-sonarqube/src/executors/scan/utils/utils.ts Outdated Show resolved Hide resolved
packages/nx-sonarqube/src/executors/scan/executor.spec.ts Outdated Show resolved Hide resolved
packages/nx-sonarqube/src/executors/scan/utils/utils.ts Outdated Show resolved Hide resolved
@koliveira15 koliveira15 added the enhancement New feature or request label Mar 17, 2024
Copy link

nx-cloud bot commented Mar 17, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1bd41c0. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@jmvtrinidad
Copy link
Author

Thanks for reviewing @koliveira15
Please see updated changes

) {
return true;
}
return options.skipDependencyTypes.includes(
Copy link
Owner

Choose a reason for hiding this comment

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

I tested this logic filter in my own repo, and it does not work. It needs to filter by DependencyType.static|implicit|dynamic based on the options array.

"skipDependencyTypes": ["static"]
> nx run lib-b:sonar

Included sources paths: libs/lib-a/src,libs/lib-b/src
Included lcov paths: coverage/libs/lib-a/lcov.info,coverage/libs/lib-b/lcov.info

"description": "Skips paths to the project graph analysis",
"type": "array",
"default": []
},
"skipImplicitDeps": {
Copy link
Owner

Choose a reason for hiding this comment

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

remove

@@ -45,6 +45,24 @@
"type": "string",
"default": "300"
},
"skipDependencyTypes": {
Copy link
Owner

Choose a reason for hiding this comment

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

Please update README.md in the root of the project with these properties and remove skipImplicitDeps property from the markdown as well

)
.filter(
(project) =>
context.projectName === project.name ||
Copy link
Owner

Choose a reason for hiding this comment

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

I tested this logic filter in my own repo, and it does not work as expected

"skipProjects": ["lib-a"]
> nx run lib-b:sonar

Included sources paths: libs/lib-a/src,libs/lib-b/src
Included lcov paths: coverage/libs/lib-a/lcov.info,coverage/libs/lib-b/lcov.info

(project) =>
context.projectName === project.name ||
(options.skipPaths?.length
? options.skipPaths.some((path) => project.sourceRoot.includes(path))
Copy link
Owner

Choose a reason for hiding this comment

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

I tested this logic filter in my own repo, and it does not work as expected

"skipPaths": ["libs/lib-a/src"]
> nx run lib-b:sonar

Included sources paths: libs/lib-a/src,libs/lib-b/src
Included lcov paths: coverage/libs/lib-a/lcov.info,coverage/libs/lib-b/lcov.info

@jmvtrinidad
Copy link
Author

Thanks @koliveira15, I tested it now also with my local, the filter is now working properly

@koliveira15
Copy link
Owner

Thanks @koliveira15, I tested it now also with my local, the filter is now working properly

I have tested this locally and is still not working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants