Open elbrujohalcon opened 8 years ago
When a file is just moved, github doesn't send patch field in json payload for PRs. That makes elvis_webhook crash with the following error:
patch
elvis_webhook
20:27:11.686 [error] [elvis_server_utils:handle_exception:145] function_clause. Stack Trace: [{elvis_webhook,file_info,[{basic,"elvisci","Lg2GPF22pM7wfduS"},"inaka/xref_runner",#{path => <<"test_examples/erlang-repo/src/erlang_repo_app.erl">>,<<"additions">> => 0,<<"blob_url">> => <<"https://github.com/inaka/xref_runner/blob/9951962c9f35036a4047b865ac2818a5bf5cdb1d/test_examples/erlang-repo/src/erlang_repo_app.erl">>,<<"changes">> => 0,<<"contents_url">> => <<"https://api.github.com/repos/inaka/xref_runner/contents/test_examples/erlang-repo/src/erlang_repo_app.erl?ref=9951962c9f35036a4047b865ac2818a5bf5cdb1d">>,<<"deletions">> => 0,<<"filename">> => <<"test_examples/erlang-repo/src/erlang_repo_app.erl">>,<<"previous_filename">> => <<"test/examples/erlang-repo/src/erlang_repo_app.erl">>,<<"raw_url">> => <<"https://github.com/inaka/xref_runner/raw/9951962c9f35036a4047b865ac2818a5bf5cdb1d/test_examples/erlang-repo/src/erlang_repo_app.erl">>,<<"sha">> => <<"a5a0ee0b6098ca176b9093532f2d727e7fa66f74">>,<<"status">> => <<"renamed">>}],[{file,"src/elvis_webhook.erl"},{line,57}]},{lists,map,2,[{file,"lists.erl"},{line,1237}]},{lists,map,2,[{file,"lists.erl"},{line,1237}]},{elvis_config,apply_to_files,2,[{file,"src/elvis_config.erl"},{line,204}]},{lists,map,2,[{file,"lists.erl"},{line,1237}]},{elvis_webhook,handle_pull_request,3,[{file,"src/elvis_webhook.erl"},{line,41}]},{egithub_webhook,do_handle_pull_request,3,[{file,"src/egithub_webhook.erl"},{line,150}]},{egithub_webhook,event,3,[{file,"src/egithub_webhook.erl"},{line,48}]}]
Same thing happens if there are too many changes in a single file, as you can see in https://github.com/esl/MongooseIM/pull/1259/files#diff-31008e4e10b2f4d7c420a7eaa2996e57
When a file is just moved, github doesn't send
patch
field in json payload for PRs. That makeselvis_webhook
crash with the following error: