This repository was archived by the owner on Apr 20, 2026. It is now read-only.
Validate check run output text and summary length#118
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #118 +/- ##
============================================
+ Coverage 73.50% 73.59% +0.08%
- Complexity 250 253 +3
============================================
Files 39 40 +1
Lines 887 890 +3
Branches 39 40 +1
============================================
+ Hits 652 655 +3
Misses 210 210
Partials 25 25
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Comment on lines
+102
to
+105
| Preconditions.checkState(summary().map(String::length).orElse(0) <= 64 * 1024, | ||
| "'summary' exceeded max length of 65535 characters"); | ||
| Preconditions.checkState(text().map(String::length).orElse(0) <= 64 * 1024, | ||
| "'text' exceeded max length of 65535 characters"); |
Contributor
There was a problem hiding this comment.
Suggested change
| Preconditions.checkState(summary().map(String::length).orElse(0) <= 64 * 1024, | |
| "'summary' exceeded max length of 65535 characters"); | |
| Preconditions.checkState(text().map(String::length).orElse(0) <= 64 * 1024, | |
| "'text' exceeded max length of 65535 characters"); | |
| Preconditions.checkState(summary().map(String::length).orElse(0) < 64 * 1024, | |
| "'summary' exceeded max length of 65535 characters"); | |
| Preconditions.checkState(text().map(String::length).orElse(0) < 64 * 1024, | |
| "'text' exceeded max length of 65535 characters"); |
Contributor
There was a problem hiding this comment.
64*1024 = 65536
Maximum length allowed is 65535 characters
Contributor
Author
There was a problem hiding this comment.
Already resolved, thanks
dziemba
reviewed
Dec 9, 2022
dziemba
approved these changes
Dec 9, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatically validates the maximum length of check run
outputproperties.GitHub does not validate these properly on their side (at least in GHE 3.2)
and returns 422 HTTP responses instead. To avoid that, let's validate the data
in this client library.
The values are taken from the official GitHub documentation