Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

PRs with special characters in the title can fail #351

Closed
zimbatm opened this issue Feb 20, 2018 · 3 comments
Closed

PRs with special characters in the title can fail #351

zimbatm opened this issue Feb 20, 2018 · 3 comments

Comments

@zimbatm
Copy link
Contributor

zimbatm commented Feb 20, 2018

When a PR has some special characters in the title like # (like when referencing another github issue in the title), the batch can fail with:

{:badarg,
 [{:binary, :match,
   [nil, {:bm, #Reference<0.3286459918.3038642177.151217>}],
   []},
  {String, :do_splitter, 3,
   [file: 'lib/string.ex', line: 414]},
  {Stream, :do_unfold, 4,
   [file: 'lib/stream.ex', line: 1354]},
  {Enum, :fetch_enumerable, 3,
   [file: 'lib/enum.ex', line: 758]},
  {Enum, :at, 3, [file: 'lib/enum.ex', line: 313]},
  {BorsNG.Worker.Batcher.Message,
   :"-generate_commit_message/2-fun-2-", 3,
   [file: 'lib/batcher/message.ex', line: 85]},
  {Enum, :"-reduce/3-lists^foldl/2-0-", 3,
   [file: 'lib/enum.ex', line: 1755]},
  {BorsNG.Worker.Batcher.Message, :generate_commit_message,
   2, [file: 'lib/batcher/message.ex', line: 84]}]}

I need to work a bit more on the reproduction of the bug.

It might be a utf-8 encoding issue?

@notriddle
Copy link
Member

notriddle commented Feb 20, 2018

I think it's related to having a PR with no body text (which GitHub ends up sending as null, not an empty string) and having a defined cut-body-after declaration.

notriddle added a commit to notriddle/bors-ng that referenced this issue Feb 20, 2018
@grahamc
Copy link
Contributor

grahamc commented Feb 20, 2018

For what its worth, sometimes (IIRC) GitHub will omit the field altogether on PRs with no body. I found this exact bug a few weeks ago with the Rust GitHub API client: softprops/hubcaps#107

@notriddle
Copy link
Member

notriddle commented Feb 20, 2018

Now that I look at it, that actually makes no sense. It should be normalizing that nil away.

https://github.com/bors-ng/bors-ng/blob/master/apps/bors_github/lib/github/pr.ex#L74-L77

bors bot added a commit that referenced this issue Feb 20, 2018
352: Handle cut-body-after with a `nil` body r=notriddle a=notriddle

Fixes #351
@bors bors bot closed this as completed in #352 Feb 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants