erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Crash when trying to cut pre release version #324

Closed kjnilsson closed 1 year ago

kjnilsson commented 1 year ago

Repro:

  1. rebar3 hex cut
  2. Choose 4
  3. Type in (e.g.) 2.5.0-pre.1

error:

Error: function_clause
[{rebar3_hex_version,increment,
                     ["2.5.0-pre.1",
                      #{build => undefined,major => 2,minor => 4,patch => 9,
                        pre => []}],
                     [{file,"/Users/nkarl/code/rabbitmq/ra/_build/default/plugins/rebar3_hex/src/rebar3_hex_version.erl"},
                      {line,18}]},
 {rebar3_hex_cut,increment_version,2,
                 [{file,"/Users/nkarl/code/rabbitmq/ra/_build/default/plugins/rebar3_hex/src/rebar3_hex_cut.erl"},
                  {line,221}]},
 {rebar3_hex_cut,cut,4,
                 [{file,"/Users/nkarl/code/rabbitmq/ra/_build/default/plugins/rebar3_hex/src/rebar3_hex_cut.erl"},
                  {line,145}]},
 {lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
 {rebar3_hex_cut,handle_task,1,
                 [{file,"/Users/nkarl/code/rabbitmq/ra/_build/default/plugins/rebar3_hex/src/rebar3_hex_cut.erl"},
                  {line,122}]},
 {rebar_core,do,2,
             [{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_core.erl"},
              {line,155}]},
 {rebar_prv_do,do_task,5,
               [{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_do.erl"},
                {line,87}]},
 {rebar_core,do,2,
             [{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_core.erl"},
              {line,155}]}]
starbelly commented 1 year ago

This bug was fixed in https://github.com/erlef/rebar3_hex/pull/322 but was not published. I cut v7.0.5, so you should just be able to upgrade rebar3_hex and everything should be hunky dory.

I'll leave this issue open until you confirm that.

kjnilsson commented 1 year ago

I tried creating a 2.5.1-pre.1 release. It didn't crash but it seems to just strip the suffix and want to create a full 2.5.1 release rather than a pre release.

Select semver increment or other (Current 2.5.0):
1) patch
2) minor
3) major
4) other
[1-4] > 4
New Version > 2.5.1-pre.1
Create 'v2.5.1' commit? ("Y")> N
starbelly commented 1 year ago

@kjnilsson Problem found. Please try v7.0.6 which was just pushed to hex.

kjnilsson commented 1 year ago

Looks fixed (I didn't test it until the end but it has updated app.src file correctly and it looks like it is about to push it correctly.. :) Thank you.

1) patch
2) minor
3) major
4) other
[1-4] > 4
New Version > 2.5.1-pre.1
Create 'v2.5.1-pre.1' commit? ("Y")> N
Local Password:
Publishing ra 2.5.1-pre.1 to hexpm
  Description: Raft library
  Dependencies:
    seshat 0.4.0
    gen_batch_server 0.8.8
    aten 0.5.8
  Included files:
    LICENSE
    LICENSE-APACHE2
    LICENSE-MPL-RabbitMQ
    README.md
    rebar.config
    rebar.lock
    src
    src/ra.app.src
    src/ra.erl
starbelly commented 1 year ago

Awesome. Thanks for opening the issue and going through the motions ❤️