Hello, again! It’s that time again. That’s right, you guessed it. It’s New Feature Day yet again! Here at env0, we are very focused on helping you have the best development experience possible. If you’ve been keeping up with us for a little while, you may have seen a blog from one of our Software Engineers, Arel Rabinowitz. It was about making Continuous Deployment of Terraform code easier with env0. This helps you step up your development game with GitHub up to a whole new level. A big part of that software development processes is Pull Requests. But, what are they? And why are they important?
As per GitHub, “Pull requests let you tell others about changes you’ve pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.”
Essentially, this allows you to work on your code, without breaking your main branch where the “good” code is. env0 helps you take that a step further. Reviewing the code changes is important, but what if you’re not entirely sure what changes these updates will have on your running environments? When your business is moving fast while staying stable, this is critical. Your production environment absolutely has to be online and working 24/7, you can’t afford to accidentally bring it down or break it with a bad update. With that said…
Today, we would like to introduce the ability to easily enable Pull Request Plans! That’s right. You’ll now be able to see what changes would be made to your infrastructure if you merged that branch, for any GitHub integrated repository.
“As a devops engineer, as I open a Pull Request with Terraform infrastructure changes, I’d like to know what the Terraform plan would look like if my changes were to be applied on the target branch Environment”
Now that we have this feature enabled, how does it work? Well, all you have to do is create a pull request for that environment. I went into GitHub and created a simple branch called PR Plan. I then made an edit on a file, simulating an update.
At this point, if you went back into env0 you would see that the trigger you enabled for your PR Plan has already started running without anything else being done by you.
On your PR in GitHub, you’ll see that the env0 bot has created a comment in the PR itself, with your plan results!
But, what if you keep making new commits to the code inside that PR? We’re not just going to keep flooding your PR with comment after comment. Our bot simply updates the comment that was already there. That way, you have the most up-to-date information readily at hand.
“How do you set this awesome feature up,” you say? I’m glad you asked. It is an extremely complicated process… of simply clicking the Run Terraform Plan on Pull Requests targeting this branch checkbox, and then click Save! This is done from the Triggers tab in any Environment.
Don’t let the simplicity of this feature overshadow how big of a step this is for your development process. We already have customers who are using this for their environments and are thrilled we’re making the planning process easier, and more integrated.
Make sure to let us know what you think about this awesome new feature. And stay tuned for a follow up to this blog highlighting more advanced use cases for the PR Plan feature! You can reach out on Twitter, LinkedIn, or schedule some time with us directly here.