fix(backend): serialize the pydantic objects correctly for github checks and statuses (#9582)

<!-- Clearly explain the need for these changes: -->
Trying to run the GitHub Status blocks results in a serialization error

### Changes 🏗️
- Serializes the checks and blocks data objects correctly
<!-- Concisely describe all of the changes made in this pull request:
-->

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
  - [x] make a one block agent, test it and make sure it works
This commit is contained in:
Nicholas Tindle
2025-03-05 16:04:28 -06:00
committed by GitHub
parent 3b53c6953a
commit 5b8947ed93
2 changed files with 7 additions and 3 deletions

View File

@@ -172,7 +172,9 @@ class GithubCreateCheckRunBlock(Block):
data.output = output_data
check_runs_url = f"{repo_url}/check-runs"
response = api.post(check_runs_url)
response = api.post(
check_runs_url, data=data.model_dump_json(exclude_none=True)
)
result = response.json()
return {
@@ -323,7 +325,9 @@ class GithubUpdateCheckRunBlock(Block):
data.output = output_data
check_run_url = f"{repo_url}/check-runs/{check_run_id}"
response = api.patch(check_run_url)
response = api.patch(
check_run_url, data=data.model_dump_json(exclude_none=True)
)
result = response.json()
return {

View File

@@ -144,7 +144,7 @@ class GithubCreateStatusBlock(Block):
data.description = description
status_url = f"{repo_url}/statuses/{sha}"
response = api.post(status_url, json=data)
response = api.post(status_url, data=data.model_dump_json(exclude_none=True))
result = response.json()
return {