Skip to content

feat(preprod): expose status check data through build details API#104085

Merged
trevor-e merged 6 commits intomasterfrom
telkins/status-check-api
Dec 2, 2025
Merged

feat(preprod): expose status check data through build details API#104085
trevor-e merged 6 commits intomasterfrom
telkins/status-check-api

Conversation

@trevor-e
Copy link
Copy Markdown
Member

Exposes this data to our frontend so we can build a success/error UI for posted checks.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 27, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 35.00000% with 26 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...api/models/project_preprod_build_details_models.py 35.00% 26 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #104085      +/-   ##
===========================================
- Coverage   80.61%    80.35%   -0.27%     
===========================================
  Files        9319      9327       +8     
  Lines      397949    402609    +4660     
  Branches    25424     25424              
===========================================
+ Hits       320801    323507    +2706     
- Misses      76696     78650    +1954     
  Partials      452       452              


def _parse_posted_status_checks(artifact: PreprodArtifact) -> PostedStatusChecks | None:
"""Parse posted status checks from artifact extras, returning None for invalid data."""
if not artifact.extras:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm looking into some better options for maintaining a schema for our JSON column, like maybe a pydantic model, so parsing this is less of a hassle going forward. But won't be part of this PR.

@trevor-e trevor-e marked this pull request as ready for review December 1, 2025 22:16
@trevor-e trevor-e requested a review from a team as a code owner December 1, 2025 22:16
def _parse_success_check(raw_size: dict[str, Any], artifact_id: int) -> StatusCheckResultSuccess:
"""Parse a successful status check result."""
check_id = raw_size.get("check_id")
if check_id is not None and not isinstance(check_id, str):
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.

yeah damn, lotta unwrapping - but will trust you to address later on!

"error_type": error_type_str,
},
)
return StatusCheckResultFailure(error_type=error_type)
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.

I guess we'll handle a default error message / error type on the client?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yea the UI can show a specific message based on the error_type field.

@trevor-e trevor-e merged commit 571198d into master Dec 2, 2025
66 checks passed
@trevor-e trevor-e deleted the telkins/status-check-api branch December 2, 2025 18:23
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants