Skip to content

Commit 899ef72

Browse files
authored
Add missing repository to WorkflowRun schema (#211)
1 parent 45ccec7 commit 899ef72

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

bert_e/git_host/github/schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class WorkflowRun(GitHubSchema):
141141
check_suite_id = fields.Integer()
142142
html_url = fields.Str()
143143
event = fields.Str()
144+
repository = fields.Nested(Repo)
144145
workflow_id = fields.Integer()
145146

146147

bert_e/tests/unit/test_github_build_status.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,23 @@ def workflow_run_json():
7070

7171
def test_aggregated_workflow_run_api_client(client):
7272
"""Run the workflow run client with the GitHub mock server."""
73+
head_sha = 'acb5820ced9479c074f688cc328bf03f341a511d'
74+
owner = 'octocat'
75+
repo = 'Hello-World'
7376
workflow_runs = AggregatedWorkflowRuns.get(
7477
client=client,
75-
owner='octo-org',
76-
repo='Hello-World',
78+
owner=owner,
79+
repo=repo,
7780
params={
78-
'head_sha': 'd6fde92930d4715a2b49857d24b940956b26d2d3'
81+
'head_sha': head_sha
7982
}
8083
)
8184
assert workflow_runs.state == 'INPROGRESS'
85+
assert workflow_runs.full_repo == f'{owner}/{repo}'
86+
assert workflow_runs.commit == head_sha
87+
assert workflow_runs.owner == owner
88+
assert workflow_runs.repo == repo
89+
assert workflow_runs.branch == 'master'
8290

8391

8492
def test_aggregated_workflow_run(client, workflow_run_json):

0 commit comments

Comments
 (0)