XAMPPRocky / octocrab

A modern, extensible GitHub API Client for Rust.
Other
1.06k stars 258 forks source link

Undocumented octocrab::models::workflows::Status variant "pending" observed coming from GitHub #574

Closed ztj closed 5 months ago

ztj commented 6 months ago

I've observed through usage that despite the documentation, GitHub sends at least the additional variant of "pending" for a Job's status, or possibly the status of a step. This would be far from the first time I've encountered undocumented or incorrectly documented GitHub API behavior. It manifests in my logs like...

Serde Error: unknown variant `pending`, expected one of `queued`, `in_progress`, `completed`, `failed`

... along with the rest of the snafu context when sending a .workflows(...).list_jobs(...) request.

I'm not really sure how you'd prefer to handle this or I'd probably PR a quick fix. For my part, I'm not even using the status value except to log it, so, the failure here is totally spurious for my use case. I appreciate that this is almost certainly a GitHub screw-up, and I've only seen it once so far, so perhaps it's nothing urgent, but, nonetheless an interesting conundrum to consider when writing a client for a service you have no control over.

XAMPPRocky commented 6 months ago

Thank you for your issue! Yes, another variant should be added, I'd be happy to review PR adding it.