Skip to content

Remove HasWiki method and use IsRepositoryExist #33912

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 8 commits into
base: main
Choose a base branch
from

Conversation

lunny
Copy link
Member

@lunny lunny commented Mar 16, 2025

No description provided.

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

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

I think it should stop here.

The design is wrong.

You can't make every function do "for repo" and "for wiki".

Since wiki is also a git repo, it should share the same repo interface as a code repo.

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 17, 2025
@wxiaoguang wxiaoguang dismissed their stale review March 27, 2025 07:33

dismiss

@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Mar 27, 2025
@lunny lunny changed the title Remove HasWiki method and use IsWikiRepositoryExist Remove HasWiki method and use IsRepositoryExist Mar 29, 2025
@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 Apr 9, 2025
@lunny
Copy link
Member Author

lunny commented Jun 18, 2025

last call @go-gitea/technical-oversight-committee

@wxiaoguang
Copy link
Contributor

Is it possible to have a better design to avoid filling the code base with a lot of if err != nil { return err }? This simple PR +119 −44, in the future there will be more if err != nil { return err } and does it make code more readable or maintainable?

@lunny
Copy link
Member Author

lunny commented Jun 19, 2025

Maybe we have two options. One is to store the presence of the wiki in the repo_unit table and retrieve the information from the database each time. The other is to creating a HasWiki function under services/wiki, handle the error internally within this function, and return the result accordingly.

@wxiaoguang
Copy link
Contributor

And I believe we should introduce a better error handling framework.

image

@wxiaoguang
Copy link
Contributor

For this PR, I do not see why Remove HasWiki method makes sense or brings benefit.

I do not see any feasible plan for the "git repo" related refactoring work.

@lunny
Copy link
Member Author

lunny commented Jun 19, 2025

For this PR, I do not see why Remove HasWiki method makes sense or brings benefit.

I do not see any feasible plan for the "git repo" related refactoring work.

This PR will try to make all other packages just depend on the relative path of the repository except gitrepo package. Now the absolute repository path will be used everywhere which will prevent abstract of repository storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. 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.

6 participants