wildfly / galleon

Galleon Provisioning Tool
https://docs.wildfly.org/galleon/
Apache License 2.0
26 stars 30 forks source link

[GAL-280] Allow regex based include/exclude version filtering when re… #264

Closed bstansberry closed 4 years ago

bstansberry commented 4 years ago

…solving feature packs from channels

https://issues.jboss.org/browse/GAL-280

@aloubyansky @jfdenise FYI.

I add two new elements to the channel spec xml, version-include-regex and version-exclude-regex, which result in ChannelDescription.getVersion[In|Ex]cludeRegex. Those get compiled in MavenChannel into a Pattern, which MavenChannel passes into new overloaded variants of the MavenRepoManager methods it calls. The MavenRepoManager impls match maven versions against those patterns if they are provided.

The maven plugin config uses new properties 'versionIncludeRegex' and 'versionExcludeRegex' to set these when generating the producer.

I didn't bump the version of the xml namespace for the channel spec to reflect the new elements. It looked like all the various parsers were still at 1.0 so I decided to be lazy and assume the schemas weren't being advanced. I can change that of course.

Conceivably filtering on more than the version might be wanted, but for the use case I can imagine, it's the version that matters.

I didn't add overloaded variants of other MavenRepoManager methods besides the ones MavenChannel needs. Originally I did, just to be consistent, but that added conceptual bloat to the change and increased risk of bugs. Since this issue is about filtering what's associated with a Channel it seemed reasonable to limit things to what was needed for that use case.

aloubyansky commented 4 years ago

Thanks Brian! I'm on PTO this week though. I'll do a proper review this Friday.

bstansberry commented 4 years ago

NP. I'll be on PTO starting Wed and all next week. But it can wait or if Jean-Francois is blocked by it I don't mind any changes being made in my absence.