| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
SentinelEngine PR Bot is a serverless GitHub App that intercepts Pull Request webhooks, analyzes the abstract syntax tree (AST) of the code changes, and calculates the projected Cloud Billing impact (Cost Delta) before the code is merged.
This bot is fully integrated with the core CloudGauge Backend which performs the heavy-lifting AST logic.
https://github.com/apps/sentinelengine-bot
https://github.com/apps/cloudgauge-bot
Your .env file should look like this:
APP_ID=<your-github-app-id>
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
WEBHOOK_SECRET=<your-webhook-secret>
WEBHOOK_PROXY_URL=https://smee.io/<your-unique-hash>(Note: We use smee.io as the proxy because it natively integrates with Probot and never drops connections, unlike localtunnel.)
# Install dependencies
npm install
# Start the bot
npm startYou should see:
INFO (server): Connected to https://smee.io/...
INFO (server): Listening on http://localhost:3000
The Markdown comment generated by the Bot is 100% dynamic. It relies on the CloudGauge AST engine to parse actual code.
For example, if a developer writes:
for (let i = 0; i < 1000; i++) {
const completion = await openai.chat.completions.create({
model: "gpt-4",
messages: [{ role: "user", content: "Hello" }],
});
}The server AST engine will calculate that this gpt-4 call is inside a for-loop (Execution Context = Loop), drastically increasing its cost weight, and will dynamically return a +$750/mo delta in the resulting PR comment table.
If the developer removes an AWS Lambda function, the dynamic PR comment will correctly show a negative (savings) delta.
⚡ Powered by SentinelEngine.
| Back | FazBrowse Home | New Git URL |