hub4j / github-api

Java API for GitHub
https://github-api.kohsuke.org/
MIT License
1.12k stars 718 forks source link

Make sure we refresh the PRs with the PR API (and not the issues API) #1810

Closed gsmet closed 4 months ago

gsmet commented 4 months ago

When a PR was loaded from a search, the refresh() method was reloading information from the issues API, which would lead to some information not being refreshed properly, typically the mergeable state.

Related to https://github.com/hub4j/github-api/pull/1779#issuecomment-1966392546

gsmet commented 4 months ago

@bitwiseman I created 3 PRs to fix some issues with GHPullRequest API behavior.

There might be some conflicts given I added some tests to the same place but they should be easy to fix. If you prefer, I can bundle the commits in one single PR but I thought it would be better for release notes to keep them separated.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.69%. Comparing base (1aa7178) to head (8bc0bfc). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1810 +/- ## ============================================ + Coverage 80.66% 80.69% +0.02% Complexity 2342 2342 ============================================ Files 220 220 Lines 7082 7085 +3 Branches 379 378 -1 ============================================ + Hits 5713 5717 +4 Misses 1132 1132 + Partials 237 236 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.