Semver dictates that multiple hyphens in a prerelease identifier are allowed. However, Octopus seems to not handle this correctly.
Consider the case where we have some package versions as follows:
1.0.0-hello
1.0.1-hello-world
If we tell octopus to create a release with a prerelease identifier of “hello” then it would select version 1.0.1-hello-world
We are experiencing this very issue right now. Just want to confirm if this is a known bug or if we’re doing something wrong? We’re creating the release through the CLI with “–packageprerelease” flag. We have no channel version filters in place.
We are unfortunately a bit blocked by this at the moment on some of our development environments. Any suggestions on workarounds? If possible I would like to avoid having to add version rules in a lot of places which is why I opted to use the prerelease identifiers instead.
Unfortunately, I can’t think of any workarounds that won’t have a bit of work to implement. I am asking some colleagues if they have an elegant solution.
Can I ask, how are you creating the release? Is it at the end of a pipeline? If so, which build server are you using? Is only one project affected so far?
In case you didnt subscribe to that GitHub issue yet, the integrations team updated it to let me know that the parameter supports regex so you would want to put a $ at the end of the string. e.g, hello$. We are going to update the documentation to call this out.
Sorry for dropping off on this, I had to run out earlier. I appreciate your help here and was getting ready to try the API approach, but will definitely try with regex first.
Just wanted to follow up here and let you know regex saved the day. Although your suggestion of just using the end of expression character didn’t work for us because we also append some metadata after the prerelease identifier with a + separator. I modified the regex to support both cases: ($|\+).
Thanks very much for your extremely fast help with this, much appreciated.