feat(api): wire Probot I2 enforcement into epicon-api (C-368 PR5 deploy)#17
Conversation
When APP_ID and PRIVATE_KEY are configured, epicon-api starts the Guard App (Probot) with manifest/health routes on the same port. Falls back to transport-only mode when credentials are absent. Render blueprint now builds from repo root so workspace packages resolve. Co-authored-by: michaeljjudan <michaeljjudan@gmail.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0559c76dcf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (probotConfigured) { | ||
| const { createGuardApp } = await import('../../../apps/guard-app/src/index.js'); | ||
| const probot = createGuardApp({ webhookPath: WEBHOOK_PATH }); | ||
| const app = probot.server; |
There was a problem hiding this comment.
Start Probot with a real Server before adding routes
In the configured Render path (APP_ID + PRIVATE_KEY set), createGuardApp() returns a Probot instance, but Probot 13.4.7 (the version pinned in package-lock.json) does not expose a server property on that class; the Express app is created through the Server API or createNodeMiddleware. That leaves app undefined here, so the next app.get(...) throws before the service can listen, making the new probot-i2 mode fail to boot as soon as the credentials are configured.
Useful? React with 👍 / 👎.
Probot 13.4.x does not expose probot.server on the Probot class. Wire epicon-api through Server + guardAppFn load pattern so probot-i2 mode boots when APP_ID and PRIVATE_KEY are configured. Co-authored-by: michaeljjudan <michaeljjudan@gmail.com>
Mobius PR — Cycle
1. Summary
Completes PR5 deployment wiring: epicon-api now starts Probot I2 enforcement when
APP_IDandPRIVATE_KEYare set on Render. Without those credentials it falls back to transport-only mode (current production behavior). Render blueprint builds from repo root so workspace packages (guard-app,guard-core) resolve.2. Details
server.mjsbranches onAPP_ID+PRIVATE_KEY→createGuardApp()with/api/github/webhook/healthreportsenforcement_mode:probot-i2|transport-onlyrender.yamlrootDir., env vars for App credentials3. EPICON Intent
4. Operator next step
On Render
epicon-apiservice, set:APP_ID— GitHub App IDPRIVATE_KEY— PEM private keyGITHUB_WEBHOOK_SECRET— webhook secret (already required)WEBHOOK_PATH=/api/github/webhookRedeploy →
/healthshould show"enforcement_mode":"probot-i2".Manual acceptance: edit a test PR intent without version bump → Check Run fails with I2 VIOLATION.