Skip to content

Conversation

@issuetopr-dev
Copy link

@issuetopr-dev issuetopr-dev bot commented Nov 4, 2025

Summary

  • Introduces first-class PullRequest nodes in Neo4j and ingests them automatically from successful create_pull_request tool results.

What’s included (M1 per issue plan)

  • Data model: Added PullRequest node schema in lib/types/db/neo4j.ts with core properties (repoFullName, number, url, title, createdAt, and optional status fields).
  • Repository: lib/neo4j/repositories/pullRequest.ts with:
    • upsertPullRequest: de-dupes by (repoFullName, number), sets createdAt on create.
    • linkEventCreatedPR: links Event:Message (toolCallResult) to the PullRequest via [:CREATED_PR].
  • Service: lib/neo4j/services/pullRequest.ts with upsertCreatedPullRequestFromToolResult which:
    • Parses/derives repoFullName from PR URL when not provided.
    • Upserts PullRequest and creates the CREATED_PR relationship.
  • Ingestion: lib/adapters/PersistingEventBusAdapter.ts now:
    • Persists the tool.result event.
    • On toolName === "create_pull_request" with status === "success", parses the number/url/title and calls the service to upsert the PR and link it.

Design notes

  • De-dupe key: (repoFullName, number) enforced via MERGE in upsertPullRequest.
  • URL normalization: deriveRepoFullNameFromUrl("https://github.com/owner/repo/pull/123") -> "owner/repo".
  • Relationship: (e:Event:Message {type:'toolCallResult', toolName:'create_pull_request'})-[:CREATED_PR]->(pr:PullRequest).

Non-breaking & minimal

  • No behavior changes outside tool.result ingestion.
  • No dependency updates.

Follow-ups (next milestones)

  • Backfill from historical events.
  • Scheduled GraphQL status refresher worker in apps/workers/workflow-workers.
  • CLI exporter and optional API docs.

Checks

  • ESLint (next lint) passes locally.
  • Prettier/TS checks are unchanged from baseline repo; no global formatting was applied to avoid unrelated churn.

Closes #1332

…schema to Neo4j types\n- Implement repository to upsert PullRequest and link CREATED_PR from events\n- Add service to upsert PR from create_pull_request tool result with URL-based repo derivation\n- Extend PersistingEventBusAdapter to ingest successful create_pull_request results into PullRequest nodes
@issuetopr-dev issuetopr-dev bot added the AI generated AI-generated Pull Requests label Nov 4, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

@vercel vercel bot temporarily deployed to Preview – issue-to-pr-storybook November 4, 2025 03:42 Inactive
@vercel vercel bot temporarily deployed to Preview – issue-to-pr-realtime November 4, 2025 03:42 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI generated AI-generated Pull Requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Systemize tracking and reporting of agent-created PRs (Neo4j + GitHub GraphQL)

2 participants