Configuration-to-configuration and configuration comparison #6
thorwhalen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The context of this discussion was to (see private opus discussion) make some tools that helped CI template migration.
But really, as we go up the abstract stack, we realize that, once templates have been "embodied" -- that is, conventions have been expanded to their explicit configuration, optionally merged with any specific configuration edits that may have been specified -- our problem boils down to comparing mappings, and then doing something based on that comparison.
Original context
(...)
Perhaps something like this might help, to both isolate and study the differences, and therefore know what to do about them -- if they're not too many, perhaps diagnosis + manual edits is the way to go:
Note:
equivalence_funcis there because the default comparison operator (operator.eq, that is,==) may not be what's appropriate, so we might want to control that bit.Bits of code
Two of the functions here are candidates for mini-frameworks:
expand_conventionanddiff_dict.The
expand_conventioncould be aconfig2pymini-framework, and is related to embody (as well as third party tools like cookiecutter, flit, etc.).Here's some starter code for the rest.
Note: This
diff_dictis just for starters: We'd like to have a more general mini-framework for mapping comparison -- either in dol or here in config2py. One that, for example, doesn't use a booleanequivalence_funcbut rather acomparison_functhat outputs a comparison object that can then be used down-stream for filtering, further analysis, etc.Beta Was this translation helpful? Give feedback.
All reactions