cornell-dti / idol

Internal tools platform for DTI, a project team/web development club at Cornell University, which automates all operations of an organization of 100+ members.
GNU Affero General Public License v3.0
7 stars 2 forks source link

Pull from IDOL: Set Max Length for Diff Output in PR Description #717

Closed andrew032011 closed 1 week ago

andrew032011 commented 2 weeks ago

Summary

The "Pull from IDOL" job breaks when the JSON diff output is too large.

RequestError [HttpError]: Validation Failed: {"resource":"Issue","code":"custom","field":"body","message":"body is too long (maximum is 65536 characters)"} - https://docs.github.com/rest/pulls/pulls#create-a-pull-request
    at fetchWrapper (/home/runner/work/idol/idol/new-dti-website/node_modules/@octokit/request/dist-bundle/index.js:119:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (/home/runner/work/idol/idol/new-dti-website/pull-from-idol.ts:95:5) {
  status: 422,
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/cornell-dti/idol/pulls',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'cornell-dti/big-diff-warning octokit-rest.js/21.0.2 octokit-core.js/6.1.2 Node.js/20.18.0 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'

See this failed job: https://github.com/cornell-dti/idol/actions/runs/11904572855/job/33173605118

We can just omit the diff output from the PR body.

Notion/Figma Link

https://www.notion.so/Pull-from-IDOL-Breaks-When-JSON-is-Too-Large-1430ad723ce180e88b14c20faf59e8a8?pvs=4

Test Plan

Check that job passes.

Notes

Breaking Changes

dti-github-bot commented 2 weeks ago

[diff-counting] Significant lines: 8.