Coder Social home page Coder Social logo

Improve Commits API about octocrab HOT 7 OPEN

cloud303-cholden avatar cloud303-cholden commented on August 22, 2024 1
Improve Commits API

from octocrab.

Comments (7)

XAMPPRocky avatar XAMPPRocky commented on August 22, 2024

Thank you for your issue! Yes adding that API would be appreciated. As for where it should go, I would look up the octokit JS API and see where they put it

from octocrab.

cloud303-cholden avatar cloud303-cholden commented on August 22, 2024

Understood! I'll fork the repo and get started on it.

from octocrab.

cloud303-cholden avatar cloud303-cholden commented on August 22, 2024

It looks like getCommit is under the repos API (link), similar to listCommits. I'm curious whether you prefer using repos or commits, because it looks like createCommitComment is also under repos (link), whereas your crate has it under commits at octocrab::commits::CommitHandler::create_comment. The GitHub docs suggest that the /commits endpoints are distinct from /repos, but they all ultimately fall under the/repos endpoint. If we put this API under repos, I'm guessing this would require a new GetRepoCommit model, since the response spec is different than the RepoCommit one.

from octocrab.

XAMPPRocky avatar XAMPPRocky commented on August 22, 2024

Ah yeah, I think it should go under commits, ultimately it’s very similar to repos because it does require you to specify a repo.

from octocrab.

JeanMertz avatar JeanMertz commented on August 22, 2024

So, I spent a few hours yesterday figuring out why the additions and deletions fields weren't populated. I used the PullRequestHandler::list method.

Reading this issue, am I correct that some (all?) of the optional fields in PullRequest are only populated when you do a call to fetch the information for that individual Pull Request?

That's good to know. Is this documented somewhere, and I just missed that detail?

from octocrab.

JeanMertz avatar JeanMertz commented on August 22, 2024

I just verified that this is indeed the case using:

gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/pulls/PULL_NUMBER

Without PULL_NUMBER, many details are missing from the listed pull requests.

from octocrab.

XAMPPRocky avatar XAMPPRocky commented on August 22, 2024

That's good to know. Is this documented somewhere, and I just missed that detail?

I don't know if it's documented anywhere in the GitHub API, but we should probably add a note to the list method stating it.

from octocrab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.