Skip to content

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

Conversation

lunny
Copy link
Member

@lunny lunny commented Feb 11, 2025

Fix #33535

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 11, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/migrations labels Feb 11, 2025
@wolfogre
Copy link
Member

wolfogre commented Feb 11, 2025

No, runners don't have this issue. I was talking about secrets.

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.

@lunny lunny marked this pull request as ready for review February 17, 2025 05:12
@lunny
Copy link
Member Author

lunny commented Feb 17, 2025

It's ready to review.

@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 Feb 17, 2025
@lunny lunny added this to the 1.24.0 milestone Feb 17, 2025
@lunny lunny requested a review from wxiaoguang February 20, 2025 21:05
Copy link
Contributor

@ChristopherHX ChristopherHX left a 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

Comment on lines +168 to +173
{
Name: "Repository level Runners with non-zero owner_id",
Counter: actions_model.CountWrongRepoLevelRunners,
Fixer: actions_model.UpdateWrongRepoLevelRunners,
FixedMessage: "Corrected",
},
Copy link
Contributor

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

Copy link
Member Author

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.

@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 Feb 28, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 1, 2025
@lunny lunny merged commit dbed39d into go-gitea:main Mar 3, 2025
26 checks passed
@lunny lunny deleted the lunny/add_migration_and_doctor_fix_repo_runners branch March 3, 2025 05:01
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 3, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 3, 2025
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/migrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After upgrading Gitea to the latest version, the actions secrets are lost
6 participants