01 - Set oven temperature to 400°F (200°C) to ensure thorough roasting.
02 - Combine cherry tomatoes, sun-dried tomatoes, garlic, and 2 tablespoons olive oil in a large ovenproof dish. Season with salt, pepper, oregano, and optional red pepper flakes, then toss to coat.
03 - Nestle the feta cheese block in the center of the tomato mixture. Drizzle remaining 1 tablespoon olive oil over the feta and season lightly with black pepper.
04 - Place the baking dish in the oven and roast for 25–30 minutes, until tomatoes are bursting and feta is golden and softened.
05 - While baking, heat a large skillet over medium heat. Add 1 tablespoon olive oil and cook sliced onions for 15–20 minutes, stirring occasionally, until deep golden and caramelized. Set aside.
06 - Boil pasta in a large pot of salted water until al dente, following package instructions. Reserve 1/2 cup pasta water, drain, and set pasta aside.
07 - Remove the baking dish from the oven. Add caramelized onions and chopped basil, then stir to break up the feta and blend the sauce.
08 - Add drained pasta to the tomato and feta mixture, tossing well to coat. Gradually add reserved pasta water as needed for a creamy consistency.
09 - Plate immediately. Garnish with extra basil and a drizzle of olive oil if desired.