Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

feat: add diff method PullRequestClient#149

Merged
mkarimi23 merged 2 commits into
masterfrom
add_diff
Sep 14, 2023
Merged

feat: add diff method PullRequestClient#149
mkarimi23 merged 2 commits into
masterfrom
add_diff

Conversation

@mkarimi23

Copy link
Copy Markdown
Contributor

Currently there is no support for getting the diff for a pullrequest. This is done by passing a certain header (application/vnd.github.diff) which is done in this PR

@codecov

codecov Bot commented Sep 14, 2023

Copy link
Copy Markdown

Codecov Report

Merging #149 (43c7137) into master (1ffd719) will increase coverage by 0.01%.
The diff coverage is 77.77%.

@@             Coverage Diff              @@
##             master     #149      +/-   ##
============================================
+ Coverage     75.64%   75.66%   +0.01%     
- Complexity      279      281       +2     
============================================
  Files            42       42              
  Lines           969      978       +9     
  Branches         42       43       +1     
============================================
+ Hits            733      740       +7     
- Misses          211      212       +1     
- Partials         25       26       +1     
Files Changed Coverage Δ
...m/spotify/github/v3/clients/PullRequestClient.java 47.76% <77.77%> (+4.65%) ⬆️

@mkarimi23 mkarimi23 requested a review from dziemba September 14, 2023 11:38
public CompletableFuture<Reader> diff(final int number) {
final String path = String.format(PR_NUMBER_TEMPLATE, owner, repo, number);
final Map<String, String> extraHeaders = ImmutableMap.of(
HttpHeaders.ACCEPT, "application/vnd.github.diff"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Let's move "application/vnd.github.diff" to a constant up in the file.

@mkarimi23 mkarimi23 merged commit eef048f into master Sep 14, 2023
@mkarimi23 mkarimi23 deleted the add_diff branch September 14, 2023 11:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants