Skip to content

Remove Mergeable check and fix Devin status polling#2072

Merged
yujonglee merged 1 commit into
mainfrom
devin/1764680977-remove-mergeable-fix-devin-status
Dec 2, 2025
Merged

Remove Mergeable check and fix Devin status polling#2072
yujonglee merged 1 commit into
mainfrom
devin/1764680977-remove-mergeable-fix-devin-status

Conversation

@yujonglee
Copy link
Copy Markdown
Contributor

@yujonglee yujonglee commented Dec 2, 2025

Summary

This PR makes two changes to the bot:

  1. Removes the "Mergeable: bot_ci" check feature - The entire bot-ci.ts handler that created a mirror check called "Mergeable: bot_ci" has been removed, along with its tests and fixtures.

  2. Fixes stuck "Devin is working" checks - Modified discoverExistingDevinPRs() to reconcile checks for sessions that finished while the bot was down. Previously, the startup discovery only looked for status: "running" sessions, so if a Devin session finished during a bot restart, the GitHub check would stay stuck as "in_progress" forever. Now it fetches all recent sessions and immediately updates checks for finished/expired sessions.

Review & Testing Checklist for Human

  • Verify no branch protection rules depend on "Mergeable: bot_ci" - This check will no longer be created. If branch protection requires it, those settings need to be updated in GitHub.
  • Test the polling fix end-to-end - Create a PR with a Devin session, let it finish, restart the bot, and verify the check transitions from "Devin is working" to "Devin finished"
  • Check Devin API behavior without status filter - The change from listDevinSessions({ status: "running" }) to listDevinSessions({}) could return significantly more sessions. Verify this doesn't cause rate limiting or performance issues.
  • Review the status handling logic - The new code handles Working, Blocked, Finished, Expired, and other statuses. Verify the mapping to check conclusions (success/cancelled/neutral) is correct.

Notes

The test file was removed entirely because all tests were for the removed bot_ci feature. Added passWithNoTests: true to vitest config so CI doesn't fail.

Link to Devin run: https://app.devin.ai/sessions/cd2064dd2b5943d0ac9947bec873a4c1
Requested by: yujonglee (@yujonglee)

- Remove bot-ci.ts which created the 'Mergeable: bot_ci' check
- Remove related tests and fixtures for bot_ci handler
- Fix Devin status polling to reconcile stuck checks on startup
  - Now fetches all sessions (not just running) on startup
  - Updates checks for finished/expired sessions immediately
  - Only tracks working/blocked sessions for ongoing polling
- Update vitest config to pass with no tests

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 Dec 2, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit a4f4c0c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/692ee74217161e00086846fc
😎 Deploy Preview https://deploy-preview-2072--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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 2, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit a4f4c0c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/692ee742ef4b8d0008833ccb
😎 Deploy Preview https://deploy-preview-2072--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 Dec 2, 2025

📝 Walkthrough

Walkthrough

This PR removes the bot-ci feature handler and associated infrastructure while refactoring the Devin poller to conditionally handle sessions by their status (Working, Blocked, Finished, Expired) with corresponding check updates.

Changes

Cohort / File(s) Summary
Devin Poller Status Handling
apps/bot/src/devin/poller.ts
Modified discoverExistingDevinPRs to remove early status filtering and unconditionally fetch session details, then apply status-specific logic: start tracking for Working/Blocked statuses, update check as completed with appropriate conclusion and message for Finished/Expired/other truthy statuses.
Bot CI Feature Removal
apps/bot/src/features/bot-ci.ts
Deleted entire file containing registerBotCiHandler, CheckStatus/CheckConclusion types, SOURCE_CHECK_NAME/MERGEABLE_CHECK_NAME constants, and createOrUpdateMergeableCheck helper function.
Feature Registry
apps/bot/src/features/index.ts
Removed export of bot-ci.js module.
Handler Registration
apps/bot/src/index.ts
Removed import and invocation of registerBotCiHandler.
Test Fixtures Cleanup
apps/bot/test/fixtures/check_run.*.json
Deleted fixture files: check_run.completed.failure.json, check_run.completed.success.json, check_run.created.json.
Test Suite Removal
apps/bot/test/index.test.ts
Removed entire integration test suite for bot_ci workflow covering check creation, completion, and PR handling scenarios.
Test Configuration
apps/bot/vitest.config.ts
Added passWithNoTests: true to test configuration to allow passing with no tests found.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Key areas requiring attention:
    • Verify status-conditional logic in poller correctly handles all Devin session states and produces appropriate check payloads
    • Confirm removal of bot-ci handler does not break existing GitHub App integration or leave dangling references
    • Ensure check update logic in poller properly replaces any functionality previously provided by bot-ci handler

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: removing the Mergeable check and fixing Devin status polling.
Description check ✅ Passed The description is well-related to the changeset, explaining the removal of bot-ci feature and the fix to Devin polling with context and testing guidance.
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/1764680977-remove-mergeable-fix-devin-status

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

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/devin/poller.ts (1)

208-246: Consider extracting status handling to reduce duplication.

The status-based branching logic here (Finished → success, Expired → cancelled, other → neutral) is repeated in checkPRStatus (lines 339-375 and 415-443). This duplication increases maintenance burden and risks divergence.

Consider extracting a helper method:

private getCheckOutputForStatus(
  status: DevinSessionStatus | undefined,
  sessionId: string
): { status: "in_progress" | "completed"; conclusion?: "success" | "cancelled" | "neutral"; output: { title: string; summary: string } } | null {
  switch (status) {
    case DevinSessionStatus.Working:
      return { status: "in_progress", output: { title: "Devin is working", summary: `Devin session ${sessionId} is currently working on this PR.` } };
    case DevinSessionStatus.Blocked:
      return { status: "in_progress", output: { title: "Devin is blocked", summary: `Devin session ${sessionId} is blocked and waiting for input.` } };
    case DevinSessionStatus.Finished:
      return { status: "completed", conclusion: "success", output: { title: "Devin finished", summary: `Devin session ${sessionId} has completed.` } };
    case DevinSessionStatus.Expired:
      return { status: "completed", conclusion: "cancelled", output: { title: "Devin session expired", summary: `Devin session ${sessionId} has expired.` } };
    default:
      return status ? { status: "completed", conclusion: "neutral", output: { title: "Devin session ended", summary: `Devin session ${sessionId} ended with status: ${status}` } } : null;
  }
}
📜 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 d695547 and a4f4c0c.

📒 Files selected for processing (9)
  • apps/bot/src/devin/poller.ts (2 hunks)
  • apps/bot/src/features/bot-ci.ts (0 hunks)
  • apps/bot/src/features/index.ts (0 hunks)
  • apps/bot/src/index.ts (0 hunks)
  • apps/bot/test/fixtures/check_run.completed.failure.json (0 hunks)
  • apps/bot/test/fixtures/check_run.completed.success.json (0 hunks)
  • apps/bot/test/fixtures/check_run.created.json (0 hunks)
  • apps/bot/test/index.test.ts (0 hunks)
  • apps/bot/vitest.config.ts (1 hunks)
💤 Files with no reviewable changes (7)
  • apps/bot/src/features/index.ts
  • apps/bot/test/index.test.ts
  • apps/bot/src/index.ts
  • apps/bot/src/features/bot-ci.ts
  • apps/bot/test/fixtures/check_run.completed.success.json
  • apps/bot/test/fixtures/check_run.created.json
  • apps/bot/test/fixtures/check_run.completed.failure.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/src/devin/poller.ts
  • apps/bot/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/bot/src/devin/poller.ts
  • apps/bot/vitest.config.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 (2)
📚 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/vitest.config.ts
📚 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/**/*.ts : Integration must pass `nango dryrun` validation testing successfully

Applied to files:

  • apps/bot/vitest.config.ts
🧬 Code graph analysis (1)
apps/bot/src/devin/poller.ts (1)
apps/bot/src/devin/list.ts (1)
  • listDevinSessions (28-47)
⏰ 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). (8)
  • GitHub Check: Redirect rules - hyprnote-storybook
  • GitHub Check: Header rules - hyprnote-storybook
  • GitHub Check: Pages changed - hyprnote-storybook
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: Devin
  • GitHub Check: fmt
🔇 Additional comments (3)
apps/bot/vitest.config.ts (1)

7-7: CI will pass even if no tests are discovered

Adding passWithNoTests: true aligns with the bot test suite removal, but note that CI will silently succeed in the future if tests are accidentally not discovered for this package. Confirm whether this is intentional for apps/bot's long-term testing strategy.

apps/bot/src/devin/poller.ts (2)

171-171: LGTM!

Removing the status filter allows discovering sessions in any state, enabling the new logic to properly handle Finished/Expired sessions by updating their check status immediately during discovery.


198-212: Clean refactoring of the discovery flow.

The pattern of constructing trackedPR upfront and then conditionally tracking or updating based on status is clear and maintainable. Only active sessions (Working/Blocked) are tracked for ongoing polling.

@yujonglee yujonglee merged commit 1eee019 into main Dec 2, 2025
14 of 15 checks passed
@yujonglee yujonglee deleted the devin/1764680977-remove-mergeable-fix-devin-status branch December 2, 2025 13:22
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