Skip to content

Move modules/forms to services/forms #15305

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 4 commits into from
Apr 6, 2021

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Apr 6, 2021

Forms are dependent on models and therefore should be in services.

This PR also removes the old auth. aliasing

Signed-off-by: Andrew Thornton [email protected]

Forms are dependent on models and therefore should be in services.

This PR also removes the old auth. aliasing

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Apr 6, 2021
@zeripath zeripath added this to the 1.15.0 milestone Apr 6, 2021
@6543
Copy link
Member

6543 commented Apr 6, 2021

I'm not sure if service is the right place modules sounds right ...
https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md#design-guideline

In my opinion removes the old auth. aliasingis the final refactor finish ...

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 6, 2021
@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 6, 2021
@zeripath
Copy link
Contributor Author

zeripath commented Apr 6, 2021

@6543 modules are not supposed to use models.

services: Support functions for common routing operations. Uses models and modules to handle the request.
  • they depend on http
  • these are web forms.
  • the only places that use forms are routers and integrations:
find -name *.go | xargs grep modules/form                                                  [15:06:30]
./routers/routes/web.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/routes/install.go:	"code.gitea.io/gitea/modules/forms"
./routers/repo/branch.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/release.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/milestone.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/issue_timetrack.go:	"code.gitea.io/gitea/modules/forms"
./routers/repo/issue.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/projects.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/repo.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/pull_review.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/release_test.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/webhook.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/pull.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/issue_label_test.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/setting.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/wiki_test.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/issue_lock.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/editor.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/migrate.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/issue_label.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/settings_test.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/setting_protected_branch.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/repo/wiki.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/install.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/auth.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/oauth.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/oauth2.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/account.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/account_test.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/applications.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/security_twofa.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/security_openid.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/keys.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/profile.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/setting/security_u2f.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/user/auth_openid.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/api/v1/repo/pull.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/api/v1/repo/migrate.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/api/v1/api.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/api/v1/swagger/options.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/admin/users_test.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/admin/auths.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/admin/users.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/admin/admin.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/org/org.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/org/setting.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/org/teams.go:	auth "code.gitea.io/gitea/modules/forms"
./routers/org/org_labels.go:	auth "code.gitea.io/gitea/modules/forms"
./integrations/api_helper_for_declarative_test.go:	auth "code.gitea.io/gitea/modules/forms"
./integrations/api_pull_test.go:	auth "code.gitea.io/gitea/modules/forms"
  • modules are not supposed to use models - this uses models

They definitely fit the service spec.

@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 Apr 6, 2021
@zeripath
Copy link
Contributor Author

zeripath commented Apr 6, 2021

make lgtm work

@zeripath zeripath merged commit fa3895c into go-gitea:master Apr 6, 2021
@zeripath zeripath deleted the finish-off-forms-refactor branch April 6, 2021 19:44
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
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