Skip to content
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

Handle files without patch in elvis_webhook #378

Open
elbrujohalcon opened this issue May 13, 2016 · 1 comment
Open

Handle files without patch in elvis_webhook #378

elbrujohalcon opened this issue May 13, 2016 · 1 comment
Labels

Comments

@elbrujohalcon
Copy link
Member

elbrujohalcon commented May 13, 2016

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:

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}]}]
@elbrujohalcon
Copy link
Member Author

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

@elbrujohalcon elbrujohalcon changed the title Handle Unchanged files in elvis_webhook Handle files without patch in elvis_webhook Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant