Skip to content

Conversation

johanvdw
Copy link
Contributor

@johanvdw johanvdw commented Sep 24, 2020

Get a release based on a tag name (for which a release exists).
Based on:
https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name

This is a useful feature for deploy scripts.

Note I'm new to gitea and go in general, so please review carefully.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 24, 2020
@6543 6543 added modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Sep 24, 2020
@6543 6543 added this to the 1.14.0 milestone Sep 24, 2020
@6543
Copy link
Member

6543 commented Sep 24, 2020

some tests missing
-> https://github.com/go-gitea/gitea/blob/master/integrations/api_releases_test.go

just add 2 api calls: (Get Existing Release, Get Not Existing Release)
and check result :)

Existing Releases it tests: https://github.com/go-gitea/gitea/blob/master/models/fixtures/release.yml

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2020

Codecov Report

Merging #12932 into master will increase coverage by 0.12%.
The diff coverage is 68.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12932      +/-   ##
==========================================
+ Coverage   42.71%   42.84%   +0.12%     
==========================================
  Files         661      662       +1     
  Lines       72986    73002      +16     
==========================================
+ Hits        31177    31277     +100     
+ Misses      36760    36656     -104     
- Partials     5049     5069      +20     
Impacted Files Coverage Δ
routers/api/v1/repo/release_tags.go 61.53% <61.53%> (ø)
routers/api/v1/api.go 79.35% <100.00%> (+0.09%) ⬆️
models/unit.go 46.57% <0.00%> (-2.74%) ⬇️
modules/process/manager.go 72.50% <0.00%> (-2.50%) ⬇️
modules/git/repo_commit.go 50.54% <0.00%> (-0.73%) ⬇️
models/error.go 34.34% <0.00%> (-0.68%) ⬇️
routers/repo/view.go 37.47% <0.00%> (-0.65%) ⬇️
modules/indexer/stats/db.go 52.17% <0.00%> (ø)
services/pull/pull.go 41.27% <0.00%> (+0.49%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d71eaac...a0e7e25. Read the comment docs.

@johanvdw
Copy link
Contributor Author

some tests missing
-> https://github.com/go-gitea/gitea/blob/master/integrations/api_releases_test.go

just add 2 api calls: (Get Existing Release, Get Not Existing Release)
and check result :)

Existing Releases it tests: https://github.com/go-gitea/gitea/blob/master/models/fixtures/release.yml

Thanks for the pointer, I was looking for the tests. I will add them.

@6543
Copy link
Member

6543 commented Sep 24, 2020

You need to commit result of make generate-swagger again :)

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 24, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 24, 2020
@6543
Copy link
Member

6543 commented Sep 25, 2020

@johanvdw It's feature freeze, so we have to wait for 1.13.0 RC1

to merge this :)

@zeripath
Copy link
Contributor

meh if it's ready - it's ready. I'm happy to merge into 1.13 given it's self-contained.

@zeripath zeripath removed this from the 1.14.0 milestone Sep 25, 2020
@zeripath zeripath added this to the 1.13.0 milestone Sep 25, 2020
@zeripath zeripath merged commit 34d9cb3 into go-gitea:master Sep 25, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@johanvdw johanvdw deleted the api_release_by_tag branch February 19, 2023 16:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants