Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mirror: Delete tags in mirror which are removed for original repo. #5609

Merged
merged 2 commits into from
Dec 31, 2018

Conversation

HarshitOnGitHub
Copy link
Contributor

This bug was being caused by an error in the logic in release.go.
Credit to @yasuokav for tracing the root of the issue.
I have tested the changes manually as well as added an automated test.

Fixes: #5192.

@codecov-io
Copy link

codecov-io commented Dec 30, 2018

Codecov Report

Merging #5609 into master will increase coverage by 0.29%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5609      +/-   ##
==========================================
+ Coverage   37.51%   37.81%   +0.29%     
==========================================
  Files         322      322              
  Lines       47458    47458              
==========================================
+ Hits        17804    17946     +142     
+ Misses      27097    26926     -171     
- Partials     2557     2586      +29
Impacted Files Coverage Δ
models/release.go 53.75% <50%> (+8.4%) ⬆️
models/repo.go 43.99% <0%> (+1.2%) ⬆️
models/update.go 49.24% <0%> (+17.58%) ⬆️
models/repo_mirror.go 24.26% <0%> (+21.69%) ⬆️

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 b46c279...b007dc9. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 30, 2018
This bug was being caused by an error in the logic in `release.go`.
Credit to @yasuokav for tracing the root of the issue.

Fixes: go-gitea#5192.
@bkcsoft bkcsoft 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 Dec 30, 2018
@lafriks lafriks modified the milestones: 1.8.0, 1.7.0 Dec 30, 2018
@bkcsoft bkcsoft 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 Dec 31, 2018
@techknowlogick
Copy link
Member

@HarshitOnGitHub Thanks for another PR 😄 Best wishes for the new year 🎉

@techknowlogick techknowlogick merged commit 63bd1b9 into go-gitea:master Dec 31, 2018
@HarshitOnGitHub
Copy link
Contributor Author

Best wishes for the new year 🎉

Same to you @techknowlogick and to the whole team of gitea. :)

return fmt.Errorf("GetTagCommitID: %v", err)
}
if !gitRepo.IsTagExist(rel.TagName) || commitID != rel.Sha1 {
if git.IsErrNotExist(err) || commitID != rel.Sha1 {
Copy link
Member

Choose a reason for hiding this comment

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

These two condition are different. If git.IsErrNotExist(err), it should be delted. But for commitID != rel.Sha, the tag should be retag but not delete.

return fmt.Errorf("GetTagCommitID: %v", err)
}
if !gitRepo.IsTagExist(rel.TagName) || commitID != rel.Sha1 {
if git.IsErrNotExist(err) || commitID != rel.Sha1 {
Copy link
Member

Choose a reason for hiding this comment

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

These two condition are different. If git.IsErrNotExist(err), it should be delted. But for commitID != rel.Sha, the tag should be retag but not delete.

@HorlogeSkynet
Copy link
Contributor

Up, could we have a feedback or a patch for #6237 from you @HarshitOnGitHub ? Bye 👋

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to delete tags when syncing mirror
7 participants