From c0124e794c87d7d65e3c5bb4ae0ed4f9e366c257 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Tue, 13 Dec 2022 15:28:24 +0100 Subject: [PATCH 01/26] =?UTF-8?q?=F0=9F=93=9D=20Document=20webhooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/_toctree.yml | 2 + docs/hub/webhooks.md | 120 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 docs/hub/webhooks.md diff --git a/docs/hub/_toctree.yml b/docs/hub/_toctree.yml index e1fbda52b..0e733578f 100644 --- a/docs/hub/_toctree.yml +++ b/docs/hub/_toctree.yml @@ -12,6 +12,8 @@ title: Pull Requests & Discussions - local: notifications title: Notifications + - local: webhooks + title: Webhooks - local: repositories-next-steps title: Next Steps - local: repositories-licenses diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md new file mode 100644 index 000000000..769063084 --- /dev/null +++ b/docs/hub/webhooks.md @@ -0,0 +1,120 @@ +# Webhooks + +Webhooks allow you to know when new changes happen on specific repos or repos belonging to specific users / organizations. + +You can configure the webhooks in your [settings](https://huggingface.co/settings/webhooks). + +You can watch repo changes or community events. If you watch all repos belonging to a user or an organization, you can also receive events for repo creation. + +## Webhook payloads + +You will receive payloads through the `POST` method on the specified URL, in JSON format. + +To determine the nature of the event, you can look at the `event` and `domain` fields in the payload. + +You can check the last payloads sent in the activity tab of the webhook page, as well as replay webhooks. + +### Event & Domain + +The top-level properties `repo` and `domain` are always specified and used to determine the nature of the event. + +`event` can take one of the following values: + +- `"create"` +- `"delete"` +- `"update"` +- `"move"` + +`domain` specifies the domain of the event. It can be one of the following values: + + +- `["repo"]` - Global events on repos: create, delete, move +- `["repo", "content"]` - Events on the content of the repo, like new commits or tags. Triggers on new pull requests as well due to the newly created reference / commit. +- `["repo", "config"]` - Events on the config: update space secrets, update settings, update DOIs, disabled or not, ... +- `["community", "discussion"]` - Creating a discussion or pull request, updating the title or status +- `["community", "discussion", "comment"]` - Creating, updating, hiding a comment + +⚠️ **You should consider that any event on a more granular domain is an `"update"` on the encompassing domains.** ⚠️ + +For example, any event on `["community", "discussion", "..."]` is an `"update"` on `["community", "discussion"]`. + +This is important in case more granularity is added to the domains by Hugging Face. For example if the domain domain `["repo", "config", "doi"]` is added, it would be accompanied by an `"add"` event when DOIs are created. + +If you followed the rule above, your application will treat any event on `["repo", "config", "doi"]` as an `"update"` on `["repo", "config"]`, and will not break if Hugging Face adds more granularity to its domains. + +### Repo + +In the current version of webhooks, the top level property `repo` is always specified, as events can always be associated to a repo. Sample payload: + +```json +"repo": { + "type": "model", + "name": "some-user/some-repo", + "gitalyUid": "583c43bd0009f32d976f788446d5010ed6ea4af0c6d0235358378cb56d312f2b", + "id": "6366c000a2abcdf2fd69a080", + "private": false, + "url": { + "web": "http://huggingface.co/some-user/some-repo", + "api": "http://huggingface.co/api/models/some-user/some-repo" + }, + "headSha": "c379e821c9c95d613899e8c4343e4bfee2b0c600", + "tags": [ + "license:other", + "has_space" + ], + "author": { + "id": "61d2000c3c2083e1c08af22d" + } +} +``` + +`headSha` is only sent when the domain starts with `"repo"`, it's not sent on community events. + +### Discussion + +The top level property `discussion` is specified on community events. Its `isPullRequest` property is a boolean indicating if the discussion is also a pull request. Sample payload: + +```json +"discussion": { + "id": "639885d811ae2bad2b7ba461", + "title": "Hello!", + "url": { + "web": "https://huggingface.co/some-user/some-repo/discussions/3", + "api": "https://huggingface.co/api/models/some-user/some-repo/discussions/3" + }, + "status": "open", + "author": { + "id": "61d2000c3c2083e1c08af22d" + }, + "isPullRequest": true, + "changes": { + "base": "refs/heads/main" + } + "num": 3 +} +``` + +### Comment + +The top level property `comment` is specified when a comment is created, including on discussion creation, or updated. Sample payload: + +```json +"comment": { + "id": "6398872887bfcfb93a306f18", + "author": { + "id": "61d2000c3c2083e1c08af22d" + }, + "content": "This adds an env key", + "hidden": false, + "url": { + "web": "http://huggingface.co/some-user/some-repo/discussions/4#6398872887bfcfb93a306f18" + } +} +``` + +## Webhook secret + +You can associate a secret to your webhook in two ways: + +- Updating the url of the webhook to add your secret as a query parameter. +- Setting the secret on the webhook. It will be sent as a `X-Webhook-Secret` header on every request. \ No newline at end of file From 40ca2128cee3398c5b7428bd5db7085723a0ef61 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Tue, 13 Dec 2022 15:40:51 +0100 Subject: [PATCH 02/26] =?UTF-8?q?fixup!=20=F0=9F=93=9D=20Document=20webhoo?= =?UTF-8?q?ks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 769063084..a171a2b8a 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -40,7 +40,7 @@ For example, any event on `["community", "discussion", "..."]` is an `"update"` This is important in case more granularity is added to the domains by Hugging Face. For example if the domain domain `["repo", "config", "doi"]` is added, it would be accompanied by an `"add"` event when DOIs are created. -If you followed the rule above, your application will treat any event on `["repo", "config", "doi"]` as an `"update"` on `["repo", "config"]`, and will not break if Hugging Face adds more granularity to its domains. +If you follow the rule above, your application will treat any event on `["repo", "config", "doi"]` as an `"update"` on `["repo", "config"]`, and will not break if Hugging Face adds more granularity to its domains. ### Repo @@ -117,4 +117,4 @@ The top level property `comment` is specified when a comment is created, includi You can associate a secret to your webhook in two ways: - Updating the url of the webhook to add your secret as a query parameter. -- Setting the secret on the webhook. It will be sent as a `X-Webhook-Secret` header on every request. \ No newline at end of file +- Setting the secret on the webhook. It will be sent as a `X-Webhook-Secret` HTTP header on every request. \ No newline at end of file From b9dca40275906e85a969a2c3e236957c0a3cc166 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 13 Dec 2022 17:09:04 +0100 Subject: [PATCH 03/26] Update docs/hub/webhooks.md Co-authored-by: Julien Chaumond --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index a171a2b8a..6c0c19356 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -16,7 +16,7 @@ You can check the last payloads sent in the activity tab of the webhook page, as ### Event & Domain -The top-level properties `repo` and `domain` are always specified and used to determine the nature of the event. +The top-level properties `event` and `domain` are always specified and used to determine the nature of the event. `event` can take one of the following values: From 0d7a9f2d00157109fb65ab504c2e8c36af0e123c Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 13 Dec 2022 17:09:21 +0100 Subject: [PATCH 04/26] Update docs/hub/webhooks.md Co-authored-by: Julien Chaumond --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 6c0c19356..2002e351c 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -1,6 +1,6 @@ # Webhooks -Webhooks allow you to know when new changes happen on specific repos or repos belonging to specific users / organizations. +Webhooks allow you to know when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). You can configure the webhooks in your [settings](https://huggingface.co/settings/webhooks). From 868df3e759a0fb54e3583409c95e8f5350037d67 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 13 Dec 2022 17:30:49 +0100 Subject: [PATCH 05/26] Update docs/hub/webhooks.md Co-authored-by: Simon Brandeis <33657802+SBrandeis@users.noreply.github.com> --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 2002e351c..37dc6822d 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -8,7 +8,7 @@ You can watch repo changes or community events. If you watch all repos belonging ## Webhook payloads -You will receive payloads through the `POST` method on the specified URL, in JSON format. +After registering a webhook, you will be notified of events via an `HTTP POST` call on the specified URL. The payload is encoded in JSON. To determine the nature of the event, you can look at the `event` and `domain` fields in the payload. From ccd7b174c2c537131a78b36141e5bf7a31003921 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 13 Dec 2022 17:50:12 +0100 Subject: [PATCH 06/26] Update docs/hub/webhooks.md Co-authored-by: Patrick von Platen --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 37dc6822d..6a973ea9e 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -36,7 +36,7 @@ The top-level properties `event` and `domain` are always specified and used to d ⚠️ **You should consider that any event on a more granular domain is an `"update"` on the encompassing domains.** ⚠️ -For example, any event on `["community", "discussion", "..."]` is an `"update"` on `["community", "discussion"]`. +For example, any event on the domain `["community", "discussion", "..."]` is also an `"update"` of the domain `["community", "discussion"]`. This is important in case more granularity is added to the domains by Hugging Face. For example if the domain domain `["repo", "config", "doi"]` is added, it would be accompanied by an `"add"` event when DOIs are created. From 66930b8cff9add3a45c22f1961b261d279d150b1 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 13 Dec 2022 17:50:24 +0100 Subject: [PATCH 07/26] Update docs/hub/webhooks.md Co-authored-by: Patrick von Platen --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 6a973ea9e..08f84de72 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -38,7 +38,7 @@ The top-level properties `event` and `domain` are always specified and used to d For example, any event on the domain `["community", "discussion", "..."]` is also an `"update"` of the domain `["community", "discussion"]`. -This is important in case more granularity is added to the domains by Hugging Face. For example if the domain domain `["repo", "config", "doi"]` is added, it would be accompanied by an `"add"` event when DOIs are created. +This is important in case more granularity is added to the domains by Hugging Face. For example if the domain `["repo", "config", "doi"]` is added, it would be accompanied by an `"add"` event when DOIs are created. If you follow the rule above, your application will treat any event on `["repo", "config", "doi"]` as an `"update"` on `["repo", "config"]`, and will not break if Hugging Face adds more granularity to its domains. From aedb1446ac88147956435d6c0ee2a86142bfefef Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 13 Dec 2022 21:16:40 +0100 Subject: [PATCH 08/26] Update docs/hub/webhooks.md --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 08f84de72..1fc640ad7 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -1,6 +1,6 @@ # Webhooks -Webhooks allow you to know when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). +Webhooks allow you to react when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). You can configure the webhooks in your [settings](https://huggingface.co/settings/webhooks). From f0da9c732928f39435abfeb15301b50a32d88023 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Wed, 14 Dec 2022 09:50:14 +0100 Subject: [PATCH 09/26] Update docs/hub/webhooks.md Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com> --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 1fc640ad7..71334eb47 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -96,7 +96,7 @@ The top level property `discussion` is specified on community events. Its `isPul ### Comment -The top level property `comment` is specified when a comment is created, including on discussion creation, or updated. Sample payload: +The top level property `comment` is specified when a comment is created (including on discussion creation) or updated. Sample payload: ```json "comment": { From 98e68d748ad420d24a367b221dd253d235b1dc07 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Wed, 14 Dec 2022 09:50:42 +0100 Subject: [PATCH 10/26] Update docs/hub/webhooks.md Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com> --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 71334eb47..ff16cd52f 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -68,7 +68,7 @@ In the current version of webhooks, the top level property `repo` is always spec } ``` -`headSha` is only sent when the domain starts with `"repo"`, it's not sent on community events. +`headSha` is only sent when the `domain` contains the value `"repo"`, it's not sent on community events. ### Discussion From 3913170a0a9558cefbb432659c6cbf672362172f Mon Sep 17 00:00:00 2001 From: Eliott C Date: Wed, 14 Dec 2022 09:51:41 +0100 Subject: [PATCH 11/26] Update docs/hub/webhooks.md Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com> --- docs/hub/webhooks.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index ff16cd52f..a7bfe5afd 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -10,7 +10,6 @@ You can watch repo changes or community events. If you watch all repos belonging After registering a webhook, you will be notified of events via an `HTTP POST` call on the specified URL. The payload is encoded in JSON. -To determine the nature of the event, you can look at the `event` and `domain` fields in the payload. You can check the last payloads sent in the activity tab of the webhook page, as well as replay webhooks. From b756d5778c972b77766c14d934fd41de10d81083 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Wed, 14 Dec 2022 09:51:54 +0100 Subject: [PATCH 12/26] Update docs/hub/webhooks.md Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com> --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index a7bfe5afd..b7891fe02 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -6,7 +6,7 @@ You can configure the webhooks in your [settings](https://huggingface.co/setting You can watch repo changes or community events. If you watch all repos belonging to a user or an organization, you can also receive events for repo creation. -## Webhook payloads +## Webhook Payloads After registering a webhook, you will be notified of events via an `HTTP POST` call on the specified URL. The payload is encoded in JSON. From 22897e764dbac6285bb4f0e858d221a0042889c6 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Wed, 14 Dec 2022 09:52:35 +0100 Subject: [PATCH 13/26] Update docs/hub/webhooks.md Co-authored-by: Julien Chaumond --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index b7891fe02..aff7b656e 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -71,7 +71,7 @@ In the current version of webhooks, the top level property `repo` is always spec ### Discussion -The top level property `discussion` is specified on community events. Its `isPullRequest` property is a boolean indicating if the discussion is also a pull request. Sample payload: +The top level property `discussion` is specified on community events. The `isPullRequest` property is a boolean indicating if the discussion is also a pull request (on HF, a PR is a special case of a Discussion). Sample payload: ```json "discussion": { From 9cbb7ebcbade578217e0df65ccc8dc27880c5684 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 14 Dec 2022 17:34:13 +0100 Subject: [PATCH 14/26] =?UTF-8?q?=F0=9F=93=9D=20Add=20screenshots=20+=20fu?= =?UTF-8?q?ll=20payload=20+=20change=20domain=20to=20scope?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 118 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 94 insertions(+), 24 deletions(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index aff7b656e..d9ae9b62f 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -1,45 +1,102 @@ # Webhooks -Webhooks allow you to react when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). +Webhooks are a foundation for MLOps related features. You can use this to auto-convert models, build community bots, or build CI/CD for your datasets or Spaces… + +They allow you to react when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). You can configure the webhooks in your [settings](https://huggingface.co/settings/webhooks). -You can watch repo changes or community events. If you watch all repos belonging to a user or an organization, you can also receive events for repo creation. +![Settings of an individual webhook](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/webhook-settings.png) + +You can watch repo changes and discussions / pull requests / comments. You can even use a Space to react to webhooks! In the screenshot, the user `coyotte508` created a space named `webhooks` that reacts to webhooks. + + ## Webhook Payloads After registering a webhook, you will be notified of events via an `HTTP POST` call on the specified URL. The payload is encoded in JSON. - You can check the last payloads sent in the activity tab of the webhook page, as well as replay webhooks. -### Event & Domain -The top-level properties `event` and `domain` are always specified and used to determine the nature of the event. +![image.png](https://s3.amazonaws.com/moonup/production/uploads/1671034300077-61d2f90c3c2083e1c08af22d.png) -`event` can take one of the following values: +As an example, here is the full payload when a pull request is opened: -- `"create"` -- `"delete"` -- `"update"` -- `"move"` +```json +{ + "event": { + "action": "create", + "scope": "discussion" + }, + "repo": { + "type": "model", + "name": "gpt2", + "gitalyUid": "aed40ec4b80dfaffc3f076570c546561e00e5e2a95de8166bea95dd930b76387", + "id": "621ffdc036468d709f17434d", + "private": false, + "url": { + "web": "https://hugginface.co/gpt2", + "api": "https://hugginface.co/api/models/gpt2" + }, + "author": { + "id": "628b753283ef59b5be89e937" + } + }, + "discussion": { + "id": "6399f58518721fdd27fc9ca9", + "title": "Update co2 emissions", + "url": { + "web": "https://hugginface.co/gpt2/discussions/19", + "api": "https://hugginface.co/api/models/gpt2/discussions/19" + }, + "status": "open", + "author": { + "id": "61d2f90c3c2083e1c08af22d" + }, + "num": 19, + "isPullRequest": true, + "changes": { + "base": "refs/heads/main" + } + }, + "comment": { + "id": "6399f58518721fdd27fc9caa", + "author": { + "id": "61d2f90c3c2083e1c08af22d" + }, + "content": "Add co2 emissions information to the model card", + "hidden": false, + "url": { + "web": "https://hugginface.co/gpt2/discussions/19#6399f58518721fdd27fc9caa" + } + }, + "webhook": { + "id": "6390e855e30d9209411de93b", + "version": 3 + } +} +``` -`domain` specifies the domain of the event. It can be one of the following values: +### Event +The top-level properties `event` is always specified and used to determine the nature of the event. -- `["repo"]` - Global events on repos: create, delete, move -- `["repo", "content"]` - Events on the content of the repo, like new commits or tags. Triggers on new pull requests as well due to the newly created reference / commit. -- `["repo", "config"]` - Events on the config: update space secrets, update settings, update DOIs, disabled or not, ... -- `["community", "discussion"]` - Creating a discussion or pull request, updating the title or status -- `["community", "discussion", "comment"]` - Creating, updating, hiding a comment +It has two sub-properties: `action` and `scope`. -⚠️ **You should consider that any event on a more granular domain is an `"update"` on the encompassing domains.** ⚠️ +`action` can take one of the following values: `"create"`, `"delete"`, `"update"`, `"move"`. -For example, any event on the domain `["community", "discussion", "..."]` is also an `"update"` of the domain `["community", "discussion"]`. +`scope` can be one of the following values: -This is important in case more granularity is added to the domains by Hugging Face. For example if the domain `["repo", "config", "doi"]` is added, it would be accompanied by an `"add"` event when DOIs are created. +- `"repo"` - Global events on repos. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`, `"move"`. +- `"repo.content"` - Events on the content of the repo, like new commits or tags. Triggers on new pull requests as well due to the newly created reference / commit. The associated `action` is always `"update"`. +- `"repo.config"` - Events on the config: update space secrets, update settings, update DOIs, disabled or not, ... The associated `action` is always `"update"`. +- `"discussion"` - Creating a discussion or pull request, updating the title or status (including merging). Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`. +- `"discussion.comment"` - Creating, updating, hiding a comment. Possible values for the associated `action`: `"create"`, `"update"`. -If you follow the rule above, your application will treat any event on `["repo", "config", "doi"]` as an `"update"` on `["repo", "config"]`, and will not break if Hugging Face adds more granularity to its domains. +More scopes can be added in the future. As a rule a thumb, any event on a scope can be considered as an `"update"` action on the broader scope. + +For example, if the `"repo.config.dois"` scope is added in the future, any event with that scope can be considered by your application as an `"update"` action on the `"repo.config"` scope. ### Repo @@ -67,7 +124,7 @@ In the current version of webhooks, the top level property `repo` is always spec } ``` -`headSha` is only sent when the `domain` contains the value `"repo"`, it's not sent on community events. +`headSha` is only sent when the `scope` starts with `"repo"`, it's not sent on community events like discussions and comments. ### Discussion @@ -113,7 +170,20 @@ The top level property `comment` is specified when a comment is created (includi ## Webhook secret -You can associate a secret to your webhook in two ways: +If you set a secret for your webhook, it will be sent along as a `X-Webhook-Secret` HTTP header on every request. Only ASCII characters are supported. + + +You can also change the URL of the webhook to add a secret to the URL. For example, setting it to `https://example.com/webhook?secret=XXX`. + +This can be helpful if accessing the HTTP headers of the request is complicated for your application listening to webhooks. + + +## Debugging webhooks + +Go in the activity tab for your webhook, there you will see the list of recent events. + + ![image.png](https://s3.amazonaws.com/moonup/production/uploads/1671035382840-61d2f90c3c2083e1c08af22d.png) + +You will see the HTTP status code and the payload of the events. You can replay events too by clicking on the `replay` button! -- Updating the url of the webhook to add your secret as a query parameter. -- Setting the secret on the webhook. It will be sent as a `X-Webhook-Secret` HTTP header on every request. \ No newline at end of file +You can also change the url or secret of your webhook and then replay an event, it will send the payload to the updated URL. \ No newline at end of file From 9d3daaa83a2b6ca13c66b7e63bf26ceef3d0d7a1 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 14 Dec 2022 17:38:06 +0100 Subject: [PATCH 15/26] =?UTF-8?q?=F0=9F=92=AC=20Sample=20to=20"here=20is?= =?UTF-8?q?=20an=20example..."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index d9ae9b62f..04d280dea 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -100,7 +100,7 @@ For example, if the `"repo.config.dois"` scope is added in the future, any event ### Repo -In the current version of webhooks, the top level property `repo` is always specified, as events can always be associated to a repo. Sample payload: +In the current version of webhooks, the top level property `repo` is always specified, as events can always be associated to a repo. For example, consider the following value: ```json "repo": { @@ -128,7 +128,7 @@ In the current version of webhooks, the top level property `repo` is always spec ### Discussion -The top level property `discussion` is specified on community events. The `isPullRequest` property is a boolean indicating if the discussion is also a pull request (on HF, a PR is a special case of a Discussion). Sample payload: +The top level property `discussion` is specified on community events. The `isPullRequest` property is a boolean indicating if the discussion is also a pull request (on HF, a PR is a special case of a Discussion). Here is an example value: ```json "discussion": { @@ -152,7 +152,7 @@ The top level property `discussion` is specified on community events. The `isPul ### Comment -The top level property `comment` is specified when a comment is created (including on discussion creation) or updated. Sample payload: +The top level property `comment` is specified when a comment is created (including on discussion creation) or updated. Here is an example value: ```json "comment": { From 01574e58b0c822f139f81ba99892cbf7a1b94e07 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 14 Dec 2022 17:39:03 +0100 Subject: [PATCH 16/26] =?UTF-8?q?=E2=9C=8F=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 04d280dea..ad359f325 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -170,7 +170,7 @@ The top level property `comment` is specified when a comment is created (includi ## Webhook secret -If you set a secret for your webhook, it will be sent along as a `X-Webhook-Secret` HTTP header on every request. Only ASCII characters are supported. +If you set a secret for your webhook, it will be sent along as an `X-Webhook-Secret` HTTP header on every request. Only ASCII characters are supported. You can also change the URL of the webhook to add a secret to the URL. For example, setting it to `https://example.com/webhook?secret=XXX`. From 99e742cce83d1a0a3bab7054c5bf6ca833d78dcd Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 14 Dec 2022 17:55:39 +0100 Subject: [PATCH 17/26] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Proof=20reading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index ad359f325..e6ac1153f 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -4,19 +4,19 @@ Webhooks are a foundation for MLOps related features. You can use this to auto-c They allow you to react when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). -You can configure the webhooks in your [settings](https://huggingface.co/settings/webhooks). +You can configure the webhooks in your [settings](https://huggingface.co/settings/webhooks): ![Settings of an individual webhook](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/webhook-settings.png) -You can watch repo changes and discussions / pull requests / comments. You can even use a Space to react to webhooks! In the screenshot, the user `coyotte508` created a space named `webhooks` that reacts to webhooks. +You can watch repo changes and discussions / pull requests / comments. You can even use a Space to react to webhooks! - + ## Webhook Payloads After registering a webhook, you will be notified of events via an `HTTP POST` call on the specified URL. The payload is encoded in JSON. -You can check the last payloads sent in the activity tab of the webhook page, as well as replay webhooks. +You can check the last payloads sent in the activity tab of the webhook page, as well as replay webhooks: ![image.png](https://s3.amazonaws.com/moonup/production/uploads/1671034300077-61d2f90c3c2083e1c08af22d.png) @@ -82,11 +82,9 @@ As an example, here is the full payload when a pull request is opened: The top-level properties `event` is always specified and used to determine the nature of the event. -It has two sub-properties: `action` and `scope`. +It has two sub-properties: `event.action` and `event.scope`. -`action` can take one of the following values: `"create"`, `"delete"`, `"update"`, `"move"`. - -`scope` can be one of the following values: +`event.scope` can take one of the following values: - `"repo"` - Global events on repos. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`, `"move"`. - `"repo.content"` - Events on the content of the repo, like new commits or tags. Triggers on new pull requests as well due to the newly created reference / commit. The associated `action` is always `"update"`. @@ -94,9 +92,9 @@ It has two sub-properties: `action` and `scope`. - `"discussion"` - Creating a discussion or pull request, updating the title or status (including merging). Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`. - `"discussion.comment"` - Creating, updating, hiding a comment. Possible values for the associated `action`: `"create"`, `"update"`. -More scopes can be added in the future. As a rule a thumb, any event on a scope can be considered as an `"update"` action on the broader scope. +More scopes can be added in the future. To handle unknown events, your webhook handler can consider any action on a narrowed scope to be an `"update"` action on the broader scope. -For example, if the `"repo.config.dois"` scope is added in the future, any event with that scope can be considered by your application as an `"update"` action on the `"repo.config"` scope. +For example, if the `"repo.config.dois"` scope is added in the future, any event with that scope can be considered by your webhook handler as an `"update"` action on the `"repo.config"` scope. ### Repo @@ -124,11 +122,11 @@ In the current version of webhooks, the top level property `repo` is always spec } ``` -`headSha` is only sent when the `scope` starts with `"repo"`, it's not sent on community events like discussions and comments. +`repo.headSha` is the sha of the latest commit on the repo's `main` branch. It is only sent when `event.scope` starts with `"repo"`, not on community events like discussions and comments. ### Discussion -The top level property `discussion` is specified on community events. The `isPullRequest` property is a boolean indicating if the discussion is also a pull request (on HF, a PR is a special case of a Discussion). Here is an example value: +The top level property `discussion` is specified on community events. The `discussion.isPullRequest` property is a boolean indicating if the discussion is also a pull request (on HF, a PR is a special case of a Discussion). Here is an example value: ```json "discussion": { @@ -175,7 +173,7 @@ If you set a secret for your webhook, it will be sent along as an `X-Webhook-Sec You can also change the URL of the webhook to add a secret to the URL. For example, setting it to `https://example.com/webhook?secret=XXX`. -This can be helpful if accessing the HTTP headers of the request is complicated for your application listening to webhooks. +This can be helpful if accessing the HTTP headers of the request is complicated for your webhook handler. ## Debugging webhooks @@ -186,4 +184,4 @@ Go in the activity tab for your webhook, there you will see the list of recent e You will see the HTTP status code and the payload of the events. You can replay events too by clicking on the `replay` button! -You can also change the url or secret of your webhook and then replay an event, it will send the payload to the updated URL. \ No newline at end of file +It is possible to change the url or secret of the webhook and then replay an event; it will send the payload to the updated URL. \ No newline at end of file From 7f284f8b2ebb1a99211b40625878bcf85a31a7db Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 14 Dec 2022 22:03:35 +0100 Subject: [PATCH 18/26] =?UTF-8?q?=F0=9F=93=9D=20Improve=20secrets=20doc=20?= =?UTF-8?q?+=20document=20daily=20triggers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index e6ac1153f..45d79f7fa 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -168,6 +168,8 @@ The top level property `comment` is specified when a comment is created (includi ## Webhook secret +Setting a webhook secret is useful to make sure payloads sent to your webhook handler come from Hugging Face. + If you set a secret for your webhook, it will be sent along as an `X-Webhook-Secret` HTTP header on every request. Only ASCII characters are supported. @@ -176,6 +178,10 @@ You can also change the URL of the webhook to add a secret to the URL. For examp This can be helpful if accessing the HTTP headers of the request is complicated for your webhook handler. +## Rate limiting + +Each webhook is limited to 1000 triggers per 24 hours. You can check the daily triggers for your webhook in your webhook settings, in the "Activity" tab. + ## Debugging webhooks Go in the activity tab for your webhook, there you will see the list of recent events. From af5253331da91054ebc8e16dfe2199aa67296f3f Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 14 Dec 2022 22:05:02 +0100 Subject: [PATCH 19/26] =?UTF-8?q?fixup!=20=F0=9F=93=9D=20Improve=20secrets?= =?UTF-8?q?=20doc=20+=20document=20daily=20triggers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 45d79f7fa..6e9208e6b 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -180,7 +180,9 @@ This can be helpful if accessing the HTTP headers of the request is complicated ## Rate limiting -Each webhook is limited to 1000 triggers per 24 hours. You can check the daily triggers for your webhook in your webhook settings, in the "Activity" tab. +Each webhook is limited to 1,000 triggers per 24 hours. You can check the daily triggers for your webhook in your webhook settings, in the "Activity" tab. + +If you need to increase the number of triggers for your webhook, contact us at website@huggingface.co. ## Debugging webhooks From efb995df424e4b02cc24dba9fc76414444643c1e Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 14 Dec 2022 22:31:30 +0100 Subject: [PATCH 20/26] =?UTF-8?q?=F0=9F=92=AC=20Update=20payloads?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/hub/webhooks.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 6e9208e6b..81ae672dc 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -32,14 +32,13 @@ As an example, here is the full payload when a pull request is opened: "repo": { "type": "model", "name": "gpt2", - "gitalyUid": "aed40ec4b80dfaffc3f076570c546561e00e5e2a95de8166bea95dd930b76387", "id": "621ffdc036468d709f17434d", "private": false, "url": { "web": "https://hugginface.co/gpt2", "api": "https://hugginface.co/api/models/gpt2" }, - "author": { + "owner": { "id": "628b753283ef59b5be89e937" } }, @@ -104,7 +103,6 @@ In the current version of webhooks, the top level property `repo` is always spec "repo": { "type": "model", "name": "some-user/some-repo", - "gitalyUid": "583c43bd0009f32d976f788446d5010ed6ea4af0c6d0235358378cb56d312f2b", "id": "6366c000a2abcdf2fd69a080", "private": false, "url": { @@ -116,7 +114,7 @@ In the current version of webhooks, the top level property `repo` is always spec "license:other", "has_space" ], - "author": { + "owner": { "id": "61d2000c3c2083e1c08af22d" } } From 75ab75a40b7364839657a05c4fab277b394f8f92 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Mon, 19 Dec 2022 11:58:41 +0100 Subject: [PATCH 21/26] Update docs/hub/webhooks.md Co-authored-by: Omar Sanseviero --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 81ae672dc..0750c3322 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -171,7 +171,7 @@ Setting a webhook secret is useful to make sure payloads sent to your webhook ha If you set a secret for your webhook, it will be sent along as an `X-Webhook-Secret` HTTP header on every request. Only ASCII characters are supported. -You can also change the URL of the webhook to add a secret to the URL. For example, setting it to `https://example.com/webhook?secret=XXX`. +You can also change the URL of the webhook to add a secret to the URL. For example, setting it to https://example.com/webhook?secret=XXX. This can be helpful if accessing the HTTP headers of the request is complicated for your webhook handler. From 7c400b5ff417440e635d2faa0a981ac5203c5b59 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Mon, 19 Dec 2022 11:58:49 +0100 Subject: [PATCH 22/26] Update docs/hub/webhooks.md Co-authored-by: Omar Sanseviero --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 0750c3322..f046c22b7 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -1,6 +1,6 @@ # Webhooks -Webhooks are a foundation for MLOps related features. You can use this to auto-convert models, build community bots, or build CI/CD for your datasets or Spaces… +Webhooks are a foundation for MLOps related features. You can use this to auto-convert models, build community bots, or build CI/CD for your models, datasets, and Spaces. They allow you to react when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). From 23f96c4dfaa32c45f838bc4ea47849a29e9e33b4 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Mon, 19 Dec 2022 11:59:36 +0100 Subject: [PATCH 23/26] Apply suggestions from code review Co-authored-by: Omar Sanseviero --- docs/hub/webhooks.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index f046c22b7..4586865dc 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -8,7 +8,7 @@ You can configure the webhooks in your [settings](https://huggingface.co/setting ![Settings of an individual webhook](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/webhook-settings.png) -You can watch repo changes and discussions / pull requests / comments. You can even use a Space to react to webhooks! +You can watch repo changes, discussions, and Pull requests and comments. You can even use a Space to react to webhooks! @@ -21,7 +21,7 @@ You can check the last payloads sent in the activity tab of the webhook page, as ![image.png](https://s3.amazonaws.com/moonup/production/uploads/1671034300077-61d2f90c3c2083e1c08af22d.png) -As an example, here is the full payload when a pull request is opened: +As an example, here is the full payload when a Pull request is opened: ```json { @@ -86,10 +86,10 @@ It has two sub-properties: `event.action` and `event.scope`. `event.scope` can take one of the following values: - `"repo"` - Global events on repos. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`, `"move"`. -- `"repo.content"` - Events on the content of the repo, like new commits or tags. Triggers on new pull requests as well due to the newly created reference / commit. The associated `action` is always `"update"`. -- `"repo.config"` - Events on the config: update space secrets, update settings, update DOIs, disabled or not, ... The associated `action` is always `"update"`. -- `"discussion"` - Creating a discussion or pull request, updating the title or status (including merging). Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`. -- `"discussion.comment"` - Creating, updating, hiding a comment. Possible values for the associated `action`: `"create"`, `"update"`. +- `"repo.content"` - Events on the repo's content, such as new commits or tags. It triggers on new Pull requests as well due to the newly created reference/commit. The associated `action` is always `"update"`. +- `"repo.config"` - Events on the config: update Space secrets, update settings, update DOIs, disabled or not, etc. The associated `action` is always `"update"`. +- `"discussion"` - Creating a discussion or Pull request, updating the title or status, and merging. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`. +- `"discussion.comment"` - Creating, updating, and hiding a comment. Possible values for the associated `action`: `"create"`, `"update"`. More scopes can be added in the future. To handle unknown events, your webhook handler can consider any action on a narrowed scope to be an `"update"` action on the broader scope. @@ -122,9 +122,9 @@ In the current version of webhooks, the top level property `repo` is always spec `repo.headSha` is the sha of the latest commit on the repo's `main` branch. It is only sent when `event.scope` starts with `"repo"`, not on community events like discussions and comments. -### Discussion +### Discussion and Pull Requests -The top level property `discussion` is specified on community events. The `discussion.isPullRequest` property is a boolean indicating if the discussion is also a pull request (on HF, a PR is a special case of a Discussion). Here is an example value: +The top level property `discussion` is specified on community events (discussions and Pull requests). The `discussion.isPullRequest` property is a boolean indicating if the discussion is also a Pull request (on the Hub, a PR is a special case of a discussion). Here is an example value: ```json "discussion": { From f2ce39699548a4f88c5b8501712d55f01277130e Mon Sep 17 00:00:00 2001 From: Eliott C Date: Mon, 26 Dec 2022 16:14:41 +0100 Subject: [PATCH 24/26] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Victor Muštar --- docs/hub/webhooks.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 4586865dc..75d4b6573 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -1,22 +1,22 @@ # Webhooks -Webhooks are a foundation for MLOps related features. You can use this to auto-convert models, build community bots, or build CI/CD for your models, datasets, and Spaces. +Webhooks are a foundation for MLOps related features. You can use them to auto-convert models, build community bots, or build CI/CD for your models, datasets, and Spaces. -They allow you to react when new changes happen on specific repos or repos belonging to specific users / organizations (not just your repos, but any repo!). +They allow you to listen for new changes on specific repos or repos belonging to particular users/organizations (not just your repos, but any repo!). -You can configure the webhooks in your [settings](https://huggingface.co/settings/webhooks): +You can create new webhooks and edit exiting ones in your webhooks [settings](https://huggingface.co/settings/webhooks): ![Settings of an individual webhook](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/webhook-settings.png) -You can watch repo changes, discussions, and Pull requests and comments. You can even use a Space to react to webhooks! +Webhooks can watch for repos updates, Pull requests, discussions, and new comments. It's even possible to create a Space to react to your webhooks! ## Webhook Payloads -After registering a webhook, you will be notified of events via an `HTTP POST` call on the specified URL. The payload is encoded in JSON. +After registering a webhook, you will be notified of new events via an `HTTP POST` call on the specified target URL. The payload is encoded in JSON. -You can check the last payloads sent in the activity tab of the webhook page, as well as replay webhooks: +You can view the history of payloads sent in the activity tab of the webhook settings page, it's also possible to replay past webhooks for easier debugging: ![image.png](https://s3.amazonaws.com/moonup/production/uploads/1671034300077-61d2f90c3c2083e1c08af22d.png) @@ -83,7 +83,7 @@ The top-level properties `event` is always specified and used to determine the n It has two sub-properties: `event.action` and `event.scope`. -`event.scope` can take one of the following values: +`event.scope` will be one of the following values: - `"repo"` - Global events on repos. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`, `"move"`. - `"repo.content"` - Events on the repo's content, such as new commits or tags. It triggers on new Pull requests as well due to the newly created reference/commit. The associated `action` is always `"update"`. @@ -124,7 +124,7 @@ In the current version of webhooks, the top level property `repo` is always spec ### Discussion and Pull Requests -The top level property `discussion` is specified on community events (discussions and Pull requests). The `discussion.isPullRequest` property is a boolean indicating if the discussion is also a Pull request (on the Hub, a PR is a special case of a discussion). Here is an example value: +The top-level property `discussion` is specified on community events (discussions and Pull requests). The `discussion.isPullRequest` property is a boolean indicating if the discussion is also a Pull request (on the Hub, a PR is a special type of discussion). Here is an example value: ```json "discussion": { @@ -166,19 +166,19 @@ The top level property `comment` is specified when a comment is created (includi ## Webhook secret -Setting a webhook secret is useful to make sure payloads sent to your webhook handler come from Hugging Face. +Setting a webhook secret is useful to make sure payloads sent to your webhook handler URL are from Hugging Face. If you set a secret for your webhook, it will be sent along as an `X-Webhook-Secret` HTTP header on every request. Only ASCII characters are supported. -You can also change the URL of the webhook to add a secret to the URL. For example, setting it to https://example.com/webhook?secret=XXX. +It's also possible to add the secret directly in the handler URL. For example, setting it as a query parameter: https://example.com/webhook?secret=XXX. This can be helpful if accessing the HTTP headers of the request is complicated for your webhook handler. ## Rate limiting -Each webhook is limited to 1,000 triggers per 24 hours. You can check the daily triggers for your webhook in your webhook settings, in the "Activity" tab. +Each webhook is limited to 1,000 triggers per 24 hours. You can view your usage in the Webhook settings page in the "Activity" tab. If you need to increase the number of triggers for your webhook, contact us at website@huggingface.co. @@ -188,6 +188,6 @@ Go in the activity tab for your webhook, there you will see the list of recent e ![image.png](https://s3.amazonaws.com/moonup/production/uploads/1671035382840-61d2f90c3c2083e1c08af22d.png) -You will see the HTTP status code and the payload of the events. You can replay events too by clicking on the `replay` button! +You will see the HTTP status code and the payload of past events. You can replay those events by clicking on the `replay` button! -It is possible to change the url or secret of the webhook and then replay an event; it will send the payload to the updated URL. \ No newline at end of file +When changing the target URL or secret of a webhook, replaying an event will send the payload to the updated URL. \ No newline at end of file From e824dc724e410bb367df561c10e00573c9bc0fb9 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Sun, 8 Jan 2023 12:47:47 +0100 Subject: [PATCH 25/26] Add link to webhooks-explorers --- docs/hub/webhooks.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 75d4b6573..31cd82ab9 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -1,5 +1,7 @@ # Webhooks +**Join the [webhooks-explorer](https://huggingface.co/webhooks-explorers) organization to beta-test webhooks!** + Webhooks are a foundation for MLOps related features. You can use them to auto-convert models, build community bots, or build CI/CD for your models, datasets, and Spaces. They allow you to listen for new changes on specific repos or repos belonging to particular users/organizations (not just your repos, but any repo!). @@ -190,4 +192,4 @@ Go in the activity tab for your webhook, there you will see the list of recent e You will see the HTTP status code and the payload of past events. You can replay those events by clicking on the `replay` button! -When changing the target URL or secret of a webhook, replaying an event will send the payload to the updated URL. \ No newline at end of file +When changing the target URL or secret of a webhook, replaying an event will send the payload to the updated URL. From a4107d96e3a5068a41f850c5a7c3ba89ce689099 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Mon, 9 Jan 2023 00:05:25 +0100 Subject: [PATCH 26/26] Typo --- docs/hub/webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index 31cd82ab9..44a402587 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -1,6 +1,6 @@ # Webhooks -**Join the [webhooks-explorer](https://huggingface.co/webhooks-explorers) organization to beta-test webhooks!** +**Join the [webhooks-explorers](https://huggingface.co/webhooks-explorers) organization to beta-test webhooks!** Webhooks are a foundation for MLOps related features. You can use them to auto-convert models, build community bots, or build CI/CD for your models, datasets, and Spaces.