Heat the oil in a large shallow casserole dish. Fry the onion over a low-medium heat for 7 mins or until soft and turning translucent. Turn up the heat slightly, add the chicken and fry for 5 mins until beginning to brown around the edges. Tip the garlic and chilli into the casserole and fry for 1 min. Stir through the pesto, pour in the stock and tomatoes, then add the thyme, sugar and some seasoning. Turn the heat to low and cover with a lid. Cook gently for 40 mins. Remove the thyme and check the seasoning.
Heat the oven to 200C/180C fan/gas 6. To make the dumplings, put the butter and flour in a bowl with ½ tsp fine salt, then rub the butter into the flour with your fingertips until it resembles fine breadcrumbs. Mix in 50g of the cheese and pour in 50ml of the milk, then swiftly combine with a cutlery knife until everything is well distributed and you have a soft dough (add more milk if it’s too dry). Briefly bring the dough together on a worksurface, then divide into eight balls.
Arrange the dumplings over the stew, then scatter each with the remaining cheese. Put in the oven and bake, uncovered, for 25 mins or until the dumplings are doubled in size and golden brown. Scatter over the parsely and serve.