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 filter linkage checker problems stemming from an artifact #2393

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lqiu96
Copy link
Contributor

@lqiu96 lqiu96 commented Dec 16, 2024

[DRAFT]

Source filter is an additional argument that allows users to filter problems that come from an specific artifact. Currently, linkage checker will report any linkage problem that comes from any of the dependencies that are also resolved via Maven Resolver. This can introduce a lot of additional noise into the results.

For example:
Running Linkage Checker on BigqueryStorage + Protobuf-Java can result in linkage problems from Netty and gRPC-Java which may not be relevant to our results.

Comment on lines +171 to +176
if (sourceFilterList != null) {
List<String> sourceFilterStringList = sourceFilterList.stream().map(Artifact::toString).collect(Collectors.toList());
classFiles = classFiles.stream()
.filter(x -> sourceFilterStringList.contains(x.getClassPathEntry().getArtifact().toString()))
.collect(Collectors.toSet());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's not a big problem, would you try to move the logic to problemFilter ?

This new filtering capability looks suitable there.

Copy link
Contributor

Choose a reason for hiding this comment

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

But filtering here early may have a good benefit of speed (no need to check the symbol references of non-interesting class files). If that's the intention, would you add a source code comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I see. I wasn't aware about problemFilter. I'll take a look and see how that's being used and see which one makes more sense.

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