Skip to content

Add GitHub bot app using Probot with /health route#2012

Merged
yujonglee merged 5 commits into
mainfrom
devin/1764495430-github-app
Nov 30, 2025
Merged

Add GitHub bot app using Probot with /health route#2012
yujonglee merged 5 commits into
mainfrom
devin/1764495430-github-app

Conversation

@yujonglee
Copy link
Copy Markdown
Contributor

@yujonglee yujonglee commented Nov 30, 2025

Summary

Adds a new GitHub bot app in apps/bot/ scaffolded using the Probot CLI with the basic-ts template. The app includes:

  • A /health endpoint for deployment health checks (conditionally registered when HTTP server is available)
  • A sample issues.opened event handler (from Probot hello-world example)
  • CI/CD workflows for testing and Fly.io deployment
  • Production-ready Dockerfile using pnpm multi-stage build

Review & Testing Checklist for Human

  • Verify /health route works in production - The route is now conditionally registered (if (getRouter)) to support test environments. Confirm it's accessible when deployed to Fly.io.
  • Verify Fly.io deployment configuration - Check fly.toml settings (app name, region, health check path) match your requirements
  • Configure FLY_API_TOKEN secret - The CD workflow requires this secret to be set in GitHub repository settings
  • Decide on issues.opened handler - Currently comments "Thanks for opening this issue!" on new issues. Remove or customize in apps/bot/src/index.ts if not needed.
  • Test Dockerfile locally - Run docker build -f apps/bot/Dockerfile . from repo root to verify the multi-stage build works

Recommended Test Plan

  1. Deploy to Fly.io staging environment
  2. Hit /health endpoint to verify it returns "OK"
  3. Create a test issue in a connected repo to verify the webhook handler works

Notes

The app was scaffolded using npx create-probot-app --template basic-ts and 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

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 30, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit f8f193a
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/692c19ec80b6ca0008f7b618
😎 Deploy Preview https://deploy-preview-2012--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 30, 2025

📝 Walkthrough

Walkthrough

Adds a new Probot-based GitHub bot in apps/bot, Dockerfiles for bot and github app, CI/CD workflows for testing and Fly.io deployment, test fixtures and Vitest config, and Fly.io/GitHub App manifests and related project configs.

Changes

Cohort / File(s) Summary
GitHub app image
apps/github/Dockerfile
Adds a production Node.js Dockerfile using node:20-slim, installs production deps, sets NODE_ENV=production, and runs npm start.
Probot application
apps/bot/src/index.ts, apps/bot/package.json, apps/bot/tsconfig.json, apps/bot/vitest.config.ts
Adds Probot app exporting default function; registers health endpoint and issues.opened handler that posts a comment; includes package.json, strict TS config, and Vitest config.
Bot tests & fixtures
apps/bot/test/index.test.ts, apps/bot/test/fixtures/issues.opened.json
Adds test verifying the bot posts a comment on issue open using nock and a webhook fixture.
Bot Docker & deployment files
apps/bot/Dockerfile, apps/bot/.dockerignore, apps/bot/.gitignore, apps/bot/fly.toml, apps/bot/app.yml
Adds multi-stage pnpm Dockerfile, dockerignore/gitignore entries, Fly.io config (app name, region, port, health check, resources), and GitHub App manifest with events/permissions.
CI / CD workflows
.github/workflows/bot_ci.yaml, .github/workflows/bot_cd.yaml
Adds CI workflow (typecheck, tests) triggered on PR/dispatch for apps/bot/** and CD workflow using Flyctl deploy with concurrency and timeout settings.

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)
Loading
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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review apps/bot/src/index.ts for correct Probot routing and use of context.octokit.
  • Validate tests in apps/bot/test/index.test.ts (nock mocks, fixture usage).
  • Inspect apps/bot/Dockerfile for pnpm filtering, build stages, and runtime CMD.
  • Verify CI/CD workflow triggers, secrets usage (FLY_API_TOKEN), and Fly.toml settings.

Suggested reviewers

  • yujonglee

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a GitHub bot app using Probot with a /health route endpoint.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the Probot app addition, key features, CI/CD workflows, and providing a thorough testing checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1764495430-github-app

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

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 30, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit f8f193a
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/692c19ecfeb0f30008722294
😎 Deploy Preview https://deploy-preview-2012--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9aea4fb and f07e5d1.

📒 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 install to update to the latest patch, or evaluate upgrading to 14.2.4 for additional features.

devin-ai-integration Bot and others added 2 commits November 30, 2025 09:46
…th route

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Copy link
Copy Markdown
Contributor

@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

🧹 Nitpick comments (4)
apps/github/.dockerignore (1)

1-12: Docker context exclusions are sensible; be aware PEM fixtures won’t be copied

The ignore list is good for keeping the build context lean and secrets out of images. Note that **/*.pem will also exclude mock-cert.pem from 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 around getRouter

The /health route and issues.opened handler both look correct and align with typical Probot usage. The only nuance is getRouter!("/"): this assumes the app is always run in a mode where getRouter is 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 getRouter is 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 too

The strict options and Node16/ES2022 module/target choices look good and match the ESM Probot app setup. Currently only src/ is included, so test/ files won’t be covered by tsc -p apps/github/tsconfig.json.

If you want tests in your typecheck pipeline, consider either:

  • Adding tests to include, e.g.:
    "include": ["src/", "test/"]
    or
  • Creating a separate tsconfig.test.json that extends this one and adds test/, 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 nits

The test setup (ESM‑style __dirname, fixture loading, Probot instance configuration, and nock expectations) is sound and should reliably validate the issues.opened handler behavior. Nothing blocking here.

Two small optional cleanups you might consider:

  1. Type the probot variable

Instead of let probot: any;, you can give it the actual type for better editor help if you later expand tests:

let probot: Probot;
  1. 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.js import 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

📥 Commits

Reviewing files that changed from the base of the PR and between f07e5d1 and d2fc90a.

⛔ Files ignored due to path filters (3)
  • apps/github/README.md is excluded by !**/README*
  • apps/github/test/fixtures/mock-cert.pem is excluded by !**/*.pem
  • pnpm-lock.yaml is 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.ts
  • apps/github/src/index.ts
  • apps/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, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/github/test/index.test.ts
  • apps/github/src/index.ts
  • apps/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 app

Ignoring build output (lib), env, and certs while explicitly keeping mock-cert.pem is 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 an issues.opened payload

The 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 appropriate

This 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 handler

Subscribing to issues and granting issues: write + metadata: read is 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 app

Node 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 layout

The 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.

Comment thread apps/github/CONTRIBUTING.md Outdated
Comment thread apps/github/Dockerfile
yujonglee and others added 2 commits November 30, 2025 19:13
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Copy link
Copy Markdown
Contributor

@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: 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-8 custom 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 desired

The issues.opened handler 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 concrete Probot type instead of any for probot

You already import Probot, so you can avoid any here 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

📥 Commits

Reviewing files that changed from the base of the PR and between d2fc90a and 0cf0c7e.

⛔ Files ignored due to path filters (2)
  • apps/bot/test/fixtures/mock-cert.pem is excluded by !**/*.pem
  • pnpm-lock.yaml is 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.ts
  • apps/bot/vitest.config.ts
  • 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, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/bot/test/index.test.ts
  • apps/bot/vitest.config.ts
  • apps/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 []

❯ 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.opened handler 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 typecheck after 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 /health endpoint is correctly implemented at apps/bot/src/index.ts:7-9 with a proper conditional check on getRouter (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_TOKEN secret to be set in the repository's GitHub Actions secrets with appropriate permissions for deploying to the hyprnote-bot Fly.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’s getRouter crash

The nock expectations and probot.receive({ name: "issues", payload }) flow are aligned with the standard Probot testing pattern. The CI failure about pendingMocks() still listing the access‑token and comment endpoints is a consequence of the app failing to load due to getRouter being called when it’s undefined in src/index.ts.

Once src/index.ts is updated to guard getRouter before using it (so the app loads cleanly), this test should start exercising the issues.opened handler and the existing assertions ought to pass without changes.

@devin-ai-integration devin-ai-integration Bot changed the title Add GitHub app using Probot with /health route Add GitHub bot app using Probot with /health route Nov 30, 2025
Copy link
Copy Markdown
Contributor

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0cf0c7e and f8f193a.

📒 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, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/bot/src/index.ts
🔇 Additional comments (1)
apps/bot/src/index.ts (1)

3-10: Null check properly handles optional HTTP router

The defensive null check on getRouter is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant