• 
      

    Modernize github implementation and use Pydantic for parsing.

    Review Request #15122 — Created June 12, 2026 and submitted

    Information

    Review Board
    release-9.x

    Reviewers

    This change updates our github client implementation to use Pydantic for
    parsing API payloads, and fixes up type hints and docstrings throughout.

    While working in the paginated resources, I realized that the start
    and per_page parameters weren't getting plumbed through at all, so
    I've fixed that as well.

    Ran unit tests.

    Summary ID
    Modernize github implementation and use Pydantic for parsing.
    This change updates our github client implementation to use Pydantic for parsing API payloads, and fixes up type hints and docstrings throughout. While working in the paginated resources, I realized that the way the page parameters were plumbed for the GitHubAPIPaginator wasn't actually working, and that given that GitHub API resources don't use a consistent name for the start parameter, I've baked the start and per_page values into the initial URL parameters instead of relying on the `request_kwargs` member. Testing Done: Ran unit tests.
    myylkmlorkqwkztrmunzoxxvoszokpqp
    Description From Last Updated

    closing bracket does not match indentation of opening bracket's line Column: 9 Error code: E123

    reviewbot reviewbot

    Can we use Sequence instead of list here and for rhe rest of the list-type attributes?

    maubin maubin

    Old typo not caught by your other change: "with" -> "will".

    maubin maubin

    This is missing an Args and Returns section.

    maubin maubin

    Same typo here as mentioned above.

    maubin maubin

    'reviewboard.scmtools.core.Commit' imported but unused Column: 1 Error code: F401

    reviewbot reviewbot

    continuation line over-indented for hanging indent Column: 17 Error code: E126

    reviewbot reviewbot

    This should say TreeResponse.

    maubin maubin
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    david
    maubin
    1. 
        
    2. reviewboard/hostingsvcs/github/api.py (Diff revision 2)
       
       
      Show all issues

      Can we use Sequence instead of list here and for rhe rest of the list-type attributes?

      1. No, pydantic doesn't know what Sequence should resolve to.

    3. Show all issues

      Old typo not caught by your other change: "with" -> "will".

    4. reviewboard/hostingsvcs/github/service.py (Diff revision 2)
       
       
       
       
       
       
       
      Show all issues

      This is missing an Args and Returns section.

    5. Show all issues

      Same typo here as mentioned above.

    6. 
        
    david
    Review request changed
    Change Summary:

    Changed my mind on the approach. Instead of the client basically implementing the BaseHostingService API directly, it now is a thin(ish) layer that makes requests to specific API endpoints and returns either the pydantic model (for individual items) or a paginator (for lists). Logic for composing API calls and converting the pydantic models into the hostingsvcs/scmtools return values has been moved back into the hosting service class.

    I've also added the default_branch implementation that was previously a TODO comment.

    Commits:
    Summary ID
    Modernize github implementation and use Pydantic for parsing.
    This change updates our github client implementation to use Pydantic for parsing API payloads, and fixes up type hints and docstrings throughout. While working in the paginated resources, I realized that the way the page parameters were plumbed for the GitHubAPIPaginator wasn't actually working, and that given that GitHub API resources don't use a consistent name for the start parameter, I've baked the start and per_page values into the initial URL parameters instead of relying on the `request_kwargs` member. Testing Done: Ran unit tests.
    myylkmlorkqwkztrmunzoxxvoszokpqp
    Modernize github implementation and use Pydantic for parsing.
    This change updates our github client implementation to use Pydantic for parsing API payloads, and fixes up type hints and docstrings throughout. While working in the paginated resources, I realized that the way the page parameters were plumbed for the GitHubAPIPaginator wasn't actually working, and that given that GitHub API resources don't use a consistent name for the start parameter, I've baked the start and per_page values into the initial URL parameters instead of relying on the `request_kwargs` member. Testing Done: Ran unit tests.
    myylkmlorkqwkztrmunzoxxvoszokpqp

    Checks run (1 failed, 1 succeeded)

    flake8 failed.
    JSHint passed.

    flake8

    david
    maubin
    1. 
        
    2. Show all issues

      This should say TreeResponse.

    3. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-9.x (d33a34b)