Skip to content

feat: trigger strict inngest ci background workflow via native edge ingestion#85

Merged
deekshithgowda85 merged 4 commits into
deekshithgowda85:prodfrom
trivikramkalagi91-commits:feature/inngest-ci-trigger
Jun 2, 2026
Merged

feat: trigger strict inngest ci background workflow via native edge ingestion#85
deekshithgowda85 merged 4 commits into
deekshithgowda85:prodfrom
trivikramkalagi91-commits:feature/inngest-ci-trigger

Conversation

@trivikramkalagi91-commits
Copy link
Copy Markdown
Contributor

@trivikramkalagi91-commits trivikramkalagi91-commits commented Jun 2, 2026

Description

Closes #23

This PR adds an automated CI pipeline that tells Inngest to run background tasks when code is pushed or a PR is opened against the prod branch.

What Changed

  • .github/workflows/ci.yml: Made the workflow run on push and pull_request for the prod branch. Added paths-ignore so it skips running if only markdown or docs are changed. Set it to send data directly to Inngest's real endpoint (https://inn.gset.io/e/).
  • lib/inngest.ts: Added the new ci/workflow.triggered event type. Listed all 8 existing events alongside it explicitly so everything stays perfectly type-safe without using wildcards like any.
  • app/api/inngest/route.ts: Registered the new handleCiWorkflow background function safely inside the standard Inngest serve array.

Verification

  • Checked that the webhook hits the correct domain (https://inn.gset.io/e/).
  • Ran npm run build and the production build passed completely with zero TypeScript errors or warnings.

note :- i have used Ai but tried to understand and implemented it instead of simply changing

Summary by CodeRabbit

  • New Features

    • Added automated CI event triggering capability to connect with external workflows.
  • Improvements

    • Optimized CI pipeline configuration to run only on production branch and skip documentation-only changes.
    • Enhanced event schema handling for improved type safety and event mapping reliability.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@trivikramkalagi91-commits is attempting to deploy a commit to the Deekshith Gowda HS's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Warning

Review limit reached

@trivikramkalagi91-commits, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 476ad3b7-9a71-458c-8410-6ce2b962f11a

📥 Commits

Reviewing files that changed from the base of the PR and between ea20368 and 9711592.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • app/api/inngest/route.ts
📝 Walkthrough

Walkthrough

This PR adds CI-triggered Inngest workflow support by narrowing GitHub Actions triggers to push and pull_request on the prod branch (with doc-only exclusions), defining typed event schemas in the Inngest client, adding a webhook call step in CI, and implementing a handler function to process the incoming CI workflow events.

Changes

CI-triggered Inngest Workflow

Layer / File(s) Summary
Inngest Event Schema and Client Setup
lib/inngest.ts
Defines an Events type mapping event names to typed data payloads, updates imports to include EventSchemas, and reconfigures the inngest client to use schema validation instead of environment-based eventKey configuration.
CI Workflow Trigger and Inngest Webhook
.github/workflows/ci.yml
Restricts push and pull_request triggers to the prod branch and adds paths-ignore filters for docs. Adds a GitHub Actions step that posts the current Git ref and SHA to the Inngest webhook endpoint using secrets.INNGEST_EVENT_KEY.
Event Handler and Type Constraints
app/api/inngest/route.ts, app/api/tests/run/route.ts
Implements handleCiWorkflow function to handle the ci/workflow.triggered event and wire it into the Inngest route handler. Constrains EVENT_MAP type to a union of specific Inngest event name strings for type safety.

🎯 3 (Moderate) | ⏱️ ~20 minutes


🐰 A rabbit's quest through workflow flow,
Events now typed, schemas aglow,
CI builds merge to prod with a bound,
Inngest listens for each triggered sound,
Webhooks and handlers dance all around! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: triggering an Inngest CI background workflow via GitHub Actions integration with type-safe event handling.
Linked Issues check ✅ Passed All coding requirements from issue #23 are met: CI workflow added for push/pull_request events [.github/workflows/ci.yml], docs-only skip via paths-ignore filter implemented, Inngest webhook integration added, event types defined in lib/inngest.ts, and handleCiWorkflow registered in app/api/inngest/route.ts.
Out of Scope Changes check ✅ Passed All changes directly support issue #23 objectives: CI workflow configuration, Inngest event schema definition, webhook integration, and background function handling—no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 71-81: Gate the "Trigger Inngest CI Workflow" step on the presence
of the INNGEST_EVENT_KEY secret and make curl fail on non-2xx responses: add an
if condition that checks secrets.INNGEST_EVENT_KEY is not empty (e.g., if: ${{
secrets.INNGEST_EVENT_KEY != '' }} ) to the step named "Trigger Inngest CI
Workflow", and change the curl invocation to use --fail or --fail-with-body (or
check the HTTP status and exit non-zero) when POSTing to the Inngest endpoint
using the secret variable.

In `@app/api/inngest/route.ts`:
- Around line 11-21: The handler handleCiWorkflow currently just logs and
returns a static status, so it never kicks off downstream work; update
handleCiWorkflow to either (A) construct the full run payload from event.data
(include ref, sha, repo and any required metadata) and call the existing
run-creation function (e.g., createRun or enqueueRun) to persist/enqueue the job
inside the step.run block, or (B) emit the proper downstream Inngest event
(e.g., call inngest.send/eventDispatch or the project’s sendEvent wrapper) that
your test/workflow consumer listens for (the same event name used by the test
workflow), ensuring you pass the required payload fields so the test workflow
can start; keep this work inside the async step.run to preserve observability
and error handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c554598-fe59-4f06-b09e-d170d4528abf

📥 Commits

Reviewing files that changed from the base of the PR and between c042846 and ea20368.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • app/api/inngest/route.ts
  • app/api/tests/run/route.ts
  • lib/inngest.ts

Comment thread .github/workflows/ci.yml
Comment thread app/api/inngest/route.ts
@trivikramkalagi91-commits
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@deekshithgowda85 deekshithgowda85 merged commit 6fc19c1 into deekshithgowda85:prod Jun 2, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Trigger Inngest workflows on push and pull_request

2 participants