Resolve variant includes with the correct ordering
Summary:
Refactored variant include resolution to correctly order the hierarchy
of includes while still protecting against infinite recursion. The
function was renamed, refactored for clarity, and exported so as to be
better tested and documented with examples.
Test Plan:
Run go test ./....
Check the rendered config.ResolveIncludes godoc for sanity.
Reviewers: thcipriani, mmodell, hashar, Jrbranaa, zeljkofilipin, demon, Release-Engineering-Team
Reviewed By: thcipriani, Release-Engineering-Team
Tags: Release-Engineering-Team
Differential Revision: https://phabricator.wikimedia.org/D959