-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
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. |
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 :) |
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. |
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. |
"strings" | ||
|
||
"github.com/allegro/marathon-consul/apps" | ||
"fmt" |
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.
find ./ -name '*.go' | xargs goimports -w
late but 👍 :> |
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.