Skip to content

Move RepoTransfer from models to models/repo sub package#32506

Merged
lunny merged 21 commits into
go-gitea:mainfrom
lunny:lunny/repo_dep_org
Dec 18, 2024
Merged

Move RepoTransfer from models to models/repo sub package#32506
lunny merged 21 commits into
go-gitea:mainfrom
lunny:lunny/repo_dep_org

Conversation

@lunny

@lunny lunny commented Nov 14, 2024

Copy link
Copy Markdown
Member

RepoTransfer now is at models, but if we want to move it into repo model, it will depend on Team. So this PR also makes repo model depend on org model to make it possible. Just refactor, no code change.

  • Move DeleteOrganization from models/organization to service layer
  • Move AccessibleTeamReposEnv to models/repo
  • Move RepoTransfer from models to models/repo
  • Merge getUserTeamIDs and GetUserTeamIDs, Merge GetUserTeams and getUserTeams.
  • Remove Team's Repos []*repo_model.Repository to avoid dependency recycle.

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Nov 14, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 14, 2024
@wxiaoguang

Copy link
Copy Markdown
Contributor

Why? What's the benefit?

@lunny

lunny commented Nov 14, 2024

Copy link
Copy Markdown
Member Author

Why? What's the benefit?

I updated the description to explain the reason.

@wxiaoguang

Copy link
Copy Markdown
Contributor

Why not totally decouple the repo & org models? Just use them from service packages?

@lunny

lunny commented Nov 16, 2024

Copy link
Copy Markdown
Member Author

Why not totally decouple the repo & org models? Just use them from service packages?

RepoTransfer now is at models, but if we want to move it into repo model, it will depend on Team, this is another reason why we need this change.
And we cannot move RepoTransfer to service layer.

Included moving RepoTransfer to models/repo sub package.

@lunny lunny changed the title Make repo model depends on org model but not opposite Move RepoTransfer from models to models/repo sub package Nov 17, 2024
Comment thread services/repository/create_test.go Outdated
Comment thread services/org/team.go Outdated
@GiteaBot GiteaBot removed the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 3, 2024
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 3, 2024
@yp05327 yp05327 self-requested a review December 4, 2024 04:46
@lunny

lunny commented Dec 17, 2024

Copy link
Copy Markdown
Member Author

Last call for another review @go-gitea/technical-oversight-committee

@delvh delvh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's hope there aren't too many places relying on teams having potentially been loaded already (in terms of performance)

@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 Dec 17, 2024
@lunny lunny added this to the 1.24.0 milestone Dec 17, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 17, 2024
@lunny lunny merged commit e4c4629 into go-gitea:main Dec 18, 2024
@lunny lunny deleted the lunny/repo_dep_org branch December 18, 2024 03:44
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 18, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Mar 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. 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.

5 participants