Add support for pulling the latest release#2248
Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2248 +/- ##
==========================================
- Coverage 98.75% 98.74% -0.01%
==========================================
Files 115 115
Lines 11578 11581 +3
==========================================
+ Hits 11434 11436 +2
- Misses 144 145 +1 ☔ View full report in Codecov by Sentry. |
EnricoMi
left a comment
There was a problem hiding this comment.
Please replace:
:param id: int (release id), str (tag name)
with
:param id: int (release id), str (tag name or "latest")
Please add a test where latest release is being pulled. If there are no Repository.get_release[s] tests so far, please add those as well in tests/Repository.py. You can fetch releases from self.repo.
|
Updated. I removed some IDs from the fixtures, so hopefully they still work. |
|
Why is |
Test Results 8 files ± 0 8 suites ±0 5m 2s ⏱️ +8s For more details on these failures, see this check. Results for commit 362d3b7. ± Comparison against base commit 858b9e5. ♻️ This comment has been updated with latest results. |
| GET | ||
| api.github.com | ||
| None | ||
| /repos/gh_user/PyGithub/releases/latest |
There was a problem hiding this comment.
I think all gh_user/PyGithub occurrences in these txt files should be replaced with PyGithub/PyGithub for the tests to work.
| """ | ||
| :calls: `GET /repos/{owner}/{repo}/releases/{id} <https://docs.github.com/en/rest/reference/repos#get-a-release>`_ | ||
| :param id: int (release id), str (tag name) | ||
| :param id: int (release id), str (tag name or "latest") |
There was a problem hiding this comment.
I am worried that users would not be able to get the tag latest any more.
Github allows you to hit
.../releases/latestto fetch the latest release for a repo. Example. This currently doesn't work in PyGithub because passing in a string will try to hit.../releases/tags/latestinstead.