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
Qe branch 3 #1399
base: master
Are you sure you want to change the base?
Qe branch 3 #1399
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@deads2k: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
name = strings.ReplaceAll(name, "f28", "fXX") | ||
name = strings.ReplaceAll(name, "f14", "fXX") | ||
name = strings.ReplaceAll(name, "f7", "fXX") | ||
name = strings.ReplaceAll(name, "f6", "fXX") | ||
return name |
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.
Will they have other frequencies? I know you hate regex but this isn't too bad:
re := regexp.MustCompile(`-f\d+`)
name = re.ReplaceAllString(name, "-fXX")
cmd := &cobra.Command{ | ||
Use: "component-readiness", | ||
|
||
Run: func(cmd *cobra.Command, arguments []string) { |
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.
Style nit, but we prefer RunE
and return errors everywhere else instead of bailing with Fatalf
.
|
||
var bigQueryClient *bigquery.Client | ||
var gcsClient *storage.Client | ||
if f.GoogleCloudFlags.ServiceAccountCredentialFile != "" { |
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'd like to push this logic into the GoogleCloudFlags type, so we can be consistent with how to get output from the input.
release := req.URL.Query().Get("release") | ||
|
||
api.PrintUpgradeJSONReportFromDB(w, req, s.db, release) | ||
} | ||
|
||
func (s *Server) jsonInstallReportFromDB(w http.ResponseWriter, req *http.Request) { | ||
if s.db == nil { |
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.
These blocks looked ugly to me. Pointing it out in case there's a better option for handling the situation.
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.
There's an if block in the server section that checks for s.db. Leftover from when we were partially on testgrid disk data and partially on postgres. You could move all these under there.
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 refactored this quite a bit in #1559, it includes most of this PR
@@ -7,12 +7,22 @@ import ( | |||
) | |||
|
|||
func (s *Server) jsonUpgradeReportFromDB(w http.ResponseWriter, req *http.Request) { |
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.
Overall, would we try to refactor Server to have a componentREadinessServer?
I don't think this has to be perfect to merge, it's making progress and would keep you from having to maintain a separate branch. I think we should just merge this once lint passes. |
I think I pushed.