apotonick / declarative-option

Dynamic Options to evaluate at runtime.
MIT License
7 stars 7 forks source link

Regression in 0.1.1 #6

Open beruic opened 3 years ago

beruic commented 3 years ago

Todays update seems to have a bug that manifests itself infastlane. Please see my comment at https://github.com/fastlane/fastlane/issues/18403#issuecomment-800657944

The stack trace I get is:

Traceback (most recent call last):
    71: from /usr/local/bundle/bin/bundle:23:in `<main>'
    70: from /usr/local/bundle/bin/bundle:23:in `load'
    69: from /usr/local/bundle/gems/bundler-2.2.14/exe/bundle:37:in `<top (required)>'
    68: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    67: from /usr/local/bundle/gems/bundler-2.2.14/exe/bundle:49:in `block in <top (required)>'
    66: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli.rb:24:in `start'
    65: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    64: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli.rb:30:in `dispatch'
    63: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    62: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    61: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    60: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli.rb:494:in `exec'
    59: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli/exec.rb:28:in `run'
    58: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli/exec.rb:63:in `kernel_load'
    57: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli/exec.rb:63:in `load'
    56: from /usr/local/bundle/bin/fastlane:23:in `<top (required)>'
    55: from /usr/local/bundle/bin/fastlane:23:in `load'
    54: from /usr/local/bundle/gems/fastlane-2.178.0/bin/fastlane:23:in `<top (required)>'
    53: from /usr/local/bundle/gems/fastlane-2.178.0/fastlane/lib/fastlane/cli_tools_distributor.rb:114:in `take_off'
    52: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/commands_generator.rb:12:in `start'
    51: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/commands_generator.rb:60:in `run'
    50: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
    49: from /usr/local/bundle/gems/fastlane-2.178.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
    48: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
    47: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
    46: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
    45: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/commands_generator.rb:39:in `block (2 levels) in run'
    44: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/uploader.rb:22:in `perform_upload'
    43: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/uploader.rb:412:in `update_track'
    42: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/client.rb:388:in `update_track'
    41: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/client.rb:81:in `call_google_api'
    40: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/client.rb:389:in `block in update_track'
    39: from /usr/local/bundle/gems/google-api-client-0.38.0/generated/google/apis/androidpublisher_v3/service.rb:1540:in `update_edit_track'
    38: from /usr/local/bundle/gems/google-apis-core-0.3.0/lib/google/apis/core/base_service.rb:377:in `execute_or_queue_command'
    37: from /usr/local/bundle/gems/google-apis-core-0.3.0/lib/google/apis/core/http_command.rb:99:in `execute'
    36: from /usr/local/bundle/gems/google-apis-core-0.3.0/lib/google/apis/core/api_command.rb:81:in `prepare!'
    35: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/json.rb:44:in `to_json'
    34: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
    33: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
    32: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
    31: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `call'
    30: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `each'
    29: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
    28: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
    27: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
    26: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
    25: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
    24: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
    23: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
    22: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `call'
    21: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `each_with_index'
    20: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `each'
    19: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:39:in `block in call'
    18: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
    17: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
    16: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
    15: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
    14: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
    13: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/serializer.rb:44:in `block in <module:Representable>'
    12: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
    11: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
    10: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
     9: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `call'
     8: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `each'
     7: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
     6: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
     5: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
     4: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
     3: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
     2: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
     1: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
/usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `call': undefined method `each_with_index' for nil:NilClass (NoMethodError)
    71: from /usr/local/bundle/bin/bundle:23:in `<main>'
    70: from /usr/local/bundle/bin/bundle:23:in `load'
    69: from /usr/local/bundle/gems/bundler-2.2.14/exe/bundle:37:in `<top (required)>'
    68: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    67: from /usr/local/bundle/gems/bundler-2.2.14/exe/bundle:49:in `block in <top (required)>'
    66: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli.rb:24:in `start'
    65: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    64: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli.rb:30:in `dispatch'
    63: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    62: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    61: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    60: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli.rb:494:in `exec'
    59: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli/exec.rb:28:in `run'
    58: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli/exec.rb:63:in `kernel_load'
    57: from /usr/local/bundle/gems/bundler-2.2.14/lib/bundler/cli/exec.rb:63:in `load'
    56: from /usr/local/bundle/bin/fastlane:23:in `<top (required)>'
    55: from /usr/local/bundle/bin/fastlane:23:in `load'
    54: from /usr/local/bundle/gems/fastlane-2.178.0/bin/fastlane:23:in `<top (required)>'
    53: from /usr/local/bundle/gems/fastlane-2.178.0/fastlane/lib/fastlane/cli_tools_distributor.rb:114:in `take_off'
    52: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/commands_generator.rb:12:in `start'
    51: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/commands_generator.rb:60:in `run'
    50: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
    49: from /usr/local/bundle/gems/fastlane-2.178.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
    48: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
    47: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
    46: from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
    45: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/commands_generator.rb:39:in `block (2 levels) in run'
    44: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/uploader.rb:22:in `perform_upload'
    43: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/uploader.rb:412:in `update_track'
    42: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/client.rb:388:in `update_track'
    41: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/client.rb:81:in `call_google_api'
    40: from /usr/local/bundle/gems/fastlane-2.178.0/supply/lib/supply/client.rb:389:in `block in update_track'
    39: from /usr/local/bundle/gems/google-api-client-0.38.0/generated/google/apis/androidpublisher_v3/service.rb:1540:in `update_edit_track'
    38: from /usr/local/bundle/gems/google-apis-core-0.3.0/lib/google/apis/core/base_service.rb:377:in `execute_or_queue_command'
    37: from /usr/local/bundle/gems/google-apis-core-0.3.0/lib/google/apis/core/http_command.rb:99:in `execute'
    36: from /usr/local/bundle/gems/google-apis-core-0.3.0/lib/google/apis/core/api_command.rb:81:in `prepare!'
    35: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/json.rb:44:in `to_json'
    34: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
    33: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
    32: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
    31: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `call'
    30: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `each'
    29: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
    28: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
    27: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
    26: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
    25: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
    24: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
    23: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
    22: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `call'
    21: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `each_with_index'
    20: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `each'
    19: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:39:in `block in call'
    18: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
    17: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
    16: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
    15: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
    14: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
    13: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/serializer.rb:44:in `block in <module:Representable>'
    12: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
    11: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
    10: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
     9: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `call'
     8: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:51:in `each'
     7: from /usr/local/bundle/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
     6: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
     5: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
     4: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
     3: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
     2: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
     1: from /usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
/usr/local/bundle/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `call': \e[31m[!] undefined method `each_with_index' for nil:NilClass\e[0m (NoMethodError)
taylorthurlow commented 3 years ago

Beat me to it! I'm seeing this manifested in a huge swath of the google-cloud-ruby libraries, particularly google cloud storage.

beruic commented 3 years ago

Since the issue is experiences in fastlane with uploading app packages to Google Play, I guess there might be a Google angle to it.

Without knowing to much about Ruby at all, I'm guessing that either package just introduced a breaking change or a bug, or this package fixed something that has been misused by despendants.

beruic commented 3 years ago

Perhaps the representable package should be made aware of this, since that seems to be what we have in common here.

taylorthurlow commented 3 years ago

I'm happy to open an issue on that repo if you aren't already doing so.

beruic commented 3 years ago

Done

lucaong commented 3 years ago

This regression seems to be because of https://github.com/apotonick/declarative-option/pull/4. In particular, this code is a breaking change:

# code changed from:
->(context, *args) { context.instance_exec(*args, &value) }

# to:
->(context, *args, keyword_arguments: {}, **) do
   context.instance_exec(*args, **keyword_arguments, &value)
end

The second form is not equivalent to the first, the ** will capture and discard keyword arguments passed in.

lucasgomide commented 3 years ago

Should this release be updated to the MINOR (even MAJOR) version instead of PATCH?

apotonick commented 3 years ago

Yes, we already yanked the faulty 0.1.1 version and will prepare everything so that Ruby-3 gems use the correct version. Most likely, we will drop this gem and instead use trailblazer-option, since we use the Option() concept almost everywhere. Don't worry, this won't bring any additional dependency. :beers:

imWildCat commented 3 years ago

Well, this is really misunderstanding. Feels like the left-pad issue: https://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/

I'd say we shouldn't do this in the future. RubyGems should not allow this either.

apotonick commented 3 years ago

@imWildCat You mean RubyGems shouldn't allow yanking? I am glad it exists - I wouldn't have been able to provide a real fix quickly. I am in the process of giving over control of several gems to my fellow OSS devs and as you can see, the process is not fully QAed, yet :stuck_out_tongue_winking_eye: Sorry for the hassle!

Oh, that's an interesting article you linked, thanks a lot! :beers:

imWildCat commented 3 years ago

I respect your motivation but it might be better to bump the version to apply a fix.

I spent about 1 hour today to investigate this bug. For some reason, Google didn't show me this GH issue at the very beginning.

lucaong commented 3 years ago

I feel that in this case yanking was appropriate: it clearly communicates that the faulty version does not exist anymore, so one can check why, and what versions are available instead. Otherwise, finding this issue would be even harder.