-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Add migrations and doctor fixes #33556
Conversation
Hmm, I said "runners don't have this issue" because the code is compatible with old data for runners, while it's not compatible for secrets due to security reasons. But I think it's a good idea to fix them all in database. Please go on, you are right. |
It's ready to review. |
…hub.com:lunny/gitea into lunny/add_migration_and_doctor_fix_repo_runners
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.
Otherwise looks good to me
{ | ||
Name: "Repository level Runners with non-zero owner_id", | ||
Counter: actions_model.CountWrongRepoLevelRunners, | ||
Fixer: actions_model.UpdateWrongRepoLevelRunners, | ||
FixedMessage: "Corrected", | ||
}, |
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
- Defect in database CountWrongRepoLevelRunners > 1
- Owner moved repo to org
- Original owner deleted
- CountRunnersWithoutBelongingOwner > 1 (just a guess if I understand right)
- gitea doctor is ran
- UpdateWrongRepoLevelRunners deletes runner before the runner is fixed in the database
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.
* giteaofficial/main: Disable `vet` as part of `go test` (go-gitea#33662) Refactor error system (go-gitea#33771) Add migrations and doctor fixes (go-gitea#33556) Refactor mail code (go-gitea#33768) Refactor global init code and add more comments (go-gitea#33755)
Fix #33535