gitea icon indicating copy to clipboard operation
gitea copied to clipboard

feat: api endpoints for projects

Open dineshsalunke opened this issue 1 year ago • 17 comments

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 avatar Nov 18 '23 13:11 dineshsalunke

@dineshsalunke Is the PR still WIP or is it ready for review?

denyskon avatar Nov 18 '23 13:11 denyskon

@denyskon this one is ready for review

dineshsalunke avatar Nov 18 '23 15:11 dineshsalunke

looks good to me!

GamerGirlandCo avatar Jan 12 '24 03:01 GamerGirlandCo

@dineshsalunke I see a lot of unrelated formatting changes, maybe originating from your editor formatter or similar. Could you revert them?

denyskon avatar Jan 15 '24 20:01 denyskon

@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 avatar Jan 16 '24 15:01 dineshsalunke

@dineshsalunke Thank you, however unfortunately some are still remaining in routers/api/v1/api.go.....

denyskon avatar Jan 16 '24 20:01 denyskon

Also, some methods seem to have broken when updating to main. Could you take a look please?

denyskon avatar Jan 16 '24 20:01 denyskon

@dineshsalunke Could you invite me as collaborator to your fork? I'd fix the formatting and then review the PR....

denyskon avatar Jan 20 '24 09:01 denyskon

@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 image

dineshsalunke avatar Jan 21 '24 04:01 dineshsalunke

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 avatar Jan 25 '24 20:01 denyskon

@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.

dineshsalunke avatar Jan 26 '24 04:01 dineshsalunke

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.

lunny avatar Feb 06 '24 01:02 lunny

👍 will update the PR accordingly.

dineshsalunke avatar Feb 06 '24 01:02 dineshsalunke

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!

xhorntail avatar Mar 30 '24 07:03 xhorntail