I brought an infestation into my basement when I moved inside last fall.
Took them a few months to build to a damaging population, but once there they were causing real trouble, especially to smaller plants.
In my experience, no one thing has been entirely effective.
What I have done to lower population to a negligible level:
Water less often.
Always include some Bti (
Bacillus thuringiensis subspecies
israelensis) in every watering.
Cover the soil with sand or
diatomaceous earth.
Sticky traps.
The traps only act as an indicator of how successful you are being since adults only interest is in reproduction. The real fight is taking place in the soil.
At this writing I can still find adult flies if I search, but the numbers seem to be below crisis levels and falling. It has been a long fight, but the garden looks good again, and that's what counts.
Good luck and thanks to the farm for helping me get here.