Skip to content
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

New pushed branches show up after migration #26239

Closed
yardenshoham opened this issue Jul 30, 2023 · 8 comments
Closed

New pushed branches show up after migration #26239

yardenshoham opened this issue Jul 30, 2023 · 8 comments
Assignees
Labels

Comments

@yardenshoham
Copy link
Member

Description

image

Gitea Version

4244ce0 (current main)

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Gitpod

Database

SQLite

@lunny
Copy link
Member

lunny commented Jul 31, 2023

So, pull mirrors and migrated repositories should not prompt the branches pushed.

@Zettat123 Zettat123 self-assigned this Jul 31, 2023
@lunny
Copy link
Member

lunny commented Jul 31, 2023

For migrated repositories, it's difficult to say the prompt is wrong.

@cassiozareck
Copy link
Contributor

May the error lies in the fact unix times aren't being preserved at the database?

This is the exact time the migration was made, not the original time the push was made at the original repo. So perhaps this is why FindRecentlyPushedNewBranches is considerating it

@Zettat123
Copy link
Contributor

In my opinion,

  • for mirror repos, we should not show the prompt
  • for the repos with pull request units disabled, we should not show the prompt
  • for migrated repositories, I think we can keep the prompt as it might be useful sometimes

@yardenshoham
Copy link
Member Author

Agree with the first 2.

In migrated repositories, don't show it until the first commit after the migration

@Zettat123
Copy link
Contributor

May the error lies in the fact unix times aren't being preserved at the database?

This is the exact time the migration was made, not the original time the push was made at the original repo. So perhaps this is why `FindRecentlyPushedNewBranches` is considerating it

Yes, the created_unix is the time when create the record. Maybe we should check commit_time in FindRecentlyPushedNewBranches

@lunny
Copy link
Member

lunny commented Jul 31, 2023

May the error lies in the fact unix times aren't being preserved at the database?

This is the exact time the migration was made, not the original time the push was made at the original repo. So perhaps this is why FindRecentlyPushedNewBranches is considerating it

Yes, the created_unix is the time when create the record. Maybe we should check commit_time in FindRecentlyPushedNewBranches

Yes, we should use commit_time really.

@Zettat123
Copy link
Contributor

In my opinion,

  • for mirror repos, we should not show the prompt
  • for the repos with pull request units disabled, we should not show the prompt
  • for migrated repositories, I think we can keep the prompt as it might be useful sometimes

By using commit_time, only prompts of newly pushed branches will be displayed for migrated repos. I think it could help solve this issue.

lunny pushed a commit that referenced this issue Aug 1, 2023
Related to #26239

This PR makes some fixes:
- do not show the prompt for mirror repos and repos with pull request
units disabled
- use `commit_time` instead of `updated_unix`, as `commit_time` is the
real time when the branch was pushed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants