mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
workflows/check-cherry-picks: truncate long diffs after 10k characters
GitHub comments have a length limit, so we can't just dump everything. The 10k limit is arbitrary, but the assumption is that reviewing the range-diff is not the sensible thing to do once it becomes a certain size - reviewing the regular diff and treating the commit as "new" is easier to do in that case. Thus, truncating should work out fine, especially when the full range-diff is still available in the runner log. This could still end up in with an error, if a PR has multiple commits, which all hit the limit. Let's get there first, before we try to fix that hypothetical case, too.
This commit is contained in:
parent
515b174c42
commit
856792f93e
2 changed files with 16 additions and 2 deletions
5
.github/workflows/check-cherry-picks.yml
vendored
5
.github/workflows/check-cherry-picks.yml
vendored
|
@ -49,7 +49,7 @@ jobs:
|
|||
const header = await readFile('trusted/ci/check-cherry-picks.md')
|
||||
const body = await readFile('checked-cherry-picks.md')
|
||||
const footer =
|
||||
`\n_Hint: The diffs are also available in the [runner logs](${job_url}) with slightly better highlighting._`
|
||||
`\n_Hint: The full diffs are also available in the [runner logs](${job_url}) with slightly better highlighting._`
|
||||
|
||||
const review = header + body + footer
|
||||
await writeFile('review.md', review)
|
||||
|
@ -79,6 +79,9 @@ jobs:
|
|||
)
|
||||
)
|
||||
|
||||
// Either of those two requests could fail for very long comments. This can only happen
|
||||
// with multiple commits all hitting the truncation limit for the diff. If you ever hit
|
||||
// this case, consider just splitting up those commits into multiple PRs.
|
||||
if (pendingReview) {
|
||||
await github.rest.pulls.updateReview({
|
||||
owner: context.repo.owner,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue