Skip to content
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

Merged
merged 22 commits into from
Feb 4, 2019
Merged

Health Checks V2 API #8

merged 22 commits into from
Feb 4, 2019

Conversation

kush-patel-hs
Copy link
Contributor

@kush-patel-hs kush-patel-hs commented Jan 17, 2019

This introduces a set of /status/v2/ endpoints for the health checks API.

@CLAassistant
Copy link

CLAassistant commented Jan 17, 2019

CLA assistant check
All committers have signed the CLA.

about.go Outdated
@@ -53,11 +69,25 @@ type Dependency struct {
IsTraversable bool `json:"isTraversable"`
}

type DependencyV2 struct {
Copy link
Collaborator

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

Copy link
Contributor Author

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 {
Copy link
Collaborator

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?

Copy link
Contributor Author

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 ""
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

@kush-patel-hs kush-patel-hs Jan 23, 2019

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" {
Copy link
Collaborator

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?

Copy link
Contributor Author

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)
}
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Collaborator

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?

Copy link
Contributor Author

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 ?

Copy link
Collaborator

@HootAdam HootAdam left a 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!

Copy link
Collaborator

@HootAdam HootAdam left a 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! 👍

@HootAdam HootAdam merged commit d87594e into master Feb 4, 2019
@HootAdam HootAdam deleted the HEALTHCHECKSV2 branch February 4, 2019 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants