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

Set SemverCompatible to false for Conan packages (#21275) #21366

Merged
merged 3 commits into from
Oct 10, 2022

Conversation

KN4CK3R
Copy link
Member

@KN4CK3R KN4CK3R commented Oct 7, 2022

Backport of #21275

@wxiaoguang
Copy link
Contributor

Backported migration will break the new releases.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 7, 2022
@KN4CK3R
Copy link
Member Author

KN4CK3R commented Oct 7, 2022

You are right, how to handle that?

@wxiaoguang
Copy link
Contributor

No idea .... there was an old PR for backport migration (#10625) but no progress. I wasn't a member at that time.

@silverwind
Copy link
Member

silverwind commented Oct 7, 2022

So in essence, the migration system can not detect whether a certain migration, identified by a string, has already ran and skip it? I think the numbering scheme would have to be dropped to make it more smart then.

@wxiaoguang
Copy link
Contributor

So in essence, the migration system can not detect whether a certain migration, identified by a string, has already ran and skip it? I think the numbering scheme would have to be dropped to make it more smart then.

No at the moment. The Gitea's migration system is quite tricky and needs to be improved IMO.

For this backport, maybe the migration can be dropped, and tell users to run a SQL manually if they encounter the bug (very few), or provide temporary doctor command (although I prefer to avoid too many doctor commands).

@KN4CK3R
Copy link
Member Author

KN4CK3R commented Oct 7, 2022

So in essence, the migration system can not detect whether a certain migration, identified by a string, has already ran and skip it? I think the numbering scheme would have to be dropped to make it more smart then.

The migration could be run multiple times in this case but yes, the "index" 224 would be marked as "already run" and the real 224 from Gitea 1.18 would be skipped.

Fixes go-gitea#21250
Related go-gitea#20414

Conan packages don't have to follow SemVer.
The migration fixes the setting for all existing Conan and Generic
(go-gitea#20414) packages.
@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 Oct 7, 2022
@noerw
Copy link
Member

noerw commented Oct 7, 2022

Not a solution for this PR, but something to keep in mind for the 1.19 dev cycle:
Maybe the simplest change would be to reserve a couple (10?) migration IDs when starting a new major release, so there is room for migrations in point releases. This would still require that backported migrations are idempotent (as they potentially would be run twice), but at least the ambiguous-migration-ID-problem would be solved. I guess the question is how to best make these reservations a part of the new-release-cycle-process, so it doesn't slip when the first migration of the new cycle is added.

@silverwind
Copy link
Member

silverwind commented Oct 7, 2022

For future improvement to the migration system, I would suggest using a set of unique strings that identify migrations, ideally inserted into a separate table once ran. That way, all the number collision problems go away as well.

Thought generally I would expect the ORM to handle migrations transparently and in simple cases like column addition or type changes, automatically.

@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 10, 2022
@lunny lunny merged commit c83a05f into go-gitea:release/v1.17 Oct 10, 2022
@KN4CK3R KN4CK3R deleted the backport-30ca916 branch October 10, 2022 13:11
tyroneyeh pushed a commit to tyroneyeh/gitea that referenced this pull request Oct 24, 2022
@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/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/packages type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants