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

Fix type of commit for create_file #2120

Closed
wants to merge 1 commit into from
Closed

Fix type of commit for create_file #2120

wants to merge 1 commit into from

Commits on Jun 1, 2023

  1. Fix type of commit for create_file

    The `commit` key of `create_file`'s result currently uses
    `github.Commit.Commit`, but that does not match the data model of the
    endpoint: while ill documented on docs.github.com, looking at the
    published schema (via https://github.com/github/rest-api-description
    or more readably https://github.com/octokit/types.ts which is
    automatically generated from the former) `file-commit.commit` looks
    significantly more like a `git-commit` than a `commit`:
    
    * `commit`'s author and committer are git*hub* objects
      (`nullable-simple-user`), while `file-commit.commit`'s are git
      objects (triplets of name, email, and date)
    * `commit` embeds the tree, and message in a sub-object, while
      `file-commit.commit` has them at the toplevel
    * `file-commit.commit` has no `stats` or `files` properties, or
      `comments_url`
    
    In all of these, `file-commit.commit` matches `git-commit` exactly.
    
    The only real divergence between `git-commit` and `file-commit.commit`
    is that the schema indicates all of `file-commit.commit`'s properties
    are optional, but I think it's a case of the endpoint being
    under-specified and the properties *not* being marked required, rather
    than them being explicitly optional. See
    github/rest-api-description#650 for an issue
    on that subject with more information.
    xmo-odoo committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    405e668 View commit details
    Browse the repository at this point in the history