Skip to content

Problem while parsing event hook metadata #223

@Aaylor

Description

@Aaylor

While receiving data from the GitHub event push, we encounter two problems
during the parsing of the event metadata.

Type problem while parsing the object repository

There is an inconsistency coming from GitHub for two specifics fields:
pushed_at and created_at. The push event always sends the fields pushed_at
and created_at as integers (EPOCH), instead of string values as expected from
the atd file:

type repository = {
  ...
  ?pushed_at: string option;
  created_at: string;
  ...

The documentation shows that both field must be consider as integers.

I took a quick look at others event payload, and the push event seems to be
the only one where those fields are integers...

(The error is different from the issue #136)

Missing record fields created_at, id

The type event_hook_metdata expects two specifics field from the hook payload:
created_at and id:

type event_hook_metadata = {
  ...
  created_at: string;
  ...
  id: int <ocaml repr="int64">;
} <ocaml field_prefix="event_hook_metadata_">

Those two fields does not appear anymore in both event I have tested: push and
ping. I've also quick checked the documentation from other events, and those
two fields does not appear.
Maybe they can be consider as optional, or they should be deleted ?

I'm not really used to work with atd, but I may try to write a patch for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions