Skip to content

Use standalone function to update repository cols #34811

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lunny
Copy link
Member

@lunny lunny commented Jun 21, 2025

Extract UpdateRepository
Follow up #34762

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Jun 21, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 21, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jun 21, 2025
@wxiaoguang
Copy link
Contributor

admin sync_repo_branches will update all repo last_update_time even repo no change #34831

@lunny
Copy link
Member Author

lunny commented Jun 24, 2025

admin sync_repo_branches will update all repo last_update_time even repo no change #34831

27f484e

@lunny lunny added the backport/v1.24 This PR should be backported to Gitea 1.24 label Jun 24, 2025
@lunny lunny requested a review from wxiaoguang June 25, 2025 03:08
}

func UpdateRepositoryHealthCheck(ctx context.Context, repo *repo_model.Repository, healthCheckEnabled bool) (err error) {
return db.WithTx(ctx, func(ctx context.Context) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why transaction for a single SQL?

@wxiaoguang
Copy link
Contributor

And why so many inconsistencies.

  • Why UpdateRepositoryColsXxxAutoTime ignores empty "cols", but other UpdateXxx treats empty Cols as default.
  • Why UpdateRepositoryHealthCheck and UpdateRepositoryTrustModel have their own functions but ObjectFormat doesn't

Why .......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants