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

Add GitlabPullRequest.patch property #614

Merged

Conversation

nikromen
Copy link
Member

Implementated for GitlabPullRequest.

It returns bytes in case there's some binary blob in the patch.
It uses requests to get content from patch's URL.

Implementation for #416

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@@ -106,6 +107,17 @@ def diff_url(self) -> str:
def commits_url(self) -> str:
return f"{self._raw_pr.web_url}/commits"

@property
def patch(self) -> bytes:
response = requests.get(f"{self._raw_pr.web_url}.patch")
Copy link
Member

Choose a reason for hiding this comment

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

I see we already have a url property you can use:

Suggested change
response = requests.get(f"{self._raw_pr.web_url}.patch")
response = requests.get(f"{self.url}.patch")

@jpopelka
Copy link
Member

You'll also need to rebase since your other PR has been merged meanwhile and we (Franta ;-) ) want to have a straight git history.

Implementated for GitlabPullRequest.

It returns bytes in case there's some binary blob in the patch.
It uses requests to get content from patch's URL.
@nikromen nikromen force-pushed the GitlabPullRequest.patch branch from e65b196 to 8baf426 Compare July 15, 2021 07:48
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@nikromen nikromen added the mergeit When set, zuul wil gate and merge the PR. label Jul 15, 2021
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 3d2c776 into packit:main Jul 15, 2021
@nikromen nikromen deleted the GitlabPullRequest.patch branch July 30, 2021 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants