-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise error if pinned hash from .configure
file is not found
#410
Open
mokagio
wants to merge
4
commits into
trunk
Choose a base branch
from
mokagio/fix-configure-nil-crash
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Sep 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4d3a5ff - Browse repository at this point
Copy the full SHA 4d3a5ffView commit details -
Raise error if pinned hash from
.configure
file is not foundI just run into this edge case while attempting to update a repository. `bundle exec run configure_update` crashed on me because it tried to compare `nil` and a number with `>=`. The `nil` value was the result of looking for the index of the pinned commit in `.configure` in the `.mobile-secrets` repository. I believe that occurred because, when prompted ``` [13:24:11]: The current branch is 2 commit(s) behind. Would you like to update it? (y/n) ``` I selected no, resulting in my local copy of `.mobile-secrets` to be two commits out of date. For the record, I selected `n` because I interpreted the prompt as a suggestion to update the pinned has in `.configure`, not the `.mobile-secrets` repository. The messages to `STDOUT` from the tool's internal made me think it already pulled the repo. Regardless of how I ended up in that inconsistent state, I think this early failure and error message would have helped me. For reference, below is the full stacktrace: ``` bundler: failed to load command: fastlane (/path/to/repo/vendor/bundle/ruby/2.7.0/bin/fastlane) Traceback (most recent call last): 37: from /path/to/repo/gio/.rbenv/versions/2.7.4/bin/bundle:23:in `<main>' 36: from /path/to/repo/gio/.rbenv/versions/2.7.4/bin/bundle:23:in `load' 35: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/exe/bundle:36:in `<top (required)>' 34: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors' 33: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/exe/bundle:48:in `block in <top (required)>' 32: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli.rb:25:in `start' 31: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' 30: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli.rb:31:in `dispatch' 29: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' 28: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' 27: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' 26: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli.rb:485:in `exec' 25: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli/exec.rb:23:in `run' 24: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli/exec.rb:58:in `kernel_load' 23: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli/exec.rb:58:in `load' 22: from /path/to/repo/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `<top (required)>' 21: from /path/to/repo/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `load' 20: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/bin/fastlane:23:in `<top (required)>' 19: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off' 18: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start' 17: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run' 16: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!' 15: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!' 14: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command' 13: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run' 12: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call' 11: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/commands_generator.rb:226:in `block (2 levels) in run' 10: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/one_off.rb:22:in `execute' 9: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/one_off.rb:42:in `run' 8: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action' 7: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:229:in `chdir' 6: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action' 5: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action' 4: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action' 3: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb:20:in `run' 2: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb:94:in `configure_file_is_behind_repo' 1: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb:98:in `configure_file_is_behind_local' /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb:109:in `configure_file_commits_behind_repo': undefined method `>=' for nil:NilClass (NoMethodError) 37: from /path/to/repo/gio/.rbenv/versions/2.7.4/bin/bundle:23:in `<main>' 36: from /path/to/repo/gio/.rbenv/versions/2.7.4/bin/bundle:23:in `load' 35: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/exe/bundle:36:in `<top (required)>' 34: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors' 33: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/exe/bundle:48:in `block in <top (required)>' 32: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli.rb:25:in `start' 31: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' 30: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli.rb:31:in `dispatch' 29: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' 28: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' 27: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' 26: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli.rb:485:in `exec' 25: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli/exec.rb:23:in `run' 24: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli/exec.rb:58:in `kernel_load' 23: from /path/to/repo/gio/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/bundler-2.3.20/lib/bundler/cli/exec.rb:58:in `load' 22: from /path/to/repo/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `<top (required)>' 21: from /path/to/repo/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `load' 20: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/bin/fastlane:23:in `<top (required)>' 19: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off' 18: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start' 17: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run' 16: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!' 15: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!' 14: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command' 13: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run' 12: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call' 11: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/commands_generator.rb:226:in `block (2 levels) in run' 10: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/one_off.rb:22:in `execute' 9: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/one_off.rb:42:in `run' 8: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action' 7: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:229:in `chdir' 6: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action' 5: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action' 4: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-2.210.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action' 3: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb:20:in `run' 2: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb:94:in `configure_file_is_behind_repo' 1: from /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb:98:in `configure_file_is_behind_local' /path/to/repo/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-wpmreleasetoolkit-5.4.0/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb:109:in `configure_file_commits_behind_repo': \e[31m[!] undefined method `>=' for nil:NilClass\e[0m (NoMethodError) ```
Configuration menu - View commit details
-
Copy full SHA for 16eb6c4 - Browse repository at this point
Copy the full SHA 16eb6c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19231eb - Browse repository at this point
Copy the full SHA 19231ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3fff855 - Browse repository at this point
Copy the full SHA 3fff855View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.