Skip to content

Inconsistency in bindings location and modules content. Wiki/Issue tracker handling. #4288

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
5 of 7 tasks
tarelda opened this issue Jun 21, 2018 · 1 comment
Open
5 of 7 tasks
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/refactoring Existing code has been cleaned up. There should be no new functionality.

Comments

@tarelda
Copy link
Contributor

tarelda commented Jun 21, 2018

  • Gitea version (or commit ref): master
  • Git version: Not relevant
  • Operating system: Not relevant
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: Not relevant

Description

First some background. Recently, I had to migrate my old gitlab instance to something newer and chose gitea instead of newer gitlabs (honestly I just want my 16GB of RAM back). I used python to write migration script that was even able to extract and compact snippets. Unfortunately something I couldn't get around was handling wikis. I need them to be imported too, but there is no API endpoints for it (tried method with directly making requests to ui but was too inconsistent in behaviour). Then I stumbled upon #488 and mad me realize that the best way to do it is just patch API and my journey begun...

Thoughts concerning code

After a few hours spend walking through code I noticed two things that bothered me:

  1. Bindings are located as well as in built-in auth module as in separate api module (I can't justify why it is separated).
  2. Auth module contains quite a lot of forms that are not related to authorization.

My solutions:
Alternative 1. Move out of auth and api module all of the bindings into separate package named bindings.
Alternative 2. Essentially alternative 1, but auth related bindings and forms keep in the module.
Alternative 3. Create package forms and move all of the non-auth related forms there. Refactor API routers to use built-in api module which has bindings and handlers embedded.

Wiki/Issue tracker API situation

First of all, my main issue was with the fact that I needed to create page to have local wiki initialised. My proposition is that local wiki repo should be initialized when feature is enabled and deleted if disabled?
Secondly, where exactly handle Wiki/Issue tracker? My first idea was to just add PATCH request for /repos/{user|org}/{repo}, which is more compatible with github API.
But I find more appealing and CRUD friendly, creating two new endpoints /repos/{user|org}/{repo}/wiki , /repos/{user|org}/{repo}/issuetracker with appropriate set of handlers for methods GET and PATCH.
GET method would be used to determine which type of unit is enabled and PATCH to switch inbetween them.

Bottomline

I don't want waste my time working a code that won't be accepted by maintainers or community. So tell me what are your thoughts?

@tarelda tarelda changed the title Inconsistency in bindings location and modules content. Local wiki handling. Inconsistency in bindings location and modules content. Wiki/Issue tracker handling. Jun 21, 2018
@lunny lunny added the backport/done All backports for this PR have been created label Jun 21, 2018
@lafriks lafriks added type/refactoring Existing code has been cleaned up. There should be no new functionality. and removed backport/done All backports for this PR have been created labels Jun 21, 2018
@stale
Copy link

stale bot commented Jan 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 22, 2019
@lunny lunny added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed issue/stale labels Feb 7, 2019
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this issue Jan 23, 2025
…ions instead of failing' (go-gitea#4288) from bp-v8.0/forgejo-5561e80 into v8.0/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4288
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants