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

Add Webhook-Ingest service using NATS JetStream #61

Merged
merged 42 commits into from
Aug 19, 2024

Conversation

FelixTJDietrich
Copy link
Collaborator

@FelixTJDietrich FelixTJDietrich commented Aug 16, 2024

Motivation

We want to have a reliable way of receiving webhook messages from GitHub etc. Additionally, we want to subscribe to past and future webhooks also for development porposes.

Description

Add a webhook-ingest FastAPI service that can receive webhooks from GitHub and publishes them to NATS JetStorm.

We will host this soon on a server to collect GitHub data already. JetSteam will persist the messages and send them to any subscriber in the future.

Additionally, this PR adds a VSCode workspace since this was the only way of getting the venv to work for me with IntelliSense etc.

Testing

I hosted the NATS server temporarily on tls://nats.heph.felixdietrich.com with access token asdf, it receives all webhook events from the Hephaestus repo.

Install natscli (Repo)

brew tap nats-io/nats-tools
brew install nats-io/nats-tools/nats

Examples:

View past webhook data:
nats --server tls://[email protected] stream view github

Subscribe to incoming webhooks and then interact with the Hephaestus Repo:
nats --server tls://[email protected] sub "github.>"

Screenshots

Using nats --server tls://[email protected] stream subjects:
image

Checklist

General

  • PR title is clear and descriptive
  • PR description explains the purpose and changes
  • Code follows project coding standards
  • Self-review of the code has been done
  • Changes have been tested locally
  • Screenshots have been attached (if applicable)
  • Documentation has been updated (if applicable)

Server

  • Code is performant and follows best practices
  • No security vulnerabilities introduced
  • Proper error handling has been implemented
  • Added tests for new functionality
  • Changes have been tested in different environments (if applicable)

@github-actions github-actions bot added feature size:XXL This PR changes 1000+ lines, ignoring generated files. labels Aug 16, 2024
@FelixTJDietrich
Copy link
Collaborator Author

test comment :)

@FelixTJDietrich
Copy link
Collaborator Author

FelixTJDietrich commented Aug 17, 2024

I think it is ready now, debugged forever why it was not working with authentication. The reason was Python 3.9 and that's why I switched to 3.12

@FelixTJDietrich FelixTJDietrich merged commit 8ae59a2 into develop Aug 19, 2024
3 checks passed
@FelixTJDietrich FelixTJDietrich deleted the feature/nats-webhook-publisher branch August 19, 2024 19:28
@FelixTJDietrich
Copy link
Collaborator Author

Will just merge this and host it on our VM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature size:XXL This PR changes 1000+ lines, ignoring generated files. webhook-ingest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant