Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dipjyotimetia committed Sep 4, 2024
1 parent 9d34190 commit 692c4e4
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 87 deletions.
1 change: 0 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func init() {
rootCmd.AddCommand(commands.GenerateTestScenarios())
rootCmd.AddCommand(commands.SpecAnalyzer())
rootCmd.AddCommand(commands.GrpcCurlGenerator())
rootCmd.AddCommand(commands.ReadConfluenceJira()) // P8106
}

func Execute() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/atlassian/confluence/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func New(ctx context.Context) *client {
}

func (c *client) GetPages() ([]string, error) {
pages, _, err := c.Client.Page.Gets(context.Background(), "", "", "", "", 0, 0)
pages, _, err := c.Client.Page.Gets(context.Background(), nil, "", 0)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion pkg/atlassian/jira/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ func (c *client) GetIssues() {
log.Fatal(err)
}
fmt.Println(issues.Fields.Description)

}
46 changes: 0 additions & 46 deletions pkg/commands/genai.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"github.com/dipjyotimetia/jarvis/pkg/engine/files"
"github.com/dipjyotimetia/jarvis/pkg/engine/gemini"
"github.com/dipjyotimetia/jarvis/pkg/engine/prompt"
"github.com/dipjyotimetia/jarvis/pkg/atlassian/confluence"
"github.com/dipjyotimetia/jarvis/pkg/atlassian/jira"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -132,47 +130,3 @@ func GenerateTestScenarios() *cobra.Command {
setGenerateScenariosFlag(cmd)
return cmd
}

func ReadConfluenceJira() *cobra.Command {
cmd := &cobra.Command{
Use: "read-confluence-jira",
Aliases: []string{"rcj"},
Short: "read-confluence-jira is for reading from Confluence and Jira and suggesting test cases.",
Long: `read-confluence-jira is for reading from Confluence and Jira and suggesting test cases using Google Gemini`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()

// Initialize Confluence client
confluenceClient := confluence.New(ctx)
pages, err := confluenceClient.GetPages()
if err != nil {
return fmt.Errorf("failed to get pages from Confluence: %w", err)
}

// Initialize Jira client
jiraClient := jira.New(ctx)
issues, err := jiraClient.GetIssues()
if err != nil {
return fmt.Errorf("failed to get issues from Jira: %w", err)
}

// Initialize Gemini client
ai, err := gemini.New(ctx)
if err != nil {
return fmt.Errorf("failed to create Gemini engine: %w", err)
}

// Combine pages and issues into a single input for Gemini
input := append(pages, issues...)

// Generate test cases using Gemini
err = ai.GenerateTextStream(ctx, input, "confluence-jira")
if err != nil {
return fmt.Errorf("failed to generate test cases: %w", err)
}

return nil
},
}
return cmd
}
38 changes: 0 additions & 38 deletions pkg/commands/genai_test.go

This file was deleted.

0 comments on commit 692c4e4

Please sign in to comment.