Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Webhook] update doc#19974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alli83 wants to merge1 commit intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromalli83:webhook-update-doc
Open

Conversation

alli83
Copy link
Contributor

Update the webhook documentation

@alli83alli83 marked this pull request as draftJune 18, 2024 22:42
@carsonbotcarsonbot added this to the6.4 milestoneJun 18, 2024
@carsonbotcarsonbot changed the title[WEBHOOK]: update doc[Webhook] : update docJun 18, 2024
------------------------------------------------------------------

It is important to note that when the incoming webhook is processed by the :class:`WebhookController`, you have the option to handle the consumption of remote events asynchronously.
Indeed, this can be configured using a bus, with the default setting pointing to the Messenger component's default bus.
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

todo: show config

@alli83alli83force-pushed thewebhook-update-doc branch 13 times, most recently frombb79ac4 to581043fCompareJune 19, 2024 13:16
@alli83alli83 marked this pull request as ready for reviewJuly 1, 2024 07:20
Copy link
Member

@kbondkbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just had time for a quick review of the first bit of this document.

I was a bit confused on "who was the consumer and who was the provider".

@mxr576
Copy link

Thanks for this PR, the Webhook component deserves a high quality and detailed documentation!

@faizanakram99
Copy link
Contributor

faizanakram99 commentedJan 10, 2025
edited
Loading

@javiereguiluz what is preventing this PR from being merged?

Is there anything pending?

The server part of webhook still remains undocumented, it is a super useful feature of symfony especially when combined with api platform (or simply openapi docs), i think not many people know symfony can also send webhooks (not just consume them).

Symfony Webhook, when used alongside Symfony RemoteEvent, streamlines the management of these fundamental phases.

A Single Entry Endpoint: Receive
--------------------------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shouldn't this be a sub-heading of theConsuming Webhooks section instead ? With the new doc covering both consuming and providing webhooks, I think we should have only 3h2 titles:Installation,Consuming webhooks andProviding webhooks

The routing name must be unique as this is what connects the provider with your
webhook consumer code.

.. code-block:: yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this should use aconfiguration-block to show the configuration in all formats

For example, you can use Mercure to broadcast updates to clients of the hub, among other actions ...::

// src/Webhook/ExampleRequestParser.php
#[AsRemoteEventConsumer('my_first_parser')] # routing name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
#[AsRemoteEventConsumer('my_first_parser')]# routing name
#[AsRemoteEventConsumer('my_first_parser')]// routing name

We don't use# as a delimiter for line comments in the Symfony coding standards

you will need to configure the settings (as mentioned earlier) and also create your own consumer.
This is necessary because it involves your own business logic and your specific reactions to the remote event(s) that may be received from the built-in parsers.

Usage in Combination with the Mailer Component
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm not sure having 2 sections about using it in combination with mailer and notifier in the page (one in the section about the parser and one in the section about the handler) makes sense. I think it might be better to organize the content the other way around:

  • usage with mailer
  • usage with notifier
  • usage with custom webhooks (talking about both the request parser and the handler)

It's crucial to understand that the :class:`Symfony\\Component\\Webhook\\Controller\\WebhookController` itself remains provider-agnostic, utilizing
a routing mechanism to determine which parser should handle incoming webhooks for analysis.

As mentioned earlier, incoming webhooks require a specific prefix to be directed to the :class:`Symfony\\Component\\Webhook\\Controller\\WebhookController`.
Copy link
Member

@stofstofMar 4, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think this section gives far too much details about the WebhookController, which are irrelevant for most users as they won't ever touch it directly, while not explaining the high-level picture:

webhooks are received on a URL<prefix>/<routing-name> and routed to the appropriate request parser and handler based on the routing name.

That's the info that users need to have, with configuration examples in all formats for the routing configuration

@OskarStarkOskarStark changed the title[Webhook] : update doc[Webhook] update docMar 4, 2025
@stof
Copy link
Member

stof commentedMar 4, 2025

thinking about this again, I think we should rather talk aboutSender orDispatcher instead ofProvider. There is no place in the code where we ever talk about "providing" webhooks.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kbondkbondkbond left review comments

@stofstofstof requested changes

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

6 participants
@alli83@mxr576@faizanakram99@stof@kbond@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp