Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid fetching completely PR diff as patch #108

Closed
wants to merge 4 commits into from
Closed

Conversation

pbrisbin
Copy link
Member

@pbrisbin pbrisbin commented Jan 17, 2025

This fails for large PRs, and the /files response we already have
contains enough of the diff details to do what we need, which is confirm
that our restyled are contained within added lines of the original PR.

To do this, we introduce a ChangeFile type that we can build from the
/files response. It can hold hunks of added lines, so we can do our
.contains check with it.

It even reads better this way,

changedFile.additions.contain(_)

👌

This fails for large PRs, and the `/files` response we already have
contains enough of the diff details to do what we need, which is confirm
that our restyled are contained within added lines of the original PR.

To do this, we introduce a `ChangeFile` type that we can build from the
`/files` response. It can hold hunks of added lines, so we can do our
`.contains` check with it.

It even reads better this way,

```js
changedFile.additions.contains(_)
```

:ok_hand:
@pbrisbin pbrisbin changed the title pb/diff 2 Avoid fetching completely PR diff as patch Jan 17, 2025
@pbrisbin pbrisbin marked this pull request as ready for review January 17, 2025 16:14
@pbrisbin
Copy link
Member Author

Doing this differently in #110.

@pbrisbin pbrisbin closed this Jan 21, 2025
@pbrisbin pbrisbin deleted the pb/diff-2 branch January 21, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant