Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

feat(cluster-state-service): add ping endpoint #195

Closed
wants to merge 1 commit into from
Closed

feat(cluster-state-service): add ping endpoint #195

wants to merge 1 commit into from

Conversation

dominicbarnes
Copy link

@dominicbarnes dominicbarnes commented May 12, 2017

Summary

Adds a "ping" endpoint to cluster-state-service at /v1/ping which behaves exactly like the same endpoint in daemon-scheduler. (fixes #194)

Implementation details

I copy-pasta'd a lot over from daemon-scheduler.

Testing

  • cluster-state-service binary built locally and unit-tests pass (cd cluster-state-service; make; cd ../)
  • cluster-state-service build in Docker succeeds (cd cluster-state-service; make release; cd ../)
  • daemon-scheduler binary built locally and unit-tests pass (cd daemon-scheduler; make; cd ../)
  • daemon-scheduler build in Docker succeeds (cd daemon-scheduler; make release; cd ../)

New tests cover the changes: yes

Description for the changelog

added a health check endpoint

Licensing

This contribution is under the terms of the Apache 2.0 License: Yes

Before merging

  • cluster-state-service end-to-end tests pass. Required setup details are listed here.
  • daemon-scheduler integration tests pass. Required setup details are listed here.
  • daemon-scheduler end-to-end tests pass. Required setup details are listed here.

@dominicbarnes
Copy link
Author

dominicbarnes commented May 12, 2017

I'm having trouble getting this to build locally on my fork because of dependency issues. It looks like go isn't playing nicely with the vendor/ directory and my forked version, since it's technically a different module.

This is also my first contribution to the project, so I may need some help getting this all together.

@dominicbarnes
Copy link
Author

Tests pass on Travis though! So I think this is in pretty good shape

Copy link
Contributor

@kylbarnes kylbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick changes requested.

"github.com/blox/blox/cluster-state-service/handler/store"
)

// TaskAPIs encapsulates the backend datastore with which the task APIs interact
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix this comment, since this isn't TaskAPIs?


// TaskAPIs encapsulates the backend datastore with which the task APIs interact
type GeneralAPIs struct {
taskStore store.TaskStore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably doesn't need a taskStore object.

taskStore store.TaskStore
}

// NewTaskAPIs initializes the TaskAPIs struct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same fix request for this comment.

suite.router = suite.getRouter()
}

// TODO - Add the following test cases once implementation is in place
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this comment block?

@kylbarnes
Copy link
Contributor

Looks good @dominicbarnes, thanks for the commit. I've requested a couple nitpick changes though before I merge it in. Can you update your pull request with the changes requested?

Confirmed unit tests pass. Also verified /v1/ping handler via curl:

$ curl -v http://localhost:3000/v1/ping
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=UTF-8
< Date: Wed, 17 May 2017 05:24:55 GMT
< Content-Length: 0

@kylbarnes
Copy link
Contributor

Closing due to inactivity. Please feel free to re-open after addressing PR comments.

@kylbarnes kylbarnes closed this Jun 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cluster-state-serivce: no ping?
2 participants