mirror of
https://github.com/Pull-Pal/pull-pal.git
synced 2024-09-07 20:45:16 -04:00
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
55 lines
1.0 KiB
Go
55 lines
1.0 KiB
Go
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)
|
|
}
|