Skip to content

Conversation

@sswguo
Copy link
Member

@sswguo sswguo commented Aug 13, 2025

Issue: https://issues.redhat.com/browse/MMENG-4447

The PR tries to extract the groupId path from the metadata file pattern, and using the groupId path to match with the specific path to filter the remote repos, especially the koji repos.

For those repos without the metadata file patterns, will still follow the previous process.

@sswguo sswguo requested review from ligangty, pkocandr and ruhan1 August 13, 2025 02:44
.filter( Objects::nonNull )
.anyMatch(groupIdPath -> path.startsWith( groupIdPath ) || groupIdPath.startsWith( path ) );

if ( matches )
Copy link
Contributor

Choose a reason for hiding this comment

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

does this mean it is faster to check the groupId against meta pattern before checking all patterns?

Copy link
Member Author

@sswguo sswguo Aug 13, 2025

Choose a reason for hiding this comment

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

Checking all patterns does not work for some cases, like the following patterns of the repo maven:remote:koji-com.sun.mail-all-1.6.1.redhat_1-1:

"path_mask_patterns": [ "com/sun/mail/javax.mail/maven-metadata.xml", "r|com\\/sun\\/mail\\/.+\\/1.6.1.redhat-1\\/.+|", "r|javax\\/mail\\/.+\\/1.6.1.redhat-1\\/.+|" ],

it does not work if the directory listing path is "/com/sun/mail/android". And the android-1.6.1.redhat-1.pom is also one of the artifacts produced by that brew build.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixing this https://issues.redhat.com/browse/MMENG-4453 will resolve the above issue, but we need to make it compatible on the exiting remote koji repos.

Copy link
Contributor

Choose a reason for hiding this comment

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

would this make a lot many repos return true? if group matches (/com/sun/mail), such repo will be listed even the artifact not match.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this function is aiming to reduce the repo candidates for further query against cassandra or brew. When I debug this, it now returns all koji-* repos which is ~2500 on prod.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand this pr is to fix the file missing issue when listing, so you use the groupId to filter first. Am I right? If so, let's go with it.

Copy link
Contributor

Choose a reason for hiding this comment

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

but why it now returns all koji-* repos? if the patterns do not match, it should filter most of them...

Copy link
Contributor

Choose a reason for hiding this comment

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

is it because old line 76? if ( isRegexPattern( pattern ) ) --> this could return true when hit the regex pattern. maybe it always hit it and finally returns all koji repos.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, that's it line 76 and the reason in the comment line 78~80.

And this PR is still for the listing performance issue, https://issues.redhat.com/browse/MMENG-4447 .
There are attached logs I found during tests that would be helpful to know how it costs.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@sswguo sswguo merged commit cb29888 into Commonjava:master Aug 14, 2025
1 check passed
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