Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add support for pulling the latest release#2248

Open
kiwiz wants to merge 3 commits into
PyGithub:mainfrom
kiwiz:master
Open

Add support for pulling the latest release#2248
kiwiz wants to merge 3 commits into
PyGithub:mainfrom
kiwiz:master

Conversation

@kiwiz
Copy link
Copy Markdown

@kiwiz kiwiz commented Jun 1, 2022

Github allows you to hit .../releases/latest to 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/latest instead.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 19, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.74%. Comparing base (7902351) to head (27b7f3c).
Report is 360 commits behind head on main.

Files with missing lines Patch % Lines
github/Repository.py 66.66% 1 Missing ⚠️

❗ 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.
📢 Have feedback on the report? Share it here.

@github-actions github-actions Bot removed the ⭐ top pull request Top pull request. label Jan 15, 2025
Copy link
Copy Markdown
Collaborator

@EnricoMi EnricoMi left a comment

Choose a reason for hiding this comment

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

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.

@kiwiz
Copy link
Copy Markdown
Author

kiwiz commented Feb 16, 2025

Updated. I removed some IDs from the fixtures, so hopefully they still work.

@github-actions github-actions Bot removed the ⭐ top pull request Top pull request. label Jul 18, 2025
@EnricoMi
Copy link
Copy Markdown
Collaborator

Why is Repository.get_latest_release not sufficient?

Comment thread tests/ReplayData/LazyRepository.testGetReleases.txt Outdated
Comment thread tests/Repository.py Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 21, 2025

Test Results

     8 files  ± 0       8 suites  ±0   5m 2s ⏱️ +8s
 1 003 tests + 4     999 ✅ ±0  0 💤 ±0   4 ❌ + 4 
11 099 runs  +32  11 066 ✅ ±0  1 💤 ±0  32 ❌ +32 

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
Copy link
Copy Markdown
Collaborator

@EnricoMi EnricoMi Jul 21, 2025

Choose a reason for hiding this comment

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

I think all gh_user/PyGithub occurrences in these txt files should be replaced with PyGithub/PyGithub for the tests to work.

Comment thread github/Repository.py
"""
: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")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am worried that users would not be able to get the tag latest any more.

@github-actions github-actions Bot added the ⭐ top pull request Top pull request. label Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants