-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Connect conversations to GitHub issues (#12) #47
base: main
Are you sure you want to change the base?
Conversation
conversationSummary?: string | string[] | null; | ||
} | ||
|
||
// Define the GitHub issue type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of the comments in this PR are unnecessary, the code reads well on its own
updatedAt: string; | ||
} | ||
|
||
export const GitHubIssueButton = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the button to now be in 'command bar' instead of in conversation tabs.
checkout this commit : 7a2b578
const [selectedIssueNumber, setSelectedIssueNumber] = useState<number | null>(null); | ||
|
||
// Get conversation details to check if a GitHub issue is already linked | ||
const { data: conversation, refetch: refetchConversation } = api.mailbox.conversations.get.useQuery( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be a bit nicer to use useConversationContext
<> | ||
<span className="inline-flex items-center rounded-full bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground mr-1"> | ||
Closed | ||
</span> | ||
<HumanizedTime time={conversation.closedAt ?? conversation.updatedAt} titlePrefix="Closed on" /> | ||
</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look related?
try { | ||
setIsLoading(true); | ||
setRepositories( | ||
await utils.client.mailbox.github.repositories.query({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useQuery
should simplify the state handling here (or let me know if there's a reason you're not using it!)
|
||
return { | ||
accessToken: data.access_token, | ||
username: userResponse.data.login, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we save the username?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vikaswakde _a Thanks for the PR, the functionality looks great! I've added some initial comments (in 2 reviews because I mis-clicked ...), could you take a look?
Apologies some of these weren't clear, we haven't had a chance to document things in detail yet
console.error("Error listing repository issues:", error); | ||
throw new Error("Failed to list issues for this repository"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I think we can let things like this fail rather than having custom error handlers (if it's for the message, we should throw a tRPC error class in the procedure)
import { createGitHubIssue, getGitHubIssue, listRepositoryIssues, updateGitHubIssueState } from "@/lib/github/client"; | ||
import { mailboxProcedure } from "./procedure"; | ||
|
||
export const githubConversationsRouter = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we nest this under conversations
and use conversationProcedure
|
||
if (mailbox?.githubAccessToken) { | ||
// Map conversation status to GitHub issue state | ||
const githubState = updatedConversation.status === "closed" ? "closed" : "open"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do this, "closed" for the conversation just means we've replied, not that the issue is fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(misclick again, I need coffee ...)
Implements GitHub integration for Helper, allowing users to:
helperai-github-integration-demo.mov
helper-ai-github-issues-creation-demo.mp4
This integration enables teams to track support requests and bugs directly
from Helper conversations, with bidirectional synchronization ensuring
that issue status is always up-to-date in both systems.
Closes #12