Skip to content

Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6#17136

Merged
zeripath merged 9 commits into
go-gitea:mainfrom
zeripath:fix-16961-add-doctor
Sep 27, 2021
Merged

Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6#17136
zeripath merged 9 commits into
go-gitea:mainfrom
zeripath:fix-16961-add-doctor

Conversation

@zeripath
Copy link
Copy Markdown
Contributor

@zeripath zeripath commented Sep 23, 2021

There was a serious issue with the gitea dump command in 1.14.3-1.14.6 which led to corruption of the config field of the repo_unit table.

This PR adds a doctor command to attempt to fix the broken repo_units. Users affected by #16961 should run:

gitea doctor --fix --run fix-broken-repo-units

Fix #16961
Fix #17297

Signed-off-by: Andrew Thornton art27@cantab.net

Unfortunately a number of people appear to have been bitten by the bug in the dump
command.

This PR adds a doctor command to attempt to fix the broken repo_units

Fix go-gitea#16961

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added type/bug pr/wip This PR is not ready for review backport/v1.15 labels Sep 23, 2021
@zeripath zeripath added this to the 1.16.0 milestone Sep 23, 2021
@zeripath zeripath changed the title Add repounit fixer for #16961 WIP Add repounit fixer for #16961 Sep 23, 2021
zeripath added a commit to zeripath/gitea that referenced this pull request Sep 23, 2021
Backport go-gitea#17136

Unfortunately a number of people appear to have been bitten by the bug in the dump
command.

This PR adds a doctor command to attempt to fix the broken repo_units

Fix go-gitea#16961

Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath changed the title WIP Add repounit fixer for #16961 Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 Sep 27, 2021
@zeripath zeripath added the release/highlight Marks a PR as a highlight-worthy change for the release notes. label Sep 27, 2021
Signed-off-by: Andrew Thornton <art27@cantab.net>
@techknowlogick techknowlogick removed the pr/wip This PR is not ready for review label Sep 27, 2021
Comment thread modules/doctor/fix16961.go Outdated
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 27, 2021
Comment thread modules/doctor/fix16961_test.go Outdated
@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 27, 2021
@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 27, 2021
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (main@868e937). Click here to learn what that means.
The diff coverage is 37.91%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #17136   +/-   ##
=======================================
  Coverage        ?   45.27%           
=======================================
  Files           ?      775           
  Lines           ?    87223           
  Branches        ?        0           
=======================================
  Hits            ?    39492           
  Misses          ?    41324           
  Partials        ?     6407           
Impacted Files Coverage Δ
models/helper.go 52.94% <0.00%> (ø)
models/repo_unit.go 84.52% <0.00%> (ø)
modules/doctor/fix16961.go 38.76% <38.76%> (ø)

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 868e937...33cb30b. Read the comment docs.

@zeripath
Copy link
Copy Markdown
Contributor Author

make lgtm work

@zeripath zeripath merged commit b5856c4 into go-gitea:main Sep 27, 2021
@zeripath zeripath deleted the fix-16961-add-doctor branch September 27, 2021 15:55
@zeripath zeripath added the backport/done All backports for this PR have been created label Sep 27, 2021
zeripath added a commit that referenced this pull request Sep 27, 2021
….14.6 (#17136) (#17137)

Backport #17136

There was a serious issue with the `gitea dump` command in 1.14.3-1.14.6 which led to corruption of the `config` field of the `repo_unit` table. 

This PR adds a doctor command to attempt to fix the broken repo_units. Users affected by #16961 should run:

```
gitea doctor --fix --run fix-broken-repo-units
```

Fix #16961

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
@delvh delvh removed the release/highlight Marks a PR as a highlight-worthy change for the release notes. label Oct 7, 2023
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. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

500 error on organization page: error calling DescriptionHTML Unable to access repos after going from 1.15.0 => 1.15.2

6 participants