-
Notifications
You must be signed in to change notification settings - Fork 32
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
[fix]: Add missing "waiting" enum to WorkflowJobStatus.cs #364
Conversation
Thanks for the contribution! Can I ask what was the cause of the exception? StringEnum was supposed to prevent this type of exception. I'm limited in the amount of debugging I can do right now as I'm traveling the next couple of days and only have mobile access. |
Just had a (very quick) read through the |
Hey @rasmus, For clarity the file you were looking to changed is WorkflowJobStatus According to the schema status' for
Workflow runs on the other hand have a much more broad set of status' - they can be viewed in the docs here. I can totally see where this can be confusing so I wanted to clarity which one ( |
I admit, this PR was created while we were doing a hectic debug session on our own bug and this popped up in the logs. The initial commit was a copy-paste from the |
Captured a event in the wild with the Sent from GitHub Enterprise {
"action": "waiting",
"workflow_job": {
"id": 5775885,
"run_id": 783732,
"run_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/actions/runs/783732",
"run_attempt": 1,
"node_id": "MDg6Q2hlY2tSdW41Nzc1ODg1",
"head_sha": "39d9c4327ce3632032af0751596204fd1187ed5a",
"url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/actions/jobs/5775885",
"html_url": "https://github.dummy-hostname.org/some-org/some-repo/actions/runs/783732/jobs/1402302",
"status": "waiting",
"conclusion": null,
"started_at": "2023-10-11T07:02:47Z",
"completed_at": null,
"name": "some name of deploy",
"steps": [
],
"check_run_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/check-runs/5775885",
"labels": [
"self-hosted",
"ubuntu-latest"
],
"runner_id": null,
"runner_name": null,
"runner_group_id": null,
"runner_group_name": null
},
"deployment": {
"url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/deployments/92176",
"id": 92176,
"node_id": "MDEwOkRlcGxveW1lbnQ5MjE3Ng==",
"task": "deploy",
"original_environment": "some env",
"environment": "some env",
"description": null,
"created_at": "2023-10-11T07:02:47Z",
"updated_at": "2023-10-11T07:02:47Z",
"statuses_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/deployments/92176/statuses",
"repository_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo",
"creator": {
"login": "some-name",
"id": 1555,
"node_id": "MDQ6VXNlcjE1NTU=",
"avatar_url": "https://avatars.github.dummy-hostname.org/u/1555?",
"gravatar_id": "",
"url": "https://github.dummy-hostname.org/api/v3/users/some-name",
"html_url": "https://github.dummy-hostname.org/some-name",
"followers_url": "https://github.dummy-hostname.org/api/v3/users/some-name/followers",
"following_url": "https://github.dummy-hostname.org/api/v3/users/some-name/following{/other_user}",
"gists_url": "https://github.dummy-hostname.org/api/v3/users/some-name/gists{/gist_id}",
"starred_url": "https://github.dummy-hostname.org/api/v3/users/some-name/starred{/owner}{/repo}",
"subscriptions_url": "https://github.dummy-hostname.org/api/v3/users/some-name/subscriptions",
"organizations_url": "https://github.dummy-hostname.org/api/v3/users/some-name/orgs",
"repos_url": "https://github.dummy-hostname.org/api/v3/users/some-name/repos",
"events_url": "https://github.dummy-hostname.org/api/v3/users/some-name/events{/privacy}",
"received_events_url": "https://github.dummy-hostname.org/api/v3/users/some-name/received_events",
"type": "User",
"site_admin": false
},
"sha": "39d9c4327ce3632032af0751596204fd1187ed5a",
"ref": "master",
"payload": {
},
"transient_environment": false,
"production_environment": false,
"performed_via_github_app": null
},
"repository": {
"id": 37825,
"node_id": "MDEwOlJlcG9zaXRvcnkzNzgyNQ==",
"name": "some-repo",
"full_name": "some-org/some-repo",
"private": false,
"owner": {
"login": "some-org",
"id": 366,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjM2Ng==",
"avatar_url": "https://avatars.github.dummy-hostname.org/u/366?",
"gravatar_id": "",
"url": "https://github.dummy-hostname.org/api/v3/users/some-org",
"html_url": "https://github.dummy-hostname.org/some-org",
"followers_url": "https://github.dummy-hostname.org/api/v3/users/some-org/followers",
"following_url": "https://github.dummy-hostname.org/api/v3/users/some-org/following{/other_user}",
"gists_url": "https://github.dummy-hostname.org/api/v3/users/some-org/gists{/gist_id}",
"starred_url": "https://github.dummy-hostname.org/api/v3/users/some-org/starred{/owner}{/repo}",
"subscriptions_url": "https://github.dummy-hostname.org/api/v3/users/some-org/subscriptions",
"organizations_url": "https://github.dummy-hostname.org/api/v3/users/some-org/orgs",
"repos_url": "https://github.dummy-hostname.org/api/v3/users/some-org/repos",
"events_url": "https://github.dummy-hostname.org/api/v3/users/some-org/events{/privacy}",
"received_events_url": "https://github.dummy-hostname.org/api/v3/users/some-org/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.dummy-hostname.org/some-org/some-repo",
"description": "some description",
"fork": false,
"url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo",
"forks_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/forks",
"keys_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/keys{/key_id}",
"collaborators_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/collaborators{/collaborator}",
"teams_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/teams",
"hooks_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/hooks",
"issue_events_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/issues/events{/number}",
"events_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/events",
"assignees_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/assignees{/user}",
"branches_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/branches{/branch}",
"tags_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/tags",
"blobs_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/git/blobs{/sha}",
"git_tags_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/git/tags{/sha}",
"git_refs_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/git/refs{/sha}",
"trees_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/git/trees{/sha}",
"statuses_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/statuses/{sha}",
"languages_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/languages",
"stargazers_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/stargazers",
"contributors_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/contributors",
"subscribers_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/subscribers",
"subscription_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/subscription",
"commits_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/commits{/sha}",
"git_commits_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/git/commits{/sha}",
"comments_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/comments{/number}",
"issue_comment_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/issues/comments{/number}",
"contents_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/contents/{+path}",
"compare_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/compare/{base}...{head}",
"merges_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/merges",
"archive_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/{archive_format}{/ref}",
"downloads_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/downloads",
"issues_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/issues{/number}",
"pulls_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/pulls{/number}",
"milestones_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/milestones{/number}",
"notifications_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/notifications{?since,all,participating}",
"labels_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/labels{/name}",
"releases_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/releases{/id}",
"deployments_url": "https://github.dummy-hostname.org/api/v3/repos/some-org/some-repo/deployments",
"created_at": "2020-07-08T11:13:43Z",
"updated_at": "2022-08-09T13:21:23Z",
"pushed_at": "2023-10-11T06:55:48Z",
"git_url": "git://github.dummy-hostname.org/some-org/some-repo.git",
"ssh_url": "[email protected]:some-org/some-repo.git",
"clone_url": "https://github.dummy-hostname.org/some-org/some-repo.git",
"svn_url": "https://github.dummy-hostname.org/some-org/some-repo",
"homepage": null,
"size": 7082,
"stargazers_count": 0,
"watchers_count": 0,
"language": "TypeScript",
"has_issues": false,
"has_projects": false,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"has_discussions": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 6,
"license": null,
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [
"something-else",
"something"
],
"visibility": "public",
"forks": 0,
"open_issues": 6,
"watchers": 0,
"default_branch": "master"
},
"organization": {
"login": "some-org",
"id": 366,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjM2Ng==",
"url": "https://github.dummy-hostname.org/api/v3/orgs/some-org",
"repos_url": "https://github.dummy-hostname.org/api/v3/orgs/some-org/repos",
"events_url": "https://github.dummy-hostname.org/api/v3/orgs/some-org/events",
"hooks_url": "https://github.dummy-hostname.org/api/v3/orgs/some-org/hooks",
"issues_url": "https://github.dummy-hostname.org/api/v3/orgs/some-org/issues",
"members_url": "https://github.dummy-hostname.org/api/v3/orgs/some-org/members{/member}",
"public_members_url": "https://github.dummy-hostname.org/api/v3/orgs/some-org/public_members{/member}",
"avatar_url": "https://avatars.github.dummy-hostname.org/u/366?",
"description": "Archived repos should be moved to the \"some-org-attic\" organization"
},
"enterprise": {
"id": 1,
"slug": "enterprise-slug",
"name": "Enterprise-Name",
"node_id": "MDEwOkVudGVycHJpc2Ux",
"avatar_url": "https://avatars.github.dummy-hostname.org/b/1?",
"description": null,
"website_url": null,
"html_url": "https://github.dummy-hostname.org/enterprises/enterprise-slug",
"created_at": "2019-07-31T19:01:23Z",
"updated_at": "2022-11-06T21:06:44Z"
},
"sender": {
"login": "some-name",
"id": 1555,
"node_id": "MDQ6VXNlcjE1NTU=",
"avatar_url": "https://avatars.github.dummy-hostname.org/u/1555?",
"gravatar_id": "",
"url": "https://github.dummy-hostname.org/api/v3/users/some-name",
"html_url": "https://github.dummy-hostname.org/some-name",
"followers_url": "https://github.dummy-hostname.org/api/v3/users/some-name/followers",
"following_url": "https://github.dummy-hostname.org/api/v3/users/some-name/following{/other_user}",
"gists_url": "https://github.dummy-hostname.org/api/v3/users/some-name/gists{/gist_id}",
"starred_url": "https://github.dummy-hostname.org/api/v3/users/some-name/starred{/owner}{/repo}",
"subscriptions_url": "https://github.dummy-hostname.org/api/v3/users/some-name/subscriptions",
"organizations_url": "https://github.dummy-hostname.org/api/v3/users/some-name/orgs",
"repos_url": "https://github.dummy-hostname.org/api/v3/users/some-name/repos",
"events_url": "https://github.dummy-hostname.org/api/v3/users/some-name/events{/privacy}",
"received_events_url": "https://github.dummy-hostname.org/api/v3/users/some-name/received_events",
"type": "User",
"site_admin": false
},
"installation": {
"id": 1199,
"node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTE5OQ=="
}
} |
@rasmus Got it! Thank you for the clarification! As expected, you are correct. It seems that our documents are incorrect (as well as our OpenAPI schema). Something similar has been reported by other users as well and also fixed in Octokit.net. Once we get CI green, we'll work to get this in. I'll also be creating a ticket to address the inaccuracy in the OpenAPI definition. Apologies for all of the trouble. |
src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJobStatus.cs
Outdated
Show resolved
Hide resolved
You can guard against this by using the |
@rasmus Just a quick follow up. I submitted a PR to get this updated in the GitHub OpenAPI definitions. Hopefully that will get published and into docs once it has been merged. |
The
WorkflowJobStatus
enum is lacking theWaiting
, which cases an exception.Before the change?
After the change?
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!