reviewpad / reviewpad

Next generation pull requests and issues 🦄
https://reviewpad.com
GNU Lesser General Public License v3.0
198 stars 31 forks source link

refactor: don't recreate patch every time #1080

Closed zolamk closed 1 year ago

zolamk commented 1 year ago

Description

the NewPullRequestTarget function fetches the patch from the API everytime which is a problem if it's called multiple times, this PR introduces a new function NewPullRequestTargetWithPatch which can be passed the patch so that it's possible to reuse the patch that was already fetched.

Closes #1078

Summary generated by Reviewpad on 20 Sep 23 11:04 UTC

This pull request adds a new function to create a pull request target that can receive a patch. It also refactors an existing function to clarify its purpose. The changes include modifications to the pull_request_target.go and interpreter.go files.

🤖 Generated by Copilot at d92737d

This pull request enables the Aladino script to modify the GitHub pull request target using the apply command. It does this by passing the patch data from the environment to the PullRequestTarget constructor and storing it in the struct.

Code review and merge strategy

Ask: this pull request requires a code review before merge

How

🤖 Generated by Copilot at d92737d

reviewpad[bot] commented 1 year ago

Pull request is not up to date with the base branch. Reviewpad will rebase it. After the rebase, please trigger Reviewpad by running the command /reviewpad run in a comment.

zolamk commented 1 year ago

/reviewpad run

reviewpad[bot] commented 1 year ago

Pull request is not up to date with the base branch. Reviewpad will rebase it. After the rebase, please trigger Reviewpad by running the command /reviewpad run in a comment.