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

Separate service id from task #99

Merged
merged 6 commits into from
Aug 17, 2016
Merged

Conversation

pbetkier
Copy link
Contributor

Consul service used to be registered under the same id as its related marathon task id. This PR separates these two ids. Marathon task id is remembered in service's marathon-task tag. Also did some refactorings: extracted Service and ServiceId domain types, and also ServiceRegistry interface to make things more clear by hiding Consul internals.

I'm still working on this PR, going to cleanup some code and verify that all branches are covered with tests. But the main idea is there, so waiting for your feedback.

It's a prerequisite to #89, because we would register more than one service for a given marathon task.

@coveralls
Copy link

coveralls commented Aug 12, 2016

Coverage Status

Coverage decreased (-3.04%) to 86.276% when pulling 60d1e34 on separate_service_id_from_task_id into b6c97f6 on master.

@janisz
Copy link
Contributor

janisz commented Aug 12, 2016

I think this should be split into 2 PR: introduce Service and ServiceId domain types and change ServiceId to generated uuid. This will make review and testing easier. Another thing changing IDs could be harmful so we need to test impact of this action.

@pbetkier
Copy link
Contributor Author

Even if do we split, we have to test this PR thoroughly because it's a significant change. Why not do it once? I've split the change into two separate commits for the review's sake, but I don't see the point in splitting it into separate PRs. One would contain the feature, but introducing complexity in the codebase and the other would only clean things up. Still, we merge either both or nothing IMO :)

@janisz
Copy link
Contributor

janisz commented Aug 12, 2016

I thought we can merge refactoring first and then ID change. With refactoring most of tests should remain untouched and by this we will ensure change doesn't break anything.

@janisz
Copy link
Contributor

janisz commented Aug 16, 2016

I created dedicated task (#100) for extracting domain service object. It should be backward comaptible and we could release it as 4.1 build with Go 1.7.

@pbetkier pbetkier changed the base branch from master to develop August 16, 2016 08:42
@coveralls
Copy link

coveralls commented Aug 16, 2016

Coverage Status

Coverage decreased (-3.0%) to 86.321% when pulling 7a15fe5 on separate_service_id_from_task_id into b6c97f6 on develop.

"strings"

"github.com/allegro/marathon-consul/apps"
"fmt"
Copy link
Contributor

Choose a reason for hiding this comment

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

find ./ -name '*.go' | xargs goimports -w

@coveralls
Copy link

coveralls commented Aug 16, 2016

Coverage Status

Coverage decreased (-2.9%) to 86.379% when pulling cfc7695 on separate_service_id_from_task_id into b6c97f6 on develop.

@pbetkier
Copy link
Contributor Author

@janisz @dankraw I fixed according to review comments, can I merge this into develop?

@janisz janisz merged commit da67dca into develop Aug 17, 2016
@janisz janisz deleted the separate_service_id_from_task_id branch August 17, 2016 11:25
@dankraw
Copy link
Contributor

dankraw commented Aug 18, 2016

late but 👍 :>

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.

6 participants