Conversation
|
Hi Robert, thanks for the PR! I'm currently away, but I'll take a look and get back to you within the next day or so. |
|
@roberth Changes look good, but I want to run the CI over this. I have to make a few changes so that it can be run on a remote fork since the GitHub |
kvanbere
left a comment
There was a problem hiding this comment.
See inline comment on CI failure for mempty.
fe99204 to
2f149c1
Compare
kvanbere
left a comment
There was a problem hiding this comment.
Looks like the CI has raised warnings that we forgot to export EventHasMaybeSender(..).
2f149c1 to
23b9bbe
Compare
There was a problem hiding this comment.
Hi Rob, thanks for that revision. According to CI, it looks like one of the examples (github-webhooks-servant-example) needs to be updated to match this change to the API:
2022-12-13T00:51:21.1290270Z github-webhooks-servant-example > Configuring github-webhooks-servant-example-0.0.0...
2022-12-13T00:51:21.3253306Z github-webhooks-servant-simple-example> configure (exe)
2022-12-13T00:51:21.3257387Z github-webhooks-servant-example > build (exe)
2022-12-13T00:51:21.4035215Z github-webhooks-servant-example > Preprocessing executable 'github-webhooks-servant-example' for github-webhooks-servant-example-0.0.0..
2022-12-13T00:51:21.4036052Z github-webhooks-servant-example > Building executable 'github-webhooks-servant-example' for github-webhooks-servant-example-0.0.0..
2022-12-13T00:51:21.5255894Z github-webhooks-servant-example > [1 of 2] Compiling Main
2022-12-13T00:51:21.9723780Z github-webhooks-servant-simple-example> Configuring github-webhooks-servant-simple-example-0.0.0...
2022-12-13T00:51:22.0500611Z github-webhooks-servant-example >
2022-12-13T00:51:22.0502246Z github-webhooks-servant-example > /home/runner/work/github-webhooks/github-webhooks/examples/servant/src/Main.hs:38:38: error:
2022-12-13T00:51:22.0502986Z github-webhooks-servant-example > • Couldn't match type ‘Maybe HookUser’ with ‘HookUser’
2022-12-13T00:51:22.0503531Z github-webhooks-servant-example > Expected type: PushEvent -> HookUser
2022-12-13T00:51:22.0504386Z github-webhooks-servant-example > Actual type: PushEvent -> Maybe HookUser
2022-12-13T00:51:22.0504908Z github-webhooks-servant-example > • In the second argument of ‘(.)’, namely ‘evPushSender’
2022-12-13T00:51:22.0505409Z github-webhooks-servant-example > In the second argument of ‘(.)’, namely
2022-12-13T00:51:22.0505871Z github-webhooks-servant-example > ‘whUserLogin . evPushSender’
2022-12-13T00:51:22.0506373Z github-webhooks-servant-example > In the expression: show . whUserLogin . evPushSender
2022-12-13T00:51:22.0506787Z github-webhooks-servant-example > |
2022-12-13T00:51:22.0507361Z github-webhooks-servant-example > 38 | putStrLn $ (show . whUserLogin . evPushSender) ev ++ " pushed a commit causing HEAD SHA to become:"
2022-12-13T00:51:22.0507911Z github-webhooks-servant-example > |
https://github.com/cuedo/github-webhooks/actions/runs/3681095902/jobs/6227414754
The examples are designed to be overly-simple, so I think using fromJust would be fine here.
This is very rare, so to keep the example simple, it uses fromJust.
23b9bbe to
ebb3af2
Compare
|
Thanks for helping! |
Issue reference:
Fixes #61
GitHub sometimes sends a
pullevent without a sender. See the anonymized test case.Submission Checklist:
PushEventconsumers may have to handle aNothing, but this merely reflects the reality of github webhooks.sendermay be omitted in rare cases.