danger-js icon indicating copy to clipboard operation
danger-js copied to clipboard

GitHub Comment Length Limit

Open fbartho opened this issue 6 years ago • 6 comments

The GitHub Integration just fails with a GitHub Error Response if your Issue Comment gets too long.

It’d be great if we truncated the message, & added a [truncated] 📝?

Thoughts @orta ? I’m happy to implement this if you have advice!

fbartho avatar Sep 19 '19 01:09 fbartho

I think it should already do that, maybe there's some edge cases where it doesn't?

orta avatar Sep 19 '19 02:09 orta

Is it possible that github’s limit changed?

fbartho avatar Sep 19 '19 05:09 fbartho

That seems unlikely to me, given how much stuff could break - check the source and your repro, to see if you can think of a way?

orta avatar Sep 19 '19 12:09 orta

I looked through each of the files under the Github Platform, and I couldn't find any that did truncation? Do you have an idea where the implementation of that truncation might be?

I mostly looked here: https://github.com/danger/danger-js/blob/master/source/platforms/github

I also searched our code for 65536 and I couldn't find that constant anywhere except as a spurious power-of-two constant in an old Issue (unrelated).

fbartho avatar Sep 19 '19 23:09 fbartho

{ fails: { numEntries: 3, sumNumChars: 272745 },
  warnings: { numEntries: 0, sumNumChars: 0 },
  messages: { numEntries: 1, sumNumChars: 123 },
  markdowns: { numEntries: 0, sumNumChars: 0 } }

Looking at this debug log I stuck in, it looks like there were a ton of text in one of my fail messages. (I think it's a lot of snapshot failures)

fbartho avatar Sep 19 '19 23:09 fbartho

Ah, maybe it was in danger ruby we built infra to check the length. Hard to keep on top of all the implementations

orta avatar Sep 25 '19 12:09 orta