Skip to content

Conversation

@fb929
Copy link
Contributor

@fb929 fb929 commented Oct 11, 2023

  1. The problem:
    def "update_release" can not make release as "latest"

  2. How solving the problem:
    adding optional parameter "make_latest", from original api doc: https://docs.github.com/en/free-pro-team@latest/rest/releases/releases?apiVersion=2022-11-28#update-a-release--code-samples

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (9af9b6e) 96.73% compared to head (15283a6) 96.72%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2788      +/-   ##
==========================================
- Coverage   96.73%   96.72%   -0.02%     
==========================================
  Files         139      139              
  Lines       14185    14188       +3     
==========================================
+ Hits        13722    13723       +1     
- Misses        463      465       +2     
Files Coverage Δ
github/GitRelease.py 97.67% <33.33%> (-1.15%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trim21
Copy link
Contributor

trim21 commented Oct 21, 2023

can you also update document link in docstring? current link is out of data.

@pfarrell
Copy link

@fb929 I was just about to submit a PR to do exactly this.
Are you planning to complete this PR? This is a very feature I needed and had to implement by calling the github rest api directly. I'd much prefer to have support in PyGithub.

Copy link
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.

While you are here, can you please add discussion_category_name as well?

"prerelease": prerelease,
}
if make_latest is not NotSet:
assert isinstance(make_latest, bool), make_latest
Copy link
Collaborator

Choose a reason for hiding this comment

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

documentation says, this is a string

Suggested change
assert isinstance(make_latest, bool), make_latest
assert make_latest in ["true", "false", "legacy"], make_latest

@EnricoMi
Copy link
Collaborator

@pfarrell feel free to fork @fb929's repo and branch and create a new PR to finish this. This way, @fb929's contribution is credited and we get this over the finish line.

@EnricoMi
Copy link
Collaborator

EnricoMi commented Dec 22, 2023

Looks like message has been renamed to body. This should be reflected in another PR to prevent this from breaking in the future. https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28

message: str,
draft: bool = False,
prerelease: bool = False,
make_latest: Opt[bool] = NotSet,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding this here may break user code, can you add this at the end of the argument list?

@EnricoMi
Copy link
Collaborator

@pfarrell @fb929 can we get this over the finish line?

@EnricoMi EnricoMi changed the title github/GitRelease.py added "make_latest" option for def "update_release" Add make_latest to GitRelease.update_release Jan 28, 2024
treee111 added a commit to treee111/PyGithub that referenced this pull request Jan 30, 2024
@treee111
Copy link
Contributor

I tackled the PR review of this PR in the linked PR. @trim21 and @EnricoMi feel free to review.

Looks like message has been renamed to body. This should be reflected in another PR to prevent this from breaking in the future. https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28

we already send/post that as body to the Github API and have message only as input to PyGithub if I am correct? So no need for adjustment (because that would break user code). See:

post_parameters = {
"tag_name": tag_name,
"name": name,
"body": message,
"draft": draft,
"prerelease": prerelease,
}

treee111 added a commit to treee111/PyGithub that referenced this pull request Jan 31, 2024
treee111 added a commit to treee111/PyGithub that referenced this pull request Jan 31, 2024
treee111 added a commit to treee111/PyGithub that referenced this pull request Jan 31, 2024
@pfarrell
Copy link

pfarrell commented Feb 3, 2024

@pfarrell @fb929 can we get this over the finish line?

@EnricoMi, apologies for missing the alerts on this, thanks @@treee111 for picking this up

@treee111
Copy link
Contributor

treee111 commented Feb 3, 2024

You are welcome @pfarrell. Feel free to test the coding and comment if it worked for you! Helps the PR getting merged :-)

@EnricoMi
Copy link
Collaborator

EnricoMi commented Feb 4, 2024

Closed in favour of #2888.

@EnricoMi EnricoMi closed this Feb 4, 2024
github-merge-queue bot pushed a commit that referenced this pull request Apr 19, 2024
### The problem:

- def "update_release" can not make release as "latest"

### How solving the problem:

- adding optional parameter "make_latest", from original api doc:
https://docs.github.com/en/free-pro-team@latest/rest/releases/releases?apiVersion=2022-11-28#update-a-release--code-samples

### additions

- documentation URL has changed
- `discussion_category_name` has been added

superseds #2788

---------

Co-authored-by: Grigory Efimov <grigory.efimov@gmail.com>
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants