Skip to content

feat: api endpoints for projects #28111

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

Conversation

dineshsalunke
Copy link

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

  • POST /user/projects
  • POST /orgs/{org}/projects
  • POST /repos/{owner}/{repo}/projects
  • GET /user/projects
  • GET /orgs/{org}/projects
  • GET /repos/{owner}/{repo}/projects
  • GET /projects/{id}
  • PATCH /projects/{id}
  • DELETE /projects/{id}

For all the endpoints related to Boards I will be raising another PR for the same.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 18, 2023
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Nov 18, 2023
@denyskon
Copy link
Member

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

@dineshsalunke
Copy link
Author

@denyskon this one is ready for review

@GamerGirlandCo
Copy link

looks good to me!

@lunny lunny added this to the 1.22.0 milestone Jan 12, 2024
@denyskon denyskon added the giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main label Jan 15, 2024
@GiteaBot GiteaBot removed the giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main label Jan 15, 2024
@denyskon
Copy link
Member

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

@dineshsalunke
Copy link
Author

@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

@denyskon
Copy link
Member

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

@denyskon
Copy link
Member

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

@lunny
Copy link
Member

lunny commented Sep 13, 2024

If you don't mind, I think maintainers can help update the pull request.

Closed: project.ClosedDateUnix.AsTime(),
}

_ = project.LoadRepo(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

The return error should be handled.

@dineshsalunke
Copy link
Author

@lunny I noticed that the board related models have been renamed to Column and Template, so do we wanna update all the properties in the payloads and responses accordingly ?

If we change them wouldn't that be a breaking change

@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Sep 22, 2024
@lunny
Copy link
Member

lunny commented Sep 22, 2024

@lunny I noticed that the board related models have been renamed to Column and Template, so do we wanna update all the properties in the payloads and responses accordingly ?

If we change them wouldn't that be a breaking change

At the moment, I prefer to change the names as more as possible but keeping compatible. You can find I didn't change the table name and some places in my original PR.

// required:true
Title string `json:"title" binding:"Required"`
// required:true
BoardType uint8 `json:"board_type"`
Copy link
Member

Choose a reason for hiding this comment

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

TemplateType to align with other places?

m.Combo("/{id}").Get(projects.GetProject).
Patch(bind(api.UpdateProjectPayload{}), projects.UpdateProject).
Delete(projects.DeleteProject)
}, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryIssue), reqToken())
Copy link
Member

Choose a reason for hiding this comment

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

I think we need a new token scope AccessTokenScopeCategoryProject.

@lunny lunny modified the milestones: 1.23.0, 1.24.0 Oct 12, 2024
@lunny lunny modified the milestones: 1.24.0, 1.25.0 Apr 11, 2025
@denyskon
Copy link
Member

@dineshsalunke I would like to review this PR for 1.25. Could you update it (and the boards pr too) to be in sync with main?

@dineshsalunke
Copy link
Author

@denyskon Surely I will update the PR

@dineshsalunke
Copy link
Author

@denyskon I have pushed some changes for now, which only include the POST methods the test's are passing for them.

Work on PR was slow due to the fact that I didn't had a clear way to handle permissions for /org and /repos routes.

I will look into the permissions thing now for all the POST methods and will push those changes first if the approach looks good to others then I will move with implementing rest of the routes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code topic/projects type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] API for projects
8 participants