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

Sync CheckRun class with API spec #3111

Merged
merged 8 commits into from
Jan 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated class according to API spec
  • Loading branch information
EnricoMi committed Jan 7, 2025
commit 588faa5bb42aede6e9b0630f8ba0ef8afd5764ec
18 changes: 18 additions & 0 deletions github/CheckRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

import github.CheckRunAnnotation
import github.CheckRunOutput
import github.CheckSuite
import github.Deployment
import github.GithubApp
import github.GithubObject
import github.PullRequest
Expand All @@ -52,6 +54,8 @@
if TYPE_CHECKING:
from github.CheckRunAnnotation import CheckRunAnnotation
from github.CheckRunOutput import CheckRunOutput
from github.CheckSuite import CheckSuite
from github.Deployment import Deployment
from github.GithubApp import GithubApp
from github.PullRequest import PullRequest

Expand All @@ -70,9 +74,11 @@ class CheckRun(CompletableGithubObject):

def _initAttributes(self) -> None:
self._app: Attribute[GithubApp] = NotSet
self._check_suite: Attribute[CheckSuite] = NotSet
self._check_suite_id: Attribute[int] = NotSet
self._completed_at: Attribute[datetime | None] = NotSet
self._conclusion: Attribute[str] = NotSet
self._deployment: Attribute[Deployment] = NotSet
self._details_url: Attribute[str] = NotSet
self._external_id: Attribute[str] = NotSet
self._head_sha: Attribute[str] = NotSet
Expand All @@ -94,6 +100,11 @@ def app(self) -> GithubApp:
self._completeIfNotSet(self._app)
return self._app.value

@property
def check_suite(self) -> github.CheckSuite.CheckSuite:
self._completeIfNotSet(self._check_suite)
return self._check_suite.value

@property
def check_suite_id(self) -> int:
self._completeIfNotSet(self._check_suite_id)
Expand All @@ -109,6 +120,11 @@ def conclusion(self) -> str:
self._completeIfNotSet(self._conclusion)
return self._conclusion.value

@property
def deployment(self) -> github.Deployment.Deployment:
self._completeIfNotSet(self._deployment)
return self._deployment.value

@property
def details_url(self) -> str:
self._completeIfNotSet(self._details_url)
Expand Down Expand Up @@ -243,6 +259,8 @@ def _useAttributes(self, attributes: dict[str, Any]) -> None:
self._completed_at = self._makeDatetimeAttribute(attributes["completed_at"])
if "conclusion" in attributes: # pragma no branch
self._conclusion = self._makeStringAttribute(attributes["conclusion"])
if "deployment" in attributes: # pragma no branch
self._deployment = self._makeClassAttribute(github.Deployment.Deployment, attributes["deployment"])
if "details_url" in attributes: # pragma no branch
self._details_url = self._makeStringAttribute(attributes["details_url"])
if "external_id" in attributes: # pragma no branch
Expand Down