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: diff-entry's blob_url and raw_url may be null #134

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

fau-st
Copy link
Contributor

@fau-st fau-st commented Sep 20, 2024

When using compare_commits, a diff-entry listed in the files property might have blob_url and raw_url set to null

I encountered this issue when comparing commits that made a change to a submodule. It might be the only case where those two properties may be null.

Repro

gh.rest.repos.compare_commits(
    'jqlang',
    'jq',
    '481167c8f186d534b2cef0e8a7d6a4d6dbc45d6b...092fef740a0d1a0ddf61cf9e7af88915071c0705',
).parsed_data

⬇️

pydantic_core._pydantic_core.ValidationError: 3 validation errors for CommitComparison
files.literal[<UNSET>]
  Input should be <UNSET> [type=literal_error, input_value=[{'sha': 'cca857c64d3d678... --leak-check=full \\'}], input_type=list]
    For further information visit https://errors.pydantic.dev/2.8/v/literal_error
files.list[DiffEntry].2.blob_url
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.8/v/string_type
files.list[DiffEntry].2.raw_url
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.8/v/string_type

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 17.82%. Comparing base (1ab40e3) to head (991dccc).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...kit/versions/ghec_v2022_11_28/models/group_0213.py 0.00% 3 Missing ⚠️
...bkit/versions/ghec_v2022_11_28/types/group_0213.py 0.00% 3 Missing ⚠️
...ithubkit/versions/v2022_11_28/models/group_0190.py 0.00% 3 Missing ⚠️
githubkit/versions/v2022_11_28/types/group_0190.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #134   +/-   ##
=======================================
  Coverage   17.82%   17.82%           
=======================================
  Files        4834     4834           
  Lines      223387   223387           
=======================================
  Hits        39815    39815           
  Misses     183572   183572           
Flag Coverage Δ
unittests 17.82% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yanyongyu yanyongyu added bug Something isn't working schema schema related Rest API labels Sep 20, 2024
@yanyongyu yanyongyu merged commit 81c7e86 into yanyongyu:master Sep 21, 2024
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Rest API schema schema related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants