Skip to content
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

Add projects Api #447

Merged

Conversation

gabrielecodes
Copy link
Contributor

@gabrielecodes gabrielecodes commented Aug 21, 2023

Proposing this PR for issue #417.

The PR provides an interface for these endpoints for the REST api:

Org Projects

  • projects: GET /orgs/{org}/projects
  • projects: POST /orgs/{org}/projects

Projects

  • projects: GET /projects/{project_id}
  • projects: PATCH /projects/{project_id}
  • projects: DELETE /projects/{project_id}
  • projects: GET /repos/{owner}/{repo}/projects
  • projects: POST /repos/{owner}/{repo}/projects

User Projects

  • projects: POST /user/projects
  • projects: GET /users/{username}/projects

I tried to follow the same style of other modules in this repo in terms of function naming and inputs. Github's project api is a bit heterogeneous when it comes to required parameters & uri parameters so functions in api/project.rs are a bit different from each other but I tried to keep things ergonomic. Hopefully I'm in the ballpark.

Note: I added tests based on the "mock" serve (see "test" folder). I don't have an organization or "classical" (old style) project so I can't fully test the api. I'll open the PR as draft for now.

@gabrielecodes gabrielecodes marked this pull request as ready for review August 22, 2023 11:35
@XAMPPRocky
Copy link
Owner

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit c621a09 into XAMPPRocky:main Aug 24, 2023
10 checks passed
@github-actions github-actions bot mentioned this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants