Reloaded-II icon indicating copy to clipboard operation
Reloaded-II copied to clipboard

Bug: Automatic mod updates through Github fail if any release tag is invalid

Open Nenkai opened this issue 1 year ago • 1 comments

Title.

For context: Initially over at gbfrelink.utility.manager we had been assigning release tags using the vX.Y.Z pattern (example: v1.0.0) which seems to be standard practice (shown on the git tagging documentation or even the dedicated github page) for automatic mod updates through Github.

The current documentation explicitly states that SemVer 2.0 should be used, so we corrected the tag for the latest version to use raw SemVer, but that seemed not sufficient and an exception will be silently thrown if any older release tag does not follow the expected tag format. Thankfully we did not have many releases so correcting all of the tags was fairly straightforward.

My recommendation is that any invalid release tag should be ignored and optionally, the v prefix should be supported.

Nenkai avatar Apr 13 '24 13:04 Nenkai

Just woke up 😅

I'm any case, this seems fairly trivial to do:

You'd have to patch:

  • https://github.com/Sewer56/Update/blob/9c6c94821120468bb7d0fb3cb7dad03800c29f50/Sewer56.Update/Resolvers/Sewer56.Update.Resolvers.GitHub/GitHubReleaseResolver.cs#L72

and

  • https://github.com/Sewer56/Update/blob/9c6c94821120468bb7d0fb3cb7dad03800c29f50/Sewer56.Update/Resolvers/Sewer56.Update.Resolvers.GitHub/GitHubReleaseResolver.cs#L116

To strip the v prefix (if it exists) for determining versions. Just a few lines of code. And of course, adding a unit test afterwards.

Might also not be a bad idea to cache the result of the Releases API call there, even if for a few minutes. I'm surprised I didn't, the ETags aren't that effective, unfortunately.

Sewer56 avatar Apr 13 '24 13:04 Sewer56