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

Prohibit automatic downgrades #13108

Merged
merged 6 commits into from
Oct 12, 2020

Conversation

6543
Copy link
Member

@6543 6543 commented Oct 12, 2020

close #13107

@6543 6543 added this to the 1.13.0 milestone Oct 12, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Oct 12, 2020
@6543
Copy link
Member Author

6543 commented Oct 12, 2020

@lafriks added print to stderr too

while testing the backport ... I noticed it wont show up in the terminal - hope It's still fine

models/migrations/migrations.go Outdated Show resolved Hide resolved
@6543
Copy link
Member Author

6543 commented Oct 12, 2020

backport #13111

@6543 6543 added the backport/done All backports for this PR have been created label Oct 12, 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 Oct 12, 2020
@lunny
Copy link
Member

lunny commented Oct 12, 2020

Or we can add a flag or an environment to force downgrade, but not update the database manually.

@6543
Copy link
Member Author

6543 commented Oct 12, 2020

@lunny did had a quick look, a flag would be a nice optional enhancement, but we have to refactor some code then, so migration functions can have options then ...

// Migrate database to current version
func Migrate(x *xorm.Engine) error {

@codecov-io
Copy link

codecov-io commented Oct 12, 2020

Codecov Report

Merging #13108 into master will decrease coverage by 0.06%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13108      +/-   ##
==========================================
- Coverage   42.51%   42.45%   -0.07%     
==========================================
  Files         673      673              
  Lines       74116    74118       +2     
==========================================
- Hits        31512    31466      -46     
- Misses      37484    37551      +67     
+ Partials     5120     5101      -19     
Impacted Files Coverage Δ
models/migrations/migrations.go 2.44% <0.00%> (-0.02%) ⬇️
modules/notification/ui/ui.go 72.22% <0.00%> (-8.34%) ⬇️
models/issue_comment.go 47.62% <0.00%> (-6.13%) ⬇️
modules/notification/mail/mail.go 28.73% <0.00%> (-5.75%) ⬇️
modules/notification/base/null.go 68.57% <0.00%> (-2.86%) ⬇️
modules/notification/notification.go 78.57% <0.00%> (-2.68%) ⬇️
modules/log/event.go 59.90% <0.00%> (-1.89%) ⬇️
services/mailer/mail.go 54.83% <0.00%> (-1.08%) ⬇️
services/pull/pull.go 40.78% <0.00%> (-0.50%) ⬇️
models/error.go 35.36% <0.00%> (+0.50%) ⬆️
... and 6 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 c752cce...2564299. Read the comment docs.

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
@6543
Copy link
Member Author

6543 commented Oct 12, 2020

🚀

@zeripath zeripath merged commit 9513638 into go-gitea:master Oct 12, 2020
@zeripath zeripath deleted the forbit-automatic-downgrade branch October 12, 2020 14:36
lafriks pushed a commit that referenced this pull request Oct 12, 2020
* Prohibit automatic downgrades

* do not only log, print to stderr too

* Update models/migrations/migrations.go

* Update models/migrations/migrations.go

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>

* a nit

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
@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. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add DB-Schema-Version Check on Gitea start
7 participants