Minor fix
This commit is contained in:
parent
254c29b1d7
commit
4cdabbe4f5
3 changed files with 11 additions and 10 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.aider*
|
||||
.env
|
||||
|
|
@ -8,8 +8,8 @@ import (
|
|||
"time"
|
||||
|
||||
"o5r.ca/autocrossbow/contributions"
|
||||
"o5r.ca/autocrossbow/issues/vikunja"
|
||||
"o5r.ca/autocrossbow/issues"
|
||||
"o5r.ca/autocrossbow/issues/vikunja"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -84,18 +84,17 @@ func DoPrs(proj, ghusername, start, end string) map[string][]contributions.PullR
|
|||
return prs
|
||||
}
|
||||
|
||||
func DoJira(start, end string) []issues.Issue {
|
||||
host := os.Getenv("VIKUNJA_HOST")
|
||||
user := os.Getenv("VIKUNJA_USER")
|
||||
tasks, err := vikunja.GetTasks(host, user, start, end)
|
||||
func DoJira(start, end string, user string) []issues.Issue {
|
||||
host := os.Getenv("JIRA_HOST")
|
||||
tasks, err := issues.GetIssues(host, user, start, end)
|
||||
if err != nil {
|
||||
fmt.Println(fmt.Errorf("error getting Vikunja tasks: %w", err))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
vf, err := os.Create(fmt.Sprintf("vikunja-%s-%s-%s-%s-%d.json", host, user, start, end, time.Now().Unix()))
|
||||
vf, err := os.Create(fmt.Sprintf("jira-%s-%s-%s-%s-%d.json", host, user, start, end, time.Now().Unix()))
|
||||
if err != nil {
|
||||
fmt.Println(fmt.Errorf("error creating Vikunja file: %w", err))
|
||||
fmt.Println(fmt.Errorf("error creating Jira file: %w", err))
|
||||
os.Exit(1)
|
||||
}
|
||||
defer vf.Close()
|
||||
|
|
@ -103,7 +102,7 @@ func DoJira(start, end string) []issues.Issue {
|
|||
enc := json.NewEncoder(vf)
|
||||
err = enc.Encode(tasks)
|
||||
if err != nil {
|
||||
fmt.Println(fmt.Errorf("error writing out Vikunja tasks: %w", err))
|
||||
fmt.Println(fmt.Errorf("error writing out Jira tasks: %w", err))
|
||||
os.Exit(1)
|
||||
}
|
||||
return tasks
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ func SummarizeData(employeename string, prs map[string][]contributions.PullReque
|
|||
fullPrompt += fmt.Sprintf(" Body: %s\n", pr.Body)
|
||||
}
|
||||
}
|
||||
fullPrompt += fmt.Sprintf("Issues:")
|
||||
fullPrompt += "Issues:\n"
|
||||
for _, issue := range issues {
|
||||
fullPrompt += fmt.Sprintf("Summary: %s\n", issue.Summary)
|
||||
fullPrompt += fmt.Sprintf("Description: %s\n", issue.Description)
|
||||
fullPrompt += fmt.Sprintf("--------")
|
||||
fullPrompt += "--------\n"
|
||||
}
|
||||
|
||||
// Get OpenAI endpoint and token from environment variables
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue