Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add Github source connector #4416

Open
1 of 3 tasks
qqeasonchen opened this issue Aug 29, 2023 · 8 comments
Open
1 of 3 tasks

[Feature] Add Github source connector #4416

qqeasonchen opened this issue Aug 29, 2023 · 8 comments
Labels
feature help wanted Extra attention is needed

Comments

@qqeasonchen
Copy link
Contributor

qqeasonchen commented Aug 29, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Feature Request

Add Github source connector

Data Source:

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Fungx
Copy link
Contributor

Fungx commented Nov 19, 2023

Hi! I'm interested in this issue. But how can Github be a data source? Can you provide me with an example like the one in #4047 ?

@pandaapo
Copy link
Member

Hi! I'm interested in this issue. But how can Github be a data source? Can you provide me with an example like the one in #4047 ?

Actually, it's similar to this #4047 (comment) . GitHub provides developers with REST API interfaces, GraphQL API interfaces, and Webhooks, all of which can provide rich and diverse data resources.

@Fungx
Copy link
Contributor

Fungx commented Nov 20, 2023

Hi! I'm interested in this issue. But how can Github be a data source? Can you provide me with an example like the one in #4047 ?

Actually, it's similar to this #4047 (comment) . GitHub provides developers with REST API interfaces, GraphQL API interfaces, and Webhooks, all of which can provide rich and diverse data resources.

Thanks for your reply. I think that Webhooks are the most efficient way to retrieve data since they don't need any polling.

But one thing still confuses me. Webhooks require a Payload URL and will make POST requests after certain events have occurred. Is it proper to make the source connector an HTTP server to provide this URL? If we use this approach, perhaps we can implement an HTTP source connector and reuse it in the GitHub source connector.

@pandaapo
Copy link
Member

Thanks for your reply. I think that Webhooks are the most efficient way to retrieve data since they don't need any polling.

But one thing still confuses me. Webhooks require a Payload URL and will make POST requests after certain events have occurred. Is it proper to make the source connector an HTTP server to provide this URL? If we use this approach, perhaps we can implement an HTTP source connector and reuse it in the GitHub source connector.

HTTP source is waiting for implementation. If you are interested, you can implement it first. https://github.com/apache/eventmesh/tree/master/eventmesh-connectors#connector-status

If you want to implement GitHub source first, you can first enable it to support REST API, or GraphQL API, or both. Then, after HTTP source is implemented by community, if it is suitable for GitHub source reuse, you can add Webhooks to GitHub source.

If you only want to implement GitHub source that supports Webhooks first, you can create a lightweight HTTP Server in GitHub source.

@Fungx
Copy link
Contributor

Fungx commented Nov 20, 2023

Thanks for your reply. I think that Webhooks are the most efficient way to retrieve data since they don't need any polling.
But one thing still confuses me. Webhooks require a Payload URL and will make POST requests after certain events have occurred. Is it proper to make the source connector an HTTP server to provide this URL? If we use this approach, perhaps we can implement an HTTP source connector and reuse it in the GitHub source connector.

HTTP source is waiting for implementation. If you are interested, you can implement it first. https://github.com/apache/eventmesh/tree/master/eventmesh-connectors#connector-status

If you want to implement GitHub source first, you can first enable it to support REST API, or GraphQL API, or both. Then, after HTTP source is implemented by community, if it is suitable for GitHub source reuse, you can add Webhooks to GitHub source.

If you only want to implement GitHub source that supports Webhooks first, you can create a lightweight HTTP Server in GitHub source.

Ok, I want to work on HTTP source first ! I will post my design here in a few days.

@Fungx
Copy link
Contributor

Fungx commented Nov 22, 2023

@pandaapo Hi, here is my design. Since I'm new to EventMesh, please let me know if there are any issues!

The HTTP source will be implemented with the native HttpServer.

In source-config.yml,we can configure the path and port. For example, the following configuration creates an API POST http://127.0.0.1:3000/test. We can call it in various ways (e.g. curl, GitHub Webhooks, etc.) to send messages.

connectorConfig:
    connectorName: httpSource
    path: /test
    port: 3000

The HTTP Source Connector converts the request body into a CloudEvent. For convenience, the request body should be provided in json format.

@pandaapo
Copy link
Member

pandaapo commented Nov 22, 2023

The HTTP source will be implemented with the native HttpServer.

In source-config.yml,we can configure the path and port. For example, the following configuration creates an API POST http://127.0.0.1:3000/test. We can call it in various ways (e.g. curl, GitHub Webhooks, etc.) to send messages.

connectorConfig:
    connectorName: httpSource
    path: /test
    port: 3000

The HTTP Source Connector converts the request body into a CloudEvent. For convenience, the request body should be provided in json format.

If you are willing, you can use Jetty, Tomcat, or Netty, which are more stable and efficient implementations of HTTP Server. Of course, if you insist on using the one provided by JDK, that's also okay.

So, this design looks fine to me. What do you think of this design of HTTP Source Connector? @xwm1992

Additionally, @Fungx plans to reuse this connector in the GitHub Source Connector that supports Webhooks. I think that's also fine. What do you think? @xwm1992

@pandaapo
Copy link
Member

Additionally, @Fungx plans to reuse this connector (HTTP Source Connector) in the GitHub Source Connector that supports Webhooks. I think that's also fine. What do you think? @xwm1992

Considering that HTTP Source Connector has already been implemented by @Fungx , it is possible that @Fungx is preparing to implement GitHub Source Connector according to the above plan or is waiting for this reply. Therefore, I think I should draw your attention to this plan again. @xwm1992

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants