Resolve variant includes with the correct ordering
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.
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
Differential Revision: https://phabricator.wikimedia.org/D959