Skip to content

Only git operations should update last changed of a repository #34388

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
merged 5 commits into from
May 11, 2025

Conversation

lunny
Copy link
Member

@lunny lunny commented May 7, 2025

Try to fix #32046

@lunny lunny added type/bug backport/v1.23 This PR should be backported to Gitea 1.23 backport/v1.24 This PR should be backported to Gitea 1.24 labels May 7, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 7, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label May 7, 2025
@silverwind
Copy link
Member

I agree we should match Github behaviour and only update timestamp when git content changes. It's the most straightforward way to view this timestamp.

@silverwind
Copy link
Member

silverwind commented May 8, 2025

Question is thought, shouldn't we make UpdateRepositoryCols default to not writing that timestamp and we could remove UpdateRepositoryColsNoAutoTime? If separate function is needed, I recommend naming it UpdateRepositoryColsWithAutoTime to indicate that auto-time behaviour is being opted in.

Also, as seen by the diff, there are a few places that don't use UpdateRepositoryCols, can we make them use it?

@delvh delvh changed the title Only git operations should update the updated_unix column in repository table Only git operations should update last changed of a repository May 9, 2025
@delvh
Copy link
Member

delvh commented May 9, 2025

Agreed.
The amount of times the timestamp should be updated is much lower than the amount of time it shouldn't.

@lunny lunny force-pushed the lunny/dont_update_repo_time branch from 925abb9 to 967f20c Compare May 9, 2025 23:16
@lunny
Copy link
Member Author

lunny commented May 9, 2025

967f20c renamed UpdateRepositoryCols to UpdateRepositoryColsWithAutoTime.

@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 May 10, 2025
@lunny lunny requested a review from delvh May 10, 2025 18:52
@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 May 10, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 11, 2025
@lunny lunny enabled auto-merge (squash) May 11, 2025 18:35
@lunny lunny merged commit 780e92e into go-gitea:main May 11, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.25.0 milestone May 11, 2025
@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label May 11, 2025
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 11, 2025
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request May 11, 2025
@lunny lunny deleted the lunny/dont_update_repo_time branch May 11, 2025 19:33
@lunny lunny added backport/done All backports for this PR have been created and removed backport/v1.23 This PR should be backported to Gitea 1.23 backport/manual No power to the bots! Create your backport yourself! labels May 11, 2025
@go-gitea go-gitea deleted a comment from GiteaBot May 11, 2025
silverwind pushed a commit that referenced this pull request May 11, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 12, 2025
* giteaofficial/main:
  Add a webhook push test for dev branch (go-gitea#34421)
  [skip ci] Updated translations via Crowdin
  Fix bug webhook milestone is not right. (go-gitea#34419)
  Only git operations should update `last changed` of a repository (go-gitea#34388)
  When updating comment, if the content is the same, just return and not update the databse (go-gitea#34422)
  Remove legacy template helper functions (go-gitea#34426)
  Fix GetUsersByEmails (go-gitea#34423)
  [skip ci] Updated translations via Crowdin
  Fix a bug when uploading file via lfs ssh command (go-gitea#34408)
  Merge and tweak markup editor expander CSS (go-gitea#34409)
  Bump `@github/relative-time-element` to v4.4.8 (go-gitea#34413)
  Refactor commit message rendering and fix bugs (go-gitea#34412)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.24 This PR should be backported to Gitea 1.24 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 type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unclear repository update time: some inactive or archived repositories may get a recent "update time"
4 participants