docs icon indicating copy to clipboard operation
docs copied to clipboard

Clarify that `X-GitHub-Delivery` is unique per event, not per delivery

Open minusworld opened this issue 1 year ago • 7 comments

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/webhooks/webhook-events-and-payloads#delivery-headers https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks#use-the-x-github-delivery-header

What part(s) of the article would you like to see updated?

https://docs.github.com/en/webhooks/webhook-events-and-payloads#delivery-headers https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks#use-the-x-github-delivery-header

Additional information

Hi there!

I was experiencing a puzzling issue for a while where were receiving two webhook event payloads with the same X-GitHub-Delivery GUID. At first, I assumed it was our infrastructure duplicating something because I assumed that all payloads from GitHub would have a unique X-GitHub-Delivery. However, upon further experimentation, I was able to create a scenario which sends two different payloads with the same X-GitHub-Delivery GUID by creating two GitHub Apps. This leads me to believe that X-GitHub-Delivery is unique per GitHub event, not unique per delivery as the documentation implies. Further, this means the guidance in this section is nuanced because there are cases where I want to handle the webhook differently based on which App is sending the event, which means excluding payloads based on X-GitHub-Delivery isn't always valid.

Below are some screenshots showing the same X-GitHub-Delivery from two different GitHub Apps.

1. I created two GitHub Apps to send webhook events to two different callback URLs.

exp-1-installed-2-apps

2. This screenshot shows the same X-GitHub-Delivery GUID routed to two destinations.

Additionally, it shows unique Amazon CloudFront and Amazon Load Balancer IDs for the web request. exp-2-same-guid-different-dest

3. This screenshot shows the same X-GitHub-Delivery with two different app_ids.

exp-3-same-guid-different-app-ids

minusworld avatar May 06 '24 20:05 minusworld

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

welcome[bot] avatar May 06 '24 20:05 welcome[bot]

@minusworld Thank you for opening this issue! I'll get this triaged for review ✨

nguyenalex836 avatar May 06 '24 21:05 nguyenalex836

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:

github-actions[bot] avatar May 07 '24 23:05 github-actions[bot]

The X-GitHub-Delivery header is indeed only unique per Event and not per delivery. Is a repository had 10 apps listening to the same event, all these apps would receive the same delivery payload for that event.

cc: @skedwards88

tiabas avatar May 08 '24 12:05 tiabas

Thanks for the confirmation, Kevin, and thanks for this detailed and clear issue @minusworld !

You or anyone else is welcome to open a PR to clarify this:

skedwards88 avatar May 09 '24 22:05 skedwards88

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/webhooks/webhook-events-and-payloads#delivery-headers https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks#use-the-x-github-delivery-header

What part(s) of the article would you like to see updated?

https://docs.github.com/en/webhooks/webhook-events-and-payloads#delivery-headers https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks#use-the-x-github-delivery-header

Additional information

Hi there!

I was experiencing a puzzling issue for a while where were receiving two webhook event payloads with the same X-GitHub-Delivery GUID. At first, I assumed it was our infrastructure duplicating something because I assumed that all payloads from GitHub would have a unique X-GitHub-Delivery. However, upon further experimentation, I was able to create a scenario which sends two different payloads with the same X-GitHub-Delivery GUID by creating two GitHub Apps. This leads me to believe that X-GitHub-Delivery is unique per GitHub event, not unique per delivery as the documentation implies. Further, this means the guidance in this section is nuanced because there are cases where I want to handle the webhook differently based on which App is sending the event, which means excluding payloads based on X-GitHub-Delivery isn't always valid.

Below are some screenshots showing the same X-GitHub-Delivery from two different GitHub Apps.

1. I created two GitHub Apps to send webhook events to two different callback URLs.

exp-1-installed-2-apps ### 2. This screenshot shows the same `X-GitHub-Delivery` GUID routed to two destinations. Additionally, it shows unique Amazon CloudFront and Amazon Load Balancer IDs for the web request. exp-2-same-guid-different-dest

3. This screenshot shows the same X-GitHub-Delivery with two different app_ids.

exp-3-same-guid-different-app-ids

dxkf177 avatar May 11 '24 12:05 dxkf177

See

dxkf177 avatar May 11 '24 12:05 dxkf177

Hi @nguyenalex836. I made a pull request for this issue. It's #33184.

CBID2 avatar May 26 '24 22:05 CBID2