Skip to content

Add backport migration support #23511

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

Closed
wants to merge 2 commits into from

Conversation

yp05327
Copy link
Contributor

@yp05327 yp05327 commented Mar 16, 2023

Changes:
Use BackportVersion table to store migrated versions in newer versions.
When users upgrade gitea version, we can skip the migrations recorded in BackportVersion table.

I have no idea about testing now.
So it may have bugs now.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 16, 2023

That's really a difficult part in Gitea. 👍

There are also some related issues/PRs, not sure whether they would help or not.

Do you have a design document for how to use this Backport Migration mechanism (for various different cases)?


Update: quote from lunny in #23078:

Assume users are in v1.19.3 which will add a new column, but for v1.20.0 has no migration for this column but v1.20.3 has, when user upgrade from v1.19.3 to v1.20.0 not v1.20.3, it will encounter problems.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 16, 2023
@yp05327
Copy link
Contributor Author

yp05327 commented Mar 16, 2023

Update: quote from lunny in #23078:

Assume users are in v1.19.3 which will add a new column, but for v1.20.0 has no migration for this column but v1.20.3 has, when user upgrade from v1.19.3 to v1.20.0 not v1.20.3, it will encounter problems.

I didn't notice this problem.
But it is hard to handle this, as we have no restore processes.
So add restore processes or forcibly upgrade to 1.20.3?

@wxiaoguang
Copy link
Contributor

I guess we have similar idea #23078 (comment) and #23078 (comment)

I am not working on this problem, so at the moment I can't help much. I guess it would be better to have a design document first before coding, because this problem is more complex than it looks.

@yp05327 yp05327 marked this pull request as draft March 16, 2023 08:00
@yp05327
Copy link
Contributor Author

yp05327 commented Mar 16, 2023

I'm fixing org/user projects bugs, and there are some db migration in the fix.
If we only backport the code but not backport migrations, it will cause new bugs in old version.
Fix bugs and bring new bugs (=no fixes) :(
So I think we need to fix this problem ASAP.
You are right. We need to discuss the design first.

@yp05327 yp05327 closed this Mar 16, 2023
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants