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

Doctor check & fix db consistency #11111

Merged

Conversation

6543
Copy link
Member

@6543 6543 commented Apr 17, 2020

as title

needed to fix issue as described in #10280

  • rename check-db to check-db-version
  • add check-db-consistency:
    • find issues without existing repository
    • find pulls without existing issues
    • find tracked times without existing issues/pulls
    • find labels without repository or org reference

@6543
Copy link
Member Author

6543 commented Apr 17, 2020

backport would be usefull (look at #10280)

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 17, 2020
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Apr 17, 2020
@lunny lunny added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Apr 18, 2020
@guillep2k
Copy link
Member

@lunny it shouldn't be breaking if it's released on 1.12.0 and backported to 1.11.5, since the doctor hasn't been released yet. 👨‍⚕️

cmd/doctor.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Apr 19, 2020

Codecov Report

Merging #11111 into master will decrease coverage by 0.08%.
The diff coverage is 8.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11111      +/-   ##
==========================================
- Coverage   43.97%   43.88%   -0.09%     
==========================================
  Files         614      614              
  Lines       87457    87607     +150     
==========================================
- Hits        38459    38449      -10     
- Misses      44263    44421     +158     
- Partials     4735     4737       +2     
Impacted Files Coverage Δ
cmd/doctor.go 0.00% <0.00%> (ø)
models/consistency.go 56.93% <0.00%> (-39.71%) ⬇️
models/issue.go 51.57% <30.76%> (-0.85%) ⬇️
models/repo.go 52.90% <50.00%> (+0.69%) ⬆️
models/repo_mirror.go 2.12% <0.00%> (-10.64%) ⬇️
modules/git/repo.go 47.28% <0.00%> (-3.77%) ⬇️
services/pull/temp_repo.go 34.18% <0.00%> (-3.42%) ⬇️
services/mirror/mirror.go 18.38% <0.00%> (-0.65%) ⬇️
services/pull/pull.go 33.39% <0.00%> (-0.58%) ⬇️
modules/log/event.go 65.64% <0.00%> (+1.02%) ⬆️
... and 3 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 b2b86ea...a0f626e. Read the comment docs.

@6543
Copy link
Member Author

6543 commented Apr 19, 2020

@guillep2k created new function explicit for Issue Deletion
(move issue delete code out of RepoDeletion)

models/issue.go Outdated Show resolved Hide resolved
cmd/doctor.go Outdated Show resolved Hide resolved
models/issue.go Outdated Show resolved Hide resolved
models/issue.go Outdated Show resolved Hide resolved
@6543
Copy link
Member Author

6543 commented Apr 19, 2020

@guillep2k @lunny I put the part (reason for this feature) into #11138 as Backport to let users fix there instances - can we add #11138 to the 1.11.5 milestone ?

cmd/doctor.go Outdated Show resolved Hide resolved
@6543 6543 changed the title [Feature] Doctor check&fix db consistency [WIP] [Feature] Doctor check&fix db consistency Apr 22, 2020
@lunny
Copy link
Member

lunny commented May 1, 2020

@lunny it shouldn't be breaking if it's released on 1.12.0 and backported to 1.11.5, since the doctor hasn't been released yet. 👨‍⚕️

So this PR is break in v1.12 but not in v1.11 ?

@6543
Copy link
Member Author

6543 commented May 1, 2020

@lunny
do not know, the doctor function ins in master and release-1.11 branch ...

I'll work on this the next days to finish it ... this should realy go into the v1.12 release ...

@6543
Copy link
Member Author

6543 commented May 28, 2020

done

cmd/doctor.go Outdated Show resolved Hide resolved
@6543
Copy link
Member Author

6543 commented May 28, 2020

its finaly ready to merge 🚀

@6543
Copy link
Member Author

6543 commented May 28, 2020

I think we should backport this to v1.12

@guillep2k guillep2k added this to the 1.13.0 milestone May 29, 2020
@zeripath zeripath changed the title [Feature] Doctor check&fix db consistency Doctor check&fix db consistency May 29, 2020
@zeripath zeripath changed the title Doctor check&fix db consistency Doctor check & fix db consistency May 29, 2020
@zeripath zeripath merged commit 726e1e5 into go-gitea:master May 29, 2020
@6543 6543 deleted the doctor-check-fix-db-consistency_10280 branch May 29, 2020 13:33
6543 added a commit to 6543-forks/gitea that referenced this pull request May 29, 2020
needed to fix issue as described in go-gitea#10280

* rename check-db to check-db-version
* add check-db-consistency:
* find issues without existing repository
* find pulls without existing issues
* find tracked times without existing issues/pulls
* find labels without repository or org reference

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
@6543
Copy link
Member Author

6543 commented May 29, 2020

Backports: #11676
and partial #11138

@zeripath zeripath added the backport/done All backports for this PR have been created label May 29, 2020
6543 added a commit to adelowo/gitea that referenced this pull request May 29, 2020
zeripath pushed a commit that referenced this pull request May 29, 2020
Backports the tracked-time fix from #11111 (part of #11111)

Fixes tracked time errors following repo deletion (#10280) and adds the fix to the default doctor tasks
jolheiser pushed a commit that referenced this pull request May 29, 2020
needed to fix issue as described in #10280

* rename check-db to check-db-version
* add check-db-consistency:
* find issues without existing repository
* find pulls without existing issues
* find tracked times without existing issues/pulls
* find labels without repository or org reference

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
guillep2k added a commit to guillep2k/gitea that referenced this pull request May 30, 2020
guillep2k added a commit that referenced this pull request May 30, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
needed to fix issue as described in go-gitea#10280

* rename check-db to check-db-version
* add check-db-consistency:
* find issues without existing repository
* find pulls without existing issues
* find tracked times without existing issues/pulls
* find labels without repository or org reference

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
@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
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! 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.

None yet

6 participants