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

refactor: don't recreate patch every time #1080

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

zolamk
Copy link
Contributor

@zolamk zolamk commented Sep 19, 2023

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

  • Add new constructor function for PullRequestTarget that takes patch data as an argument (link)
  • Update ExecStatement function in interpreter.go to use the new constructor function and pass the patch data from the environment (link)
  • Add an empty line to interpreter.go for readability (link)

@reviewpad reviewpad bot added ask Pull request requires a code review before merge small small pull request labels Sep 19, 2023
@reviewpad reviewpad bot requested a review from marcelosousa September 19, 2023 07:58
@reviewpad reviewpad bot added waiting-approval Pull request is waiting for approval ship Pull request can be automatically merged and does not require code review and removed ask Pull request requires a code review before merge labels Sep 19, 2023
reviewpad[bot]
reviewpad bot previously approved these changes Sep 20, 2023
Copy link

@reviewpad reviewpad bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request is in ship mode. Reviewpad will merge it.

@reviewpad reviewpad bot added ask Pull request requires a code review before merge and removed ship Pull request can be automatically merged and does not require code review labels Sep 20, 2023
@reviewpad
Copy link

reviewpad bot commented Sep 20, 2023

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
Copy link
Contributor Author

zolamk commented Sep 20, 2023

/reviewpad run

@reviewpad
Copy link

reviewpad bot commented Sep 20, 2023

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 zolamk force-pushed the refactor/new-pull-request-target branch from 387da43 to 1246beb Compare September 20, 2023 11:04
@zolamk zolamk dismissed reviewpad[bot]’s stale review September 20, 2023 11:08

pr converted to ask

@reviewpad reviewpad bot removed the waiting-approval Pull request is waiting for approval label Sep 25, 2023
Copy link

@reviewpad reviewpad bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request is ready to be merged. Reviewpad will merge it for you.

@reviewpad reviewpad bot added this pull request to the merge queue Sep 25, 2023
Merged via the queue into main with commit 1cb020a Sep 25, 2023
@shay2025 shay2025 deleted the refactor/new-pull-request-target branch October 13, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ask Pull request requires a code review before merge small small pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review the use of NewPullRequestTarget
2 participants