Description
One of our projects is failing our Scala Steward run, because it currently has a large number of dependencies (>75) requiring update, and we're using Scala Steward grouped PRs - with all those dependency updates in one PR description, the description exceeds the GitHub limit of 65,536 4-byte unicode characters, and the GitHub API call to create the PR fails:
{
"message": "Validation Failed",
"errors": [
{
"resource": "Issue",
"code": "custom",
"field": "body",
"message": "body is too long (maximum is 65536 characters)"
}
],
"documentation_url": "https://docs.github.com/rest/pulls/pulls#create-a-pull-request",
"status": "422"
}
PR description size - where are the characters going?
We can break the PR message down into two main parts:
- About this PR - lists all the updated dependencies, with links to release notes, version diffs, etc.
- Usage - contains '🔍 Files still referring to the old version numbers' & '⚙ Adjust future updates', which lists all the dependencies again, twice, once for
updates.ignore
& again fordependencyOverrides
.
Looking at a large Scala Steward PR with 73 dependency updates, these two main parts are actually almost equal in size.
Possible solutions
- Curtail only the description - so allow the PR to grow huge, but when listing the updated dependencies, only list the first 50 or so and say something like "plus
N
additional dependencies" - Restrict the actual number of dependency updates - eg, only 50 dependency updates max. Ideally we would have a stable ordering that meant we were consistent in the list of dependency updates included. The PR description should also explain that
N
additional dependency updates have been excluded.
I would favour the second option, restricting the actual number of dependency updates - few projects need to be able to absorb more than 50 updates in a single PR, right?! I think we should proceed with this, and then if requirements come in suggesting more are needed, work on ways to make the description markdown more efficient so that we can raise the quota.