Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Advanced version matching (arbitrary regex?) #7

Open
magneticflux- opened this issue May 12, 2020 · 6 comments
Open

Advanced version matching (arbitrary regex?) #7

magneticflux- opened this issue May 12, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@magneticflux-
Copy link

Currently, matching is done using substrings. This works for matching 1.15 to normal versions like 1.15, 1.15.1, and 1.15.2, but it also matches versions like 1.15-Snapshot that aren't desirable.

I encountered this issue when trying to update two mods. One has versions released for 1.15.1 (that are untagged but work with 1.15.2) and one has versions released for 1.15.2 as well as 1.15-Snapshot. If I allow all 1.15 versions, the first mod can update but the second mod tries to update to the snapshot version which may or may not work. If I only allow 1.15.2 versions, the first mod can't update but the second mod selects the correct version.

Some potential solutions:

  • Give more control to matchers with and, or, and not expressions
    • Like "match 1.15 || 1.15.1 || 1.15.2"
  • Handle snapshot versions specially
    • Similar to how release/beta/alpha versions are handled
  • Create a more complicated compatibility hierarchy than matching substrings
    • Assume 1.15.x versions are compatible with 1.15.2, but prefer exact match
@magneticflux- magneticflux- changed the title Manage snapshot versions specially Unable to exclude snapshot versions May 12, 2020
@sargunv
Copy link
Owner

sargunv commented May 12, 2020

The latest version already has the ability to exclude versions, so you can exclude "1.15-Snapshot".

@sargunv
Copy link
Owner

sargunv commented May 12, 2020

I would like to have arbitrary version matching expressions, but it's pretty low pri. Will keep the issue open to track that

@magneticflux-
Copy link
Author

I tried that, but it excludes mods that are tagged properly as supporting 1.15.2 and 1.15-Snapshot.

@sargunv
Copy link
Owner

sargunv commented May 12, 2020

Ah, I see what you mean. But in that case, isn't updating to the 1.15.2/1.15-Snapshot version fine? Or was the 1.15.1 version uploaded more recently, causing Modsman to pick that?

@magneticflux-
Copy link
Author

Sorry, there's actually 3 types of mods that results in different errors. There's the two I described above, but the third is one that is tagged as supporting 1.15, 1.15.1, 1.15.2, and 1.15-Snapshot. This is the mod that prevents me from just excluding anything tagged as 1.15-Snapshot.

The second type I described above has 1.15-Snapshot versions uploaded after 1.15.2 versions, causing Modsman to pick the snapshot version.

@sargunv sargunv changed the title Unable to exclude snapshot versions Advanced version matching (arbitrary regex?) May 12, 2020
@sargunv sargunv added the enhancement New feature or request label May 12, 2020
@sargunv
Copy link
Owner

sargunv commented May 12, 2020

Okay, I understand the situation now. Yeah this can be fixed by adding the ability to match versions with regex instead of substrings, so you'd match something like ^1\.15(\.\d+)?$.

In the meantime, I recommend using the version pinning feature to prevent Modsman from updating the one problematic mod.

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

No branches or pull requests

2 participants