-
Notifications
You must be signed in to change notification settings - Fork 0
added package chart, moved all the chart generation there #1
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
base: main
Are you sure you want to change the base?
Conversation
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 am wondering if this app should be focused aroun collecting the data and getting it into the database formatted how we want. There is some existing dashboard that I don't know too much about, but Andy might have more info on it. Maybe we can add on to that for presenting the metrics. I'll send you a little info on it.
@@ -85,11 +89,15 @@ func getWorkflowRunsData() { | |||
} | |||
|
|||
req.Header.Set("Accept", "application/vnd.github.v3+json") | |||
req.Header.Add("Authorization", "token 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") |
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'm still getting a no data unless I comment out this line and the other token line. Maybe we can use a .env
file and the godotenv package to load a token, and only add this header if there is one set.
It will keep you from checking in your tokens in the future as well. The .env
file can be added to .gitignore
//fmt.Println("=================================") | ||
//fmt.Println("Job Name: ", job.Name) | ||
fmt.Println("=================================") | ||
fmt.Println("Job Name: ", job.Name) | ||
//fmt.Println("Job StartTime: ", job.StartTime) | ||
// Calculate job runtime | ||
runTime := getRuntime(job.StartTime, job.CompletedTime) |
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.
If I run unauthenticated I get this error
$ go run main.go
Connected to MongoDB successfully!
jobs collection dropped...
6
=================================
Job Name: build-v2-beta (windows-2022)
2023/06/22 09:02:32 parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"
exit status 1
It's a strange error so it's hard to pinpoint exactly where it's coming from, but I think it's if I try to parse time when the field is empty
//failRateV1 := getFailureRate("v1") | ||
//failRateV2Beta := getFailureRate("v2-beta") | ||
//items := make([]opts.BarData, 0) |
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.
Is the same app getting the job data on a schedule and serving a webapp with charts? I am wondering if these responsibilities should be separate in the future
Added non-successful http response error handling
Move chart generation into package chart
Server runs on localhost:3001