mirror of
https://github.com/Pull-Pal/pull-pal.git
synced 2026-04-18 11:39:09 -04:00
begin implementing comments (#2)
add a section of the main loop that checks for comments on PRs that the bot has opened reworks git logic and adds debug commands for git and llm stuff changes a bunch of other stuff too
This commit is contained in:
committed by
GitHub
parent
39d0ad7d0b
commit
ab7521477a
54
cmd/debug-git.go
Normal file
54
cmd/debug-git.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var debugGitCmd = &cobra.Command{
|
||||
Use: "debug-git",
|
||||
Short: "debug git functionality",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cfg := getConfig()
|
||||
|
||||
p, err := getPullPal(cmd.Context(), cfg)
|
||||
if err != nil {
|
||||
fmt.Println("error creating new pull pal", err)
|
||||
return
|
||||
}
|
||||
fmt.Println("Successfully initialized pull pal")
|
||||
|
||||
err = p.DebugGit()
|
||||
if err != nil {
|
||||
fmt.Println("err debugging git", err)
|
||||
return
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
var debugGithubCmd = &cobra.Command{
|
||||
Use: "debug-github",
|
||||
Short: "debug github functionality",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cfg := getConfig()
|
||||
|
||||
p, err := getPullPal(cmd.Context(), cfg)
|
||||
if err != nil {
|
||||
fmt.Println("error creating new pull pal", err)
|
||||
return
|
||||
}
|
||||
fmt.Println("Successfully initialized pull pal")
|
||||
|
||||
err = p.DebugGithub(cfg.usersToListenTo)
|
||||
if err != nil {
|
||||
fmt.Println("err debugging github", err)
|
||||
return
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(debugGitCmd)
|
||||
rootCmd.AddCommand(debugGithubCmd)
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var debugGitCmd = &cobra.Command{
|
||||
Use: "debug-git",
|
||||
Short: "debug git functionality",
|
||||
var debugLLMCmd = &cobra.Command{
|
||||
Use: "debug-llm",
|
||||
Short: "debug llm functionality",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cfg := getConfig()
|
||||
|
||||
@@ -19,14 +19,14 @@ var debugGitCmd = &cobra.Command{
|
||||
}
|
||||
fmt.Println("Successfully initialized pull pal")
|
||||
|
||||
err = p.DebugGit()
|
||||
err = p.DebugLLM()
|
||||
if err != nil {
|
||||
fmt.Println("err debugging git", err)
|
||||
fmt.Println("err debugging prompts", err)
|
||||
return
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(debugGitCmd)
|
||||
rootCmd.AddCommand(debugLLMCmd)
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/mobyvb/pull-pal/pullpal"
|
||||
"github.com/mobyvb/pull-pal/vc"
|
||||
"github.com/sashabaranov/go-openai"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -79,7 +80,8 @@ func getPullPal(ctx context.Context, cfg config) (*pullpal.PullPal, error) {
|
||||
Handles: cfg.usersToListenTo,
|
||||
Labels: cfg.requiredIssueLabels,
|
||||
}
|
||||
p, err := pullpal.NewPullPal(ctx, log.Named("pullpal"), listIssueOptions, author, repo, cfg.openAIToken)
|
||||
// TODO make model configurable
|
||||
p, err := pullpal.NewPullPal(ctx, log.Named("pullpal"), listIssueOptions, author, repo, openai.GPT4, cfg.openAIToken)
|
||||
|
||||
return p, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user