edujanicas / codehook Goto Github PK
View Code? Open in Web Editor NEWA webhook deployer, getting a little help from natural language
Home Page: https://codehook.ai
License: MIT License
A webhook deployer, getting a little help from natural language
Home Page: https://codehook.ai
License: MIT License
Take template and inject new function in the middle
Return full handler
No hardcoded values
Describe the bug
When calling DeleteRestAPI, codehook consistently gets
An error occurred (TooManyRequestsException) when calling the DeleteRestApi operation (reached max retries: 4): Too Many Requests
back
To Reproduce
Create 2 codehook functions and try to delete --all
Expected behavior
Gracefully retry the deletion 30 seconds after (AWS throttles to 1 requests every 30 seconds)
Is your feature request related to a problem? Please describe.
It's currently not clear the shape of parameters that get fed into the webhook handler function. In order to get people up and running quickly, and support prompt engineering, this needs to be more obvious.
Describe the solution you'd like
Create contract for the handler.py function
Handle a single event
No hardcoded values
Section for injection of logic
CLI tool
Takes lambda function
Deploys behind API Gateway
Return URL
Is your feature request related to a problem? Please describe.
Currently codehook only supports Stripe webhook events. Ideally we want to launch with support for 3 popular different sources.
Describe the solution you'd like
Under codehook/skeletons
lies the handler for different types of event sources. Under codehook/sources/
lives the deployer for each to create a webhook endpoint in each. Add support for Shopify and Slack, as a starter.
Describe alternatives you've considered
https://webhooks.fyi/docs/webhook-directory
Is your feature request related to a problem? Please describe.
Currently, the function being deployed only supports the standard library. Support for extra libraries requires separate Lambda Layers to be deployed.
Describe the solution you'd like
Include all .requirements.txt dependencies in the .zip deployment package generated by the Lambda module.
https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-create-dependencies
Describe alternatives you've considered
Deploying the function as a container image. Although eventually this might be useful to support additional providers, I believe at the moment it is an overkill.
Is your feature request related to a problem? Please describe.
Generic boilerplates are no longer needed when an LLM can get pretty close to the logic you ask it to do. What if we can bootstrap something really close to the whole webhook logic?
Describe the solution you'd like
Make use of OpenAI's ChatCompletions to generate Python code that gets fed into the webhook handler
https://platform.openai.com/docs/quickstart?context=python
Describe alternatives you've considered
Just generate code vs generate and deploy. Ideally the latter
Is your feature request related to a problem? Please describe.
Currently codehook handlers will subscribe to all Stripe events. To avoid noise, handlers need to be able to only select a subset
Describe the solution you'd like
Use the Events enum to list all different event types
Is your feature request related to a problem? Please describe.
We only have one test at the moment. We need much higher test coverage.
Describe the solution you'd like
Improve test coverage to test each command independently, alongside error cases
Take full handler and replace placeholder value by env vars
Is your feature request related to a problem? Please describe.
Currently we need to manually lint and test the repo before each commit. Ideally, this will all be done automatically.
Describe the solution you'd like
GitHub actions pipeline to lint and test each commit, test PRs extensively, and publish releases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.