The starting point is Sukkah 52b:13, where the Gemara identifies the 'seven shepherds' of Michah 5:4 as David in the center, flanked by Adam, Seth, and Methuselah on his right and Abraham, Jacob, and Moses on his left, a reading that Rashi (Michah 5:4-5) cites while noting he does not know its source, and that Radak (Michah 5:4-5) likewise records.
The Zohar develops a related but distinct septet of guests who dwell with Israel in the sukkah, described as coming to rest under the shadow of faith, with Abraham representing chesed and five other tzaddikim alongside David representing malchut, as brought in Zohar, Emor 42:260-269 and elaborated in Sulam on Zohar, Emor 276, Sulam on Zohar, Emor 277, and Sulam on Zohar, Emor 264.
Kitzur Shulchan Arukh Yalkut Yosef, Orach Chaim 639:11 draws the explicit link, stating that the sanctity of the seven exalted ushpizin who visit the sukkah is called 'the seven shepherds' and names them as Abraham, Isaac, Jacob, Moses, Aaron, Joseph, and David, a list that differs somewhat from the Gemara's shepherd-list in personnel while sharing the number seven and the honorific title.
Nitei Gavriel, Sukkos, perek 37 likewise records the ushpizin as Avraham, Yitzchak, Yaakov, Moshe, Aharon, Yosef, and David as guests joining Israel in the sukkah, while noting a variant ordering that places Yosef before Moshe and Aharon.
Revavos Ephraim (Revavos Ephraim 7:191) takes up the Michah-based 'seven shepherds' directly, citing Sukkah 52b:13's identification of David in the center with Adam, Shet, and Metushelach to his right and Avraham, Yaakov, and Moshe to his left, underscoring that this is the source-list for the shepherds as distinct from the ushpizin roster.
Later homiletic treatments continue to link the sukkah's sanctity to this septet imagery: Sefat Emet, Devarim, Sukkot 21:2 ties the mitzvah of dwelling in the sukkah to seating the ushpizin per the Zohar, while Shem MiShmuel, Chanukah 73:2 independently discusses the meaning of the 'seven shepherds and eight princes' of Michah 5:4, and Michah 5:4-5 and Metzudat David supply the base pasuk and its plain-sense gloss that these shepherds and princes are meant to instruct and rule the people.