yanyongyu / githubkit

The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!
MIT License
158 stars 21 forks source link

Fix: project v2 item field change type may be labels #69

Closed jecluis closed 6 months ago

jecluis commented 6 months ago

According to the webhook events we're getting sent by github, the changed field_type can be "labels" as well, but this doesn't seem to be covered by the octokit schema.

As an example, take the following snippet:

"action": "edited",
    "projects_v2_item": {
      "id": 12345,
      "node_id": "PVTI_ASDASD",
      "project_node_id": "PVT_ASDASD",
      "content_node_id": "I_ASDASD",
      "content_type": "Issue",
      "creator": {
        "login": "jecluis",
        [...]
      },
      "created_at": "2023-12-18T06:44:23Z",
      "updated_at": "2023-12-18T16:21:38Z",
      "archived_at": null
    },
    "changes": {
      "field_value": {
        "field_node_id": "PVTF_ASDASD",
        "field_type": "labels"
      }
    },

Signed-off-by: Joao Eduardo Luis \joao@1e3ms.io

yanyongyu commented 6 months ago

it seems this field value is not documented in the webhook types... But, the latest openapi description mark this field as simple string instead of enum. I'm working on migrate the codegen to using the openapi instead of octokit #67 . just make a fix currently 🤔 .

jecluis commented 6 months ago

Fixes applied, sorry for the silly mistake. Thanks @yanyongyu !