-
Notifications
You must be signed in to change notification settings - Fork 6
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
add 'sync' command to sync remote split assignments with local schema #64
Conversation
splitMap["weights"] = valueMap["weights"] | ||
} | ||
} | ||
} |
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.
Basically we unmarshal both remote JSON and local YAML files. Then we match split names, and whatever split names match we assign the "weights" from the JSON to the YAML file. Then we write and marshal the YAML object back.
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.
Is there anything that can be reused from (or incorporated into) the existing schema.go module?
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.
Yeah i'm kinda learning this project and go as i go... i've refactored it to use schema write
and read
methods. Now i'm looking into whether i can use the "server" get method so we don't have to pass in the remote url as an argument, and also hopefully figure out how to clean some of this stuff around unmarshalling/marshalling the weights from json and casting them to serializable yaml values to write back to the file
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.
@smudge i think it's at a good place now for another review
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.
domain LGTM && platform LGTM -- 👏 I love this -- great utility function that resolves a longstanding painpoint w.r.t. local dev getting out of sync with what is actually true in production today.
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.
domain LGTM
Context:
Sometimes we want to sync our local TestTrack assignments with the weights in the production environment. Creating a TestTrack CLI command to easily take all the assignments from remote json split registry and assign them to local yaml assignment file.