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

add 'sync' command to sync remote split assignments with local schema #64

Merged
merged 20 commits into from
Feb 10, 2025

Conversation

SirNeuman
Copy link
Contributor

@SirNeuman SirNeuman commented Jan 29, 2025

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.

@SirNeuman SirNeuman marked this pull request as ready for review January 30, 2025 16:28
@SirNeuman SirNeuman changed the title add sync command to sync production split assignments with local schema add 'sync' command to sync production split assignments with local schema Jan 30, 2025
@SirNeuman SirNeuman changed the title add 'sync' command to sync production split assignments with local schema add 'sync' command to sync remote split assignments with local schema Jan 30, 2025
splitMap["weights"] = valueMap["weights"]
}
}
}
Copy link
Contributor Author

@SirNeuman SirNeuman Jan 30, 2025

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.

Copy link
Member

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?

Copy link
Contributor Author

@SirNeuman SirNeuman Jan 30, 2025

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

Copy link
Contributor Author

@SirNeuman SirNeuman Jan 31, 2025

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

@smudge smudge requested review from smudge and a team January 30, 2025 19:27
Copy link
Member

@smudge smudge left a 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.

@SirNeuman SirNeuman requested a review from smudge February 3, 2025 18:47
Copy link
Member

@smudge smudge left a comment

Choose a reason for hiding this comment

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

domain LGTM

@smudge smudge merged commit f2d887e into Betterment:main Feb 10, 2025
2 checks passed
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.

2 participants