Add GitHub bot app using Probot with /health route#2012
Conversation
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughAdds a new Probot-based GitHub bot in Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GitHub as GitHub (Webhook)
participant Probot as Probot App (apps/bot)
participant Octokit as Octokit / GitHub API
Note over GitHub,Probot: Runtime interaction
GitHub->>Probot: POST issues.opened webhook
Probot->>Probot: route /health and event handlers
Probot->>Octokit: POST /repos/:owner/:repo/issues/:number/comments
Octokit-->>Probot: 201 Created (comment)
Probot-->>GitHub: (no direct response, processing done)
sequenceDiagram
autonumber
participant GH as GitHub Actions
participant Flyctl as flyctl (action)
participant Fly as Fly.io
Note over GH,Fly: Deployment flow (bot_cd)
GH->>Flyctl: setup flyctl
GH->>Flyctl: flyctl deploy --remote-only (uses FLY_API_TOKEN)
Flyctl->>Fly: deploy app image / trigger
Fly-->>Flyctl: deployment result
Flyctl-->>GH: exit status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/github/package.json (1)
1-12: Consider adding Node.js engine specification.Specifying the Node.js version ensures compatibility and prevents runtime issues.
Apply this diff:
{ "name": "@hypr/github", "private": true, + "version": "1.0.0", "type": "module", + "engines": { + "node": ">=18.0.0" + }, "scripts": { "dev": "probot run ./src/index.js", "start": "probot run ./src/index.js" }, "dependencies": { "probot": "^13.4.3" } }apps/github/src/index.js (1)
8-11: Consider adding error handling for robustness.While Probot catches unhandled errors, explicit error handling improves debuggability and allows for custom error responses or logging.
Apply this diff:
- app.on("issues.opened", async (context) => { - const comment = context.issue({ body: "Thanks for opening this issue!" }); - return context.octokit.issues.createComment(comment); + app.on("issues.opened", async (context) => { + try { + const comment = context.issue({ body: "Thanks for opening this issue!" }); + await context.octokit.issues.createComment(comment); + context.log.info("Comment posted successfully"); + } catch (error) { + context.log.error({ error }, "Failed to post comment"); + throw error; + } });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/github/package.json(1 hunks)apps/github/src/index.js(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/github/src/index.js (1)
apps/web/src/router.tsx (1)
getRouter(8-30)
🔇 Additional comments (2)
apps/github/src/index.js (1)
4-6: LGTM!The health endpoint is correctly implemented and follows best practices for service monitoring.
apps/github/package.json (1)
10-10: Probot version is secure but has patch updates available.Version 13.4.3 is not vulnerable to CVE-2023-50728 (which affected versions < 12.3.3). However, newer patch versions (13.4.4–13.4.7) are available within the ^13.x range. Consider running
npm installto update to the latest patch, or evaluate upgrading to 14.2.4 for additional features.
…th route Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
apps/github/.dockerignore (1)
1-12: Docker context exclusions are sensible; be aware PEM fixtures won’t be copiedThe ignore list is good for keeping the build context lean and secrets out of images. Note that
**/*.pemwill also excludemock-cert.pemfrom the image, which is fine for runtime but means any tests that rely on that cert need to run outside the container or use a different fixture path.apps/github/src/index.ts (1)
1-16: App logic is correct; consider a small guard aroundgetRouterThe
/healthroute andissues.openedhandler both look correct and align with typical Probot usage. The only nuance isgetRouter!("/"): this assumes the app is always run in a mode wheregetRouteris provided. If you ever use this app in a non-HTTP context (or a different Probot harness), a small defensive guard could avoid a startup error, e.g.:export default (app: Probot, { getRouter }: ApplicationFunctionOptions) => { if (!getRouter) { // Optionally log and skip HTTP routes in non-HTTP environments return; } const router = getRouter("/"); router.get("/health", (_req, res) => { res.send("OK"); }); app.on("issues.opened", async (context) => { const issueComment = context.issue({ body: "Thanks for opening this issue!", }); await context.octokit.issues.createComment(issueComment); }); };If you’re confident
getRouteris always defined in your deployment mode, the current version is fine.apps/github/tsconfig.json (1)
1-25: TS config is solid; consider whether you want tests type‑checked tooThe strict options and Node16/ES2022 module/target choices look good and match the ESM Probot app setup. Currently only
src/is included, sotest/files won’t be covered bytsc -p apps/github/tsconfig.json.If you want tests in your typecheck pipeline, consider either:
- Adding tests to
include, e.g.:or"include": ["src/", "test/"]- Creating a separate
tsconfig.test.jsonthat extends this one and addstest/, and pointing any CI/typecheck scripts at it.After adjusting, please run the repo’s recommended command (
pnpm -r typecheck) to ensure the new settings work cleanly for this package. Based on learnings, this is the standard verification step.apps/github/test/index.test.ts (1)
1-83: Probot issue‑opened test is well‑structured; only minor polish nitsThe test setup (ESM‑style
__dirname, fixture loading, Probot instance configuration, and nock expectations) is sound and should reliably validate theissues.openedhandler behavior. Nothing blocking here.Two small optional cleanups you might consider:
- Type the
probotvariableInstead of
let probot: any;, you can give it the actual type for better editor help if you later expand tests:let probot: Probot;
- Update the Jest references in comments to Vitest
The trailing comments still mention Jest/ts‑jest. Since this package is using Vitest, updating those URLs to Vitest docs (or removing the block entirely) will reduce future confusion.
Please confirm that the
../src/index.jsimport path matches the built ESM entrypoint for this app under the current Node16/ESM configuration (it looks correct for TS Node16 mode, but worth a quick double‑check against your build output).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
apps/github/README.mdis excluded by!**/README*apps/github/test/fixtures/mock-cert.pemis excluded by!**/*.pempnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (13)
apps/github/.dockerignore(1 hunks)apps/github/.gitignore(1 hunks)apps/github/CODE_OF_CONDUCT.md(1 hunks)apps/github/CONTRIBUTING.md(1 hunks)apps/github/Dockerfile(1 hunks)apps/github/LICENSE(1 hunks)apps/github/app.yml(1 hunks)apps/github/package.json(1 hunks)apps/github/src/index.ts(1 hunks)apps/github/test/fixtures/issues.opened.json(1 hunks)apps/github/test/index.test.ts(1 hunks)apps/github/tsconfig.json(1 hunks)apps/github/vitest.config.ts(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/github/LICENSE
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces
Files:
apps/github/test/index.test.tsapps/github/src/index.tsapps/github/vitest.config.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, usecn(import from@hypr/utils). It is similar toclsx. Always pass an array and split by logical grouping.
Usemotion/reactinstead offramer-motion.
Files:
apps/github/test/index.test.tsapps/github/src/index.tsapps/github/vitest.config.ts
**/*.config.{ts,json}
📄 CodeRabbit inference engine (CLAUDE.md)
Agent configuration should be centralized and externalized from implementation logic
Files:
apps/github/vitest.config.ts
🧠 Learnings (4)
📚 Learning: 2025-11-24T16:32:24.348Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: apps/desktop-e2e/AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:24.348Z
Learning: Applies to apps/desktop-e2e/**/*.{test,spec}.{js,ts,tsx} : Refer to `scripts/setup-desktop-e2e.sh` for end-to-end test environment setup if setup is missing
Applied to files:
apps/github/test/index.test.ts
📚 Learning: 2025-11-24T16:32:23.055Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:23.055Z
Learning: After some amount of TypeScript changes, run `pnpm -r typecheck`.
Applied to files:
apps/github/tsconfig.json
📚 Learning: 2025-11-24T16:32:19.706Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:19.706Z
Learning: Applies to **/*.{ts,tsx} : Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props. Just inline them.
Applied to files:
apps/github/tsconfig.json
📚 Learning: 2025-11-24T16:32:23.055Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:23.055Z
Learning: Applies to **/*.{ts,tsx} : Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Applied to files:
apps/github/tsconfig.json
🧬 Code graph analysis (1)
apps/github/test/index.test.ts (1)
apps/web/scripts/gen-agents.js (1)
__dirname(7-7)
🪛 LanguageTool
apps/github/CONTRIBUTING.md
[style] ~15-~15: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 1808 characters long)
Context: ... an issue first to talk about it, though! Look at the links below if you're not s...
(EN_EXCESSIVE_EXCLAMATION)
[grammar] ~33-~33: Use a hyphen to join words.
Context: ...e-about-git-commit-messages.html). Work in Progress pull requests are also welco...
(QB_NEW_EN_HYPHEN)
apps/github/CODE_OF_CONDUCT.md
[style] ~27-~27: Try using a synonym here to strengthen your wording.
Context: ...vances - Trolling, insulting/derogatory comments, and personal or political attacks - Pu...
(COMMENT_REMARK)
[style] ~61-~61: ‘with regard to’ might be wordy. Consider a shorter alternative.
Context: ...s obligated to maintain confidentiality with regard to the reporter of an incident. Further de...
(EN_WORDINESS_PREMIUM_WITH_REGARD_TO)
🔇 Additional comments (6)
apps/github/.gitignore (1)
1-7: Ignore patterns look appropriate for this appIgnoring build output (
lib), env, and certs while explicitly keepingmock-cert.pemis consistent with a TS-based service and test fixtures. No changes needed.apps/github/test/fixtures/issues.opened.json (1)
1-18: Fixture shape matches anissues.openedpayloadThe JSON includes the key fields (action, issue number, user, repo, installation) needed for the handler and tests. Looks good as-is.
apps/github/CODE_OF_CONDUCT.md (1)
1-73: Code of Conduct is standard and appropriateThis is the canonical Contributor Covenant text with the project contact wired in; no changes needed. I’d keep it as-is and ignore automated style suggestions here.
apps/github/app.yml (1)
13-137: Manifest events and permissions align with the implemented handlerSubscribing to
issuesand grantingissues: write+metadata: readis exactly what the current app needs to comment on newly opened issues, without overbroad scopes. Keeping the rest commented for future use is fine.apps/github/package.json (1)
1-36: Package manifest is properly configured for this TS Probot appNode version (v24.3.0) satisfies the engine constraint (≥18). Scripts, dependencies, and tooling are correctly aligned for build, start, and test operations in CI and Docker environments.
apps/github/vitest.config.ts (1)
1-10: Vitest configuration is minimal, valid, and aligned with the test layoutThe include pattern and v8 coverage provider are appropriate for this package; nothing blocking here.
Please run the package tests once this lands (e.g., via your workspace command like
pnpm -F @hypr/github test) to confirm Vitest picks up this config as expected.
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
.github/workflows/bot_cd.yaml (1)
11-11: Verify custom runner availability.Same as the CI workflow, this uses the
depot-ubuntu-24.04-8custom runner. Ensure it's properly configured.
🧹 Nitpick comments (4)
apps/bot/app.yml (1)
126-137: Consider uncommenting and customizing app metadata.The app name, homepage URL, and description are commented out. Consider providing these values to improve the GitHub App's discoverability and user experience.
apps/bot/fly.toml (1)
15-21: Consider increasing min_machines_running for production.Currently
min_machines_running = 1, which means the bot may experience cold starts. If webhook response time is critical, consider increasing this to 2+ machines for high availability.apps/bot/src/index.ts (1)
10-15: Confirm whether the auto “Thanks for opening this issue!” comment is desiredThe
issues.openedhandler will comment on every newly opened issue across all installations. That’s fine for a demo bot, but may be noisy in production.If this is just scaffold behavior, consider either:
- Removing the handler for now, or
- Customizing the message/conditions (e.g. limit to certain repos, labels, or environments).
apps/bot/test/index.test.ts (1)
28-34: Use a concreteProbottype instead ofanyforprobotYou already import
Probot, so you can avoidanyhere and get better type checking/completion:-describe("My Probot app", () => { - let probot: any; +describe("My Probot app", () => { + let probot: Probot;This is purely a type‑safety/readability improvement; runtime behavior is unchanged.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
apps/bot/test/fixtures/mock-cert.pemis excluded by!**/*.pempnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (13)
.github/workflows/bot_cd.yaml(1 hunks).github/workflows/bot_ci.yaml(1 hunks)apps/bot/.dockerignore(1 hunks)apps/bot/.gitignore(1 hunks)apps/bot/Dockerfile(1 hunks)apps/bot/app.yml(1 hunks)apps/bot/fly.toml(1 hunks)apps/bot/package.json(1 hunks)apps/bot/src/index.ts(1 hunks)apps/bot/test/fixtures/issues.opened.json(1 hunks)apps/bot/test/index.test.ts(1 hunks)apps/bot/tsconfig.json(1 hunks)apps/bot/vitest.config.ts(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- apps/bot/package.json
- apps/bot/.gitignore
- apps/bot/test/fixtures/issues.opened.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces
Files:
apps/bot/test/index.test.tsapps/bot/vitest.config.tsapps/bot/src/index.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, usecn(import from@hypr/utils). It is similar toclsx. Always pass an array and split by logical grouping.
Usemotion/reactinstead offramer-motion.
Files:
apps/bot/test/index.test.tsapps/bot/vitest.config.tsapps/bot/src/index.ts
**/*.config.{ts,json}
📄 CodeRabbit inference engine (CLAUDE.md)
Agent configuration should be centralized and externalized from implementation logic
Files:
apps/bot/vitest.config.ts
🧠 Learnings (4)
📚 Learning: 2025-11-24T16:32:24.348Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: apps/desktop-e2e/AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:24.348Z
Learning: Applies to apps/desktop-e2e/**/*.{test,spec}.{js,ts,tsx} : Refer to `scripts/setup-desktop-e2e.sh` for end-to-end test environment setup if setup is missing
Applied to files:
apps/bot/test/index.test.ts
📚 Learning: 2025-11-24T16:32:01.459Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:32:01.459Z
Learning: Applies to **/*.ts : Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Applied to files:
apps/bot/tsconfig.json
📚 Learning: 2025-11-24T16:32:23.055Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:23.055Z
Learning: After some amount of TypeScript changes, run `pnpm -r typecheck`.
Applied to files:
apps/bot/tsconfig.json
📚 Learning: 2025-11-24T16:32:13.593Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: packages/nango/.cursor/rules/nango.mdc:0-0
Timestamp: 2025-11-24T16:32:13.593Z
Learning: Applies to packages/nango/**/models.ts : Do NOT edit the models.ts file - it is automatically generated at compilation time
Applied to files:
apps/bot/tsconfig.json
🧬 Code graph analysis (1)
apps/bot/test/index.test.ts (1)
apps/web/scripts/gen-agents.js (1)
__dirname(7-7)
🪛 actionlint (1.7.9)
.github/workflows/bot_ci.yaml
10-10: label "depot-ubuntu-24.04-8" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
.github/workflows/bot_cd.yaml
11-11: label "depot-ubuntu-24.04-8" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
🪛 GitHub Actions: .github/workflows/bot_ci.yaml
apps/bot/test/index.test.ts
[error] 67-67: AssertionError: expected [] to strictly equal [2 entries showing created comments and access token call]. Tests expect no pending mocks, but actual mocked network calls were made.
apps/bot/src/index.ts
[error] 4-4: getRouter is not a function. This causes the Probot app to fail to initialize the router during tests.
🪛 GitHub Check: ci
apps/bot/test/index.test.ts
[failure] 67-67: test/index.test.ts > My Probot app > creates a comment when an issue is opened
AssertionError: expected [ …(2) ] to strictly equal []
- Expected
- Received
- Array []
- Array [
- "POST https://api.github.com:443/app/installations/2/access_tokens",
- "POST https://api.github.com:443/repos/hiimbex/testing-things/issues/1/comments",
- ]
❯ test/index.test.ts:67:33
apps/bot/src/index.ts
[failure] 4-4: Unhandled error
TypeError: getRouter is not a function
❯ vite_ssr_exports.default src/index.ts:4:18
❯ Probot.load ../../node_modules/.pnpm/probot@13.4.7/node_modules/probot/src/probot.ts:126:12
❯ test/index.test.ts:43:12
❯ ../../node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
❯ runWithTimeout ../../node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7
❯ callSuiteHook ../../node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:964:28
❯ processTicksAndRejections node:internal/process/task_queues:105:5
❯ runTest ../../node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1040:30
❯ runSuite ../../node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15
❯ runSuite ../../node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15
This error originated in "test/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "test/index.test.ts". It might mean one of the following:
- The error was thrown, while Vitest was running this test.
- If the error occurred after the test had been completed, this was the last documented test before it was thrown.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Redirect rules - hyprnote
- GitHub Check: Header rules - hyprnote
- GitHub Check: fmt
- GitHub Check: Pages changed - hyprnote
🔇 Additional comments (9)
apps/bot/.dockerignore (1)
1-12: LGTM! Comprehensive exclusions for Docker context.The .dockerignore patterns appropriately exclude development artifacts, sensitive files (.env, *.pem), and unnecessary content (node_modules, coverage, etc.) from the Docker build context.
apps/bot/Dockerfile (1)
1-25: LGTM! Dockerfile correctly uses pnpm throughout.The multi-stage build properly leverages pnpm workspaces with filtered commands, avoiding the package-lock.json concern mentioned in the PR objectives. The production runtime correctly references the compiled entry point at
./lib/index.js.apps/bot/app.yml (1)
26-26: Verify if the issues event handler should be retained.Per the PR objectives, the sample
issues.openedhandler comments "Thanks for opening this issue!" on new issues. Confirm whether this default behavior should be kept, customized, or removed before deploying to production.Also applies to: 73-73
apps/bot/tsconfig.json (1)
1-25: LGTM! TypeScript configuration aligns with deployment.The strict configuration with
outDir: "./lib"correctly matches the Dockerfile's expected entry point at./lib/index.js. The Node16 module system is appropriate for the Node.js runtime.Based on learnings, remember to run
pnpm -r typecheckafter making TypeScript changes to this module.apps/bot/vitest.config.ts (1)
1-10: LGTM! Standard Vitest configuration.The configuration appropriately uses the v8 coverage provider and includes test files under
test/**/*.test.ts, aligning with the bot's test structure.apps/bot/fly.toml (1)
28-33: Health endpoint is properly implemented with correct defensive checks.The
/healthendpoint is correctly implemented atapps/bot/src/index.ts:7-9with a proper conditional check ongetRouter(if (getRouter) { ... }) rather than a non-null assertion. HTTP support is safely enabled through this defensive pattern, and the endpoint correctly returns "OK" for GET requests. The fly.toml configuration is aligned with the implementation..github/workflows/bot_ci.yaml (1)
10-10: Verify Depot runner is configured at the organization level.The workflow uses
depot-ubuntu-24.04-8, a Depot custom runner. Confirm this runner is available in your organization's Depot account and properly authenticated in GitHub—this is an organization-level configuration, not a repository-level concern..github/workflows/bot_cd.yaml (1)
17-19: Ensure FLY_API_TOKEN repository secret is configured in GitHub settings.The deployment workflow requires the
FLY_API_TOKENsecret to be set in the repository's GitHub Actions secrets with appropriate permissions for deploying to thehyprnote-botFly.io application. This must be configured manually in the repository settings, not in code.apps/bot/test/index.test.ts (1)
28-68: Test setup looks correct; current failures are caused by the app’sgetRoutercrashThe nock expectations and
probot.receive({ name: "issues", payload })flow are aligned with the standard Probot testing pattern. The CI failure aboutpendingMocks()still listing the access‑token and comment endpoints is a consequence of the app failing to load due togetRouterbeing called when it’s undefined insrc/index.ts.Once
src/index.tsis updated to guardgetRouterbefore using it (so the app loads cleanly), this test should start exercising theissues.openedhandler and the existing assertions ought to pass without changes.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/bot/src/index.ts (1)
12-17: Remove or customize the placeholder issues.opened handler.This handler is template code from the Probot hello-world example. As noted in the PR objectives, you should decide whether to keep, remove, or customize it. If left as-is, every new issue will receive a generic "Thanks for opening this issue!" comment, which may not be the intended behavior.
Consider one of the following:
- Remove the handler if no issues automation is needed yet:
- app.on("issues.opened", async (context) => { - const issueComment = context.issue({ - body: "Thanks for opening this issue!", - }); - await context.octokit.issues.createComment(issueComment); - });
- Customize the handler with your actual bot logic if issues automation is required.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/bot/src/index.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces
Files:
apps/bot/src/index.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, usecn(import from@hypr/utils). It is similar toclsx. Always pass an array and split by logical grouping.
Usemotion/reactinstead offramer-motion.
Files:
apps/bot/src/index.ts
🔇 Additional comments (1)
apps/bot/src/index.ts (1)
3-10: Null check properly handles optional HTTP routerThe defensive null check on
getRouteris well-implemented. The health endpoint will only be registered if HTTP support is enabled in your Probot deployment; otherwise, the code safely skips this section. No changes needed here.
Summary
Adds a new GitHub bot app in
apps/bot/scaffolded using the Probot CLI with thebasic-tstemplate. The app includes:/healthendpoint for deployment health checks (conditionally registered when HTTP server is available)issues.openedevent handler (from Probot hello-world example)Review & Testing Checklist for Human
/healthroute works in production - The route is now conditionally registered (if (getRouter)) to support test environments. Confirm it's accessible when deployed to Fly.io.fly.tomlsettings (app name, region, health check path) match your requirementsissues.openedhandler - Currently comments "Thanks for opening this issue!" on new issues. Remove or customize inapps/bot/src/index.tsif not needed.docker build -f apps/bot/Dockerfile .from repo root to verify the multi-stage build worksRecommended Test Plan
/healthendpoint to verify it returns "OK"Notes
The app was scaffolded using
npx create-probot-app --template basic-tsand then cleaned up. You'll need to configure Probot environment variables (APP_ID, PRIVATE_KEY, WEBHOOK_SECRET) in Fly.io secrets - see Probot configuration docs.Requested by: yujonglee (@yujonglee)
Link to Devin run: https://app.devin.ai/sessions/b3d5b53d31a547b3b145c0f6a09787b1