jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

Error stating alias already specified as version, but it is not #112

Closed robzor92 closed 2 years ago

robzor92 commented 2 years ago

Hello! First of all, thanks a bunch for this tool. It really helped out with versioning documentation for us.

Recently we've run into an issue with this command failing.

mike deploy 3.0.1 3.0 -u --push

with the output:

error: alias '3.0' already specified as a version

We have a setup with an alias named 3.0 that points to the latest release version, in this case 3.0.1. There is no version named 3.0 as the error states. All our versions are specified as *.*.*.

Also, in addition to the 3.0 alias, we have another alias named latest which just points to the overall latest version.

Our versions.json looks like this:

[
   {
      "version":"3.1.0-SNAPSHOT",
      "title":"3.1.0-SNAPSHOT",
      "aliases":[
         "dev"
      ]
   },
   {
      "version":"3.0.0",
      "title":"3.0.0",
      "aliases":[
         "3.0",
         "latest"
      ]
   },
   {
      "version":"2.5.2",
      "title":"2.5.2",
      "aliases":[

      ]
   },
   {
      "version":"2.5.1",
      "title":"2.5.1",
      "aliases":[

      ]
   },
   {
      "version":"2.5.0",
      "title":"2.5.0",
      "aliases":[

      ]
   }
]

Here is our gh-pages branch.

Are we doing something wrong on our end?

Grateful for any help on this!

jimporter commented 2 years ago

The issue here was that 3.0 and 3.0.0 were getting compared to each other as versions, not as strings. As versions, those two are equivalent, which resulted in this false positive.

robzor92 commented 2 years ago

@jimporter Thanks a lot! Happy to try it out when 2.0.0 is released. :)

moritzmeister commented 2 years ago

@jimporter thanks for the quick response! Do you have plans for a minor bug fix release in the near future?

jimporter commented 2 years ago

No, this will be released with 2.0, which will be tagged when I close out everything left in the milestone. That probably won't be particularly soon though, since this project is a low priority for me, and I don't have a lot of free time lately.

If you need this sooner, I'd recommend using the development builds. They should be pretty stable, and more testing is always appreciated.