-
Notifications
You must be signed in to change notification settings - Fork 10
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
Health Checks V2 API #8
Conversation
about.go
Outdated
@@ -53,11 +69,25 @@ type Dependency struct { | |||
IsTraversable bool `json:"isTraversable"` | |||
} | |||
|
|||
type DependencyV2 struct { |
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.
Small nit here, we call this DependencyInfo
in IDL
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 can change it
about.go
Outdated
return dependencies | ||
} | ||
|
||
func statusEndpointsToDependenciesV2(statusEndpoints []StatusEndpoint) []Dependency { |
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.
Returns wrong type? Should this be DependencyV2
?
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.
good catch
about.go
Outdated
return aboutV2(statusEndpoints, protocol, aboutFilePath, versionFilePath, customData, checkStatus) | ||
} | ||
// should never reach here | ||
return "" |
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.
Do we want to give an error back or do we want to set a default when version is not valid?
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 think we should 400
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.
actually, how much do we care about this ? because it would fail in http.go before this is called. so maybe blank string as the default is fine when version is not valid ? Or we could make this a pointer and return nil plus error
http.go
Outdated
dependencies = strings.Split(queryDependencies, ",") | ||
} | ||
apiVersion := APIV1 | ||
if slug[2] == "v2" { |
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.
Do we care bout case here?
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 could do to lower 👍
handleV1Api(w, r, slug[2], statusEndpoints, aboutFilePath, versionFilePath, customData) | ||
case APIV2: | ||
handleV2Api(w, r, slug[3], statusEndpoints, aboutFilePath, versionFilePath, customData) | ||
} |
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.
What do we do for an invalid version?
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 can add a default that returns a status with invalid api version
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 think we should actually 400 for consistency with the about failure
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.
Should we think about consistency across languages here?
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.
hm what do we do as the fallback in scala for the API version invalid in any of the languages ?
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.
Looking good so far!
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.
Look good. Thanks @kush-patel-hs! 👍
This introduces a set of
/status/v2/
endpoints for the health checks API.