Heat oven to 180C/160C fan/gas 4. First, make the filling. Boil the potatoes in a large pan of salted water for 10-15 mins until a knife is easily inserted but the potatoes still hold their shape.
Melt the butter in a medium saucepan over a low heat. Slowly sweat the shallots and spring onions with a pinch of salt until softened, stirring occasionally, about 10-12 mins. Meanwhile, whisk together the eggs, cream, thyme, cheese and some seasoning. Set aside.
To make the pastry, melt the butter with 100ml water in a small saucepan and bring to a simmer. Tip the rest of the pastry ingredients and 1 / 2 tsp salt into a large bowl. Make a well in the centre and pour in the butter. Stir with a wooden spoon, then bring together with your hands, kneading lightly for a few mins.
Grease a large 20-26cm pie dish. On a lightly dusted work surface, roll out two-thirds of the pastry big enough to fill the base and sides of your dish. Use the remaining pastry to roll out a lid.
Add the potato and shallot mixture to the beaten egg filling, and spoon into your pastry case. Cover with the pastry lid and crimp the edges decoratively.
Finally, beat the egg yolk with the milk and glaze the pie. Poke a couple of small steam holes in the top, chill for 10 mins, then bake in the oven for 40-45 mins.