mbbroberg / repo_man

0 stars 0 forks source link

Resolve exit on duplicate label #1

Open mbbroberg opened 6 years ago

mbbroberg commented 6 years ago

Not sure why it panics here vs other places..

Working on label 'Help Wanted' for 'sensu-plugins/tools'
/Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/octokit-4.8.0/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://api.github.com/repos/sensu-plugins/tools/labels: 422 - Validation Failed (Octokit::UnprocessableEntity)
Error summary:
  resource: Label
  code: already_exists
  field: name // See: https://developer.github.com/v3/issues/labels/#create-a-label
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/faraday-0.13.1/lib/faraday/response.rb:9:in `block in call'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/faraday-0.13.1/lib/faraday/response.rb:61:in `on_complete'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/faraday-0.13.1/lib/faraday/response.rb:8:in `call'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/octokit-4.8.0/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/octokit-4.8.0/lib/octokit/middleware/follow_redirects.rb:61:in `call'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/faraday-0.13.1/lib/faraday/rack_builder.rb:141:in `build_response'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/faraday-0.13.1/lib/faraday/connection.rb:387:in `run_request'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/faraday-0.13.1/lib/faraday/connection.rb:174:in `post'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/sawyer-0.8.1/lib/sawyer/agent.rb:94:in `call'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/octokit-4.8.0/lib/octokit/connection.rb:156:in `request'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/octokit-4.8.0/lib/octokit/connection.rb:28:in `post'
    from /Users/mbbroberg/.rvm/gems/ruby-2.3.4/gems/octokit-4.8.0/lib/octokit/client/labels.rb:44:in `add_label'
    from ./bin/repo_man:33:in `ensure_label'
    from ./bin/repo_man:159:in `block (2 levels) in <main>'
    from ./bin/repo_man:157:in `each'
    from ./bin/repo_man:157:in `block in <main>'
    from ./bin/repo_man:151:in `each'
    from ./bin/repo_man:151:in `<main>'
mbbroberg commented 6 years ago

Workaround: comment out the failed label and rerun.

mbbroberg commented 6 years ago

Ohhh, crashes when a label exists in a different case (capitalized vs not).