Skip to content

feat: add get_issues method to Repository#95

Merged
dclong merged 1 commit into
mainfrom
push-pxtpxoqkmlyx
Jun 27, 2026
Merged

feat: add get_issues method to Repository#95
dclong merged 1 commit into
mainfrom
push-pxtpxoqkmlyx

Conversation

@dclong

@dclong dclong commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • feat(github): add get_issues method to Repository

Changed files

Modified

  • github_rest_api/github.py (+18/-0)
  • tests/test_github.py (+19/-0)
  • uv.lock (+1/-1)

Commits

  • 2f8ce1a feat(github): add get_issues method to Repository

@dclong

dclong commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds get_issues and get_issue_comments methods to the Repository class, along with corresponding unit tests. The feedback suggests improving type safety by using a Literal type instead of a generic str for the state parameter in get_issues to restrict its allowed values.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/github.py Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds get_issues and get_issue_comments methods to the Repository class, along with corresponding unit tests, and bumps the package version. The feedback suggests enhancing type safety for the state parameter in get_issues by using Literal instead of str to restrict it to valid values.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/github.py Outdated
"""List pull requests in this repository."""
return self._extract_all(url=self._url_pull, n=n)

def get_issues(self, state: str = "all", n: int = 0) -> list[dict[str, Any]]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To align with the repository's emphasis on type safety (using pyright and ty), we should restrict the state parameter to the specific allowed values ("open", "closed", "all") using Literal instead of a generic str. This provides better IDE autocompletion and static analysis checks.

Note: Please ensure Literal is imported from typing.

    def get_issues(
        self, state: Literal["open", "closed", "all"] = "all", n: int = 0
    ) -> list[dict[str, Any]]:
References
  1. Type Safety: Uses ty and pyright to ensure type correctness. (link)

@dclong dclong force-pushed the push-pxtpxoqkmlyx branch from 2f8ce1a to 6a0cd4d Compare June 27, 2026 05:23
@dclong

dclong commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for retrieving issues and issue comments from a GitHub repository by introducing the IssueState enum, get_issues, and get_issue_comments methods, along with corresponding unit tests. The review feedback suggests ensuring StrEnum is imported to prevent a runtime NameError and recommends typing the state parameter as IssueState | str to allow callers to pass raw strings directly for better usability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/github.py
Comment thread github_rest_api/github.py
@dclong dclong merged commit 873e511 into main Jun 27, 2026
8 checks passed
@dclong dclong deleted the push-pxtpxoqkmlyx branch June 28, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant