Conversation
…lassmethod Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor _sync_helpers to move template-related helpers to RhizaTemplate
Refactor: migrate template helpers from Mar 8, 2026
_sync_helpers to RhizaTemplate private methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_sync_helpers.pycontained 8 template-specific functions that operated directly onRhizaTemplatedata, creating unnecessary coupling and module bloat. These have been moved to the class as private methods/static methods, eliminating deferred imports frommodels.py → _sync_helpers.models.py—RhizaTemplateadditions@staticmethod _expand_paths,_excluded_set,_prepare_snapshot— snapshot pipeline helpers@staticmethod _update_sparse_checkout,_get_head_sha— pure git utilities_clone_template_repository(self, ...),_clone_at_sha(self, ...)— instance methods usingself.git_urlfrom_project(cls, target, branch)— public classmethod replacing the standalone_validate_and_load_template; callsfrom_yamlinternally with full validationclone()/snapshot()now callself._xxx()— no more deferred_sync_helpersimports_sync_helpers.py— signature changes_merge_with_baseand_sync_mergenow accepttemplate: RhizaTemplateinstead of separategit_url+include_pathsparams:sync.pyUses
RhizaTemplate.from_project(target, branch)(public API) and passestemplatedirectly to_sync_merge.Tests
TestExpandPaths,TestExcludedSet,TestPrepareSnapshot,TestGetHeadSha,TestCloneAtSha,TestCloneAtShaErrorPaths,TestCloneTemplateRepository,TestUpdateSparseCheckout,TestValidateAndLoadTemplate)@patchtargets fromrhiza.commands._sync_helpers.*→rhiza.models.RhizaTemplate.*_merge_with_base/_sync_mergecall sites to passRhizaTemplateinstancespopulate_baseside-effect signatures drop thegit_urlpositional arg (nowself.git_url)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.