-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add migrations and doctor fixes #33556
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
Merged
lunny
merged 13 commits into
go-gitea:main
from
lunny:lunny/add_migration_and_doctor_fix_repo_runners
Mar 3, 2025
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ab21418
Add migrations and doctor fixes
lunny 889082e
Fix lint
lunny f81ec57
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
lunny 8e878f7
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
lunny 968f542
Merge branch 'lunny/add_migration_and_doctor_fix_repo_runners' of git…
lunny febad27
Fix bug
lunny 2443d8f
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
lunny 4bf5911
Fix the migration function name
lunny 5bd7b27
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
lunny 0f947d8
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
GiteaBot 45d9712
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
GiteaBot 4d7eb81
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
GiteaBot b028b91
Merge branch 'main' into lunny/add_migration_and_doctor_fix_repo_runners
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2024 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package v1_24 //nolint | ||
|
||
import ( | ||
"xorm.io/xorm" | ||
) | ||
|
||
func UpdateOwnerIDOfRepoLevelRunners(x *xorm.Engine) error { | ||
if _, err := x.Exec("UPDATE `action_runner` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0"); err != nil { | ||
return err | ||
} | ||
if _, err := x.Exec("UPDATE `action_runner` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0"); err != nil { | ||
return err | ||
} | ||
_, err := x.Exec("UPDATE `action_runner` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0") | ||
return err | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked up some code, could the fixer of "Action Runners without existing owner" cause data loss in a theoretical scenario as it's precondition repo_id is null is only ensured after the fixer "Repository level Runners with non-zero owner_id" ran.
This scenario idk if its possible would be
Anyways a complex scenario that came in my mind due to review comments of my artifact PR that the owner_id is not well maintained for artifact objects during repository move, if this did really ever happend just register a new runner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why we need to update
owner
as 0 for repository level runners to avoid similar scenario occupied. The doctor running should be at non working period.