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

[Schema Inaccuracy] diff-entry returns null on commit SHA when the file permission was changed #4652

Open
jayjoshi64 opened this issue Mar 18, 2025 · 1 comment

Comments

@jayjoshi64
Copy link

jayjoshi64 commented Mar 18, 2025

Schema Inaccuracy

When checking the diff between 2 commits using diff-entry, if any commit contains a file with permission changes, the endpoint return None as files[].sha. which is unexpected according to the schema.

While None makes sense, the schema should be reflected to handle this scenario.

Example

{"url": "str",
 "html_url": "str",
 "permalink_url": "str",
 "diff_url": "str",
 "patch_url": "str",
 "base_commit": { . . . base commit details . . .},
 "merge_base_commit": {. . . merge base details },
 "status": "ahead",
 "ahead_by": 1,
 "behind_by": 0,
 "total_commits": 1,
 "commits": [. . . commit details ],
 "files": [
  {
    "sha": null,                    <--- Problem, schema mentions str 
    "filename": "test_file.py",
    "status": "modified",
    "additions": 0,                 <---- literal 0 
    "deletions": 0,                 <---- literal 0
    "changes": 0,                   <---- literal 0
    "blob_url": "str",
    "raw_url": "str",
    "contents_url": "str",
    "patch": "str"
   }
  ]
}

Reproduction Steps

  1. Create a commit containing only permission changes, nothing else.
  2. Try to get the commit using the diff-entry endpoint.
  3. Check that the files endpoint will have sha: None.
@bearcherian
Copy link
Contributor

@jayjoshi64 thanks for reporting this. I've assigned this internally to the team that owns this endpoint schema to update properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants