gitea
gitea copied to clipboard
feat: api endpoints for projects
Fixes #14299
My earlier PR #20208 went too long and became messy, so I am closing that one and will be splitting the work in smaller chunks.
This PR includes all the endpoints for the Projects
- [x] POST /user/projects
- [x] POST /orgs/{org}/projects
- [x] POST /repos/{owner}/{repo}/projects
- [x] GET /user/projects
- [x] GET /orgs/{org}/projects
- [x] GET /repos/{owner}/{repo}/projects
- [x] GET /projects/{id}
- [x] PATCH /projects/{id}
- [x] DELETE /projects/{id}
For all the endpoints related to Boards I will be raising another PR for the same.
@dineshsalunke Is the PR still WIP or is it ready for review?
@denyskon this one is ready for review
looks good to me!
@dineshsalunke I see a lot of unrelated formatting changes, maybe originating from your editor formatter or similar. Could you revert them?
@denyskon I have fixed the golines formatting and pushed. as for the indentation I am not sure where it is coming from, since my editor is showing it correctly.
I will still check on it and get back
@dineshsalunke Thank you, however unfortunately some are still remaining in routers/api/v1/api.go
.....
Also, some methods seem to have broken when updating to main. Could you take a look please?
@dineshsalunke Could you invite me as collaborator to your fork? I'd fix the formatting and then review the PR....
@denyskon added you to my fork.
I tried everything from my end and every way I check the file the indentation looks ok, I am not sure if I am missing something or issue is on github's side, since this indentation issue seems to be coming only for certain files and those files seems to show up correctly every where I open the project
Every time I take a look at project permissions, I get confused more and more.... What happens if a user belongs to a team having write permissions to issues, but read permissions to projects? Need some more time to check.
@lunny @6543 You've been involved in reviewing the old PR. What do you think?
@denyskon the thing i wanted to discuss about which i mentioned in DM was in fact related to permissions. I am too stuck with permissions, and how it should be done for projects.
from my current understanding project and boards in nothing but, just grouping and organization of issues. since it's not a feature by in itself I am not sure if separate set of permissions for it is a valid choice.
also there are scenarios where projects and boards can be created per user, org and repo. permissions for repo and user seem to be pretty straightforward I think, the issue majorly comes for org projects.
Every time I take a look at project permissions, I get confused more and more.... What happens if a user belongs to a team having write permissions to issues, but read permissions to projects? Need some more time to check.
@lunny @6543 You've been involved in reviewing the old PR. What do you think?
I think we need a project scope.
If one can write issues, he can delete/edit issues/comments. If he has read permission of project, it can visit project columns UI. I don't think they are conflicted.
👍 will update the PR accordingly.
There's a large chance that I've overlooked it, but after a quick once-over of the file changes, I don't see a way to attach a ticket to a project over the API? Neither at creation, or thereafter.
I just ran into this today while I was working on some personal projects, which brought me here, so I thought I'd mention it just in case it was overlooked.
Thanks for all the great work! Love the project!