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

[BUG]: WorkflowJobStatus enum does not contain "pending" value. #2882

Closed
1 task done
redoz opened this issue Feb 12, 2024 · 4 comments · Fixed by #2885
Closed
1 task done

[BUG]: WorkflowJobStatus enum does not contain "pending" value. #2882

redoz opened this issue Feb 12, 2024 · 4 comments · Fixed by #2885
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@redoz
Copy link
Contributor

redoz commented Feb 12, 2024

What happened?

I get an exception when trying to read the value of WorkflowJobStep.Status as it sends 'pending' but that's not a valid value for that Enum. It seems very similar to this issue from last year: #2656

Versions

Using Octokit 9.1.2 on .NET 8 running on Windows.

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@redoz redoz added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Feb 12, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Feb 12, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Feb 12, 2024
@redoz
Copy link
Contributor Author

redoz commented Feb 13, 2024

@kfcampbell should the existing enum just be extended with a Pending member, or is the fix to split this into a separate enum WorkflowJobStepStatus? I didn't see anything int he REST API docs what the legal values for this enum were, and it already has a Waiting which seems like it would be the same as Pending?

@kfcampbell
Copy link
Member

@redoz I'm sorry I'm a bit confused. Your title mentions WorkflowJobStatus but the description mentions WorkflowJobStep. Do you mind linking to the documentation you're looking at here?

@redoz
Copy link
Contributor Author

redoz commented Feb 14, 2024

@kfcampbell Sorry for the confusion, I'm getting the error while accessing the Status property on the WorkflowJobStep, that property is of type StringEnum<WorkflowJobStatus> which is the same type of the Status property on the WorkflowJob type. It wasn't clear if they are referring to the same status (of the WorkflowJob), or if the enum is just re-used to represent the state of the WorkflowJobStep.

I can easily submit a PR to add the Pending value to this enum, but I wasn't sure if this was the correct fix, or if there is more to this than it seems, given that the enum already has a Waiting member.

And maybe I'm looking at the wrong place but it seems the step is documented to have the following statuses:
image
based on this documentation: https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28

So, before I put effort into submitting a PR, I figured I'd ask for some clarification to make sure it got fixed correctly. I hope that makes more sense, thanks for your time so far!

@kfcampbell
Copy link
Member

Thanks for the detailed explanation! I've done a little code spelunking internally and I think it's appropriate to add a Pending value here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants