That was my opening line for why I joined Dagger in Dagger 2024: A Shared Vision. Since then, I've been in situations where I'm reminded that what we are building does make the CI part of the stack fun to work on. Today I'm going to show what that looks like in practice with something I worked on this past week.
Preview environments are great. Although they can be challenging to implement at a large scale, for our small team they work amazingly well. Their ephemeral nature makes them reliable. Unlike traditional long-lived staging environments that end up becoming their own separate application, preview environments come and go since their lifecycle is linked to pull requests. Authors can play with it as they see fit, share public URLs and be confident that what they are changing in a pull request will not break production. Well... Until last week that wasn't the case for us. Due to constraints in engineering time as well as limitations of RDS, preview environments for dagger.cloud were using the same production database. This meant developers needed to take great care and treat the data in preview environments as real production. It was time to fix that.
Enter neon.tech, a managed Postgres with built-in branching. You create a database, you run neonctl branches create and you have a dedicated instance of your database with an exact copy of production data. But what does all this have to do with CI? Well, to make this work someone has to: