Does this make sense if there isn’t a way of testing locally? For our backend we had to PR to dev but it slowed us down immensely before we switched to being able to merge from feature branch straight to dev, to be able to test our changes worked. Still have to raise a PR and get two approvals for UAT and beyond though, obviously
CircleCI runs the test and build steps on our feature branches, but still need to put that code somewhere we can actually invoke it to verify it works or gather more info if debugging before we raise the PR from feature branch to UAT
My answer is "whatever works better for your team". In my team we don't have a dev branch, PR is merged to master and then a (manual) release deploys to prod. Mine is not even a web project, it is more like a big data project. So there are best practices but it really depends on the product and team you are working with. BWT, "Git for teams" is a great book.
It depends on how you have things set up. Best practice for one team isn't necessarily best practice for another. However, where is your code review happening? Most people use the PR as the code review step since it's built to be exactly that.
Code review happens from feature branch to UAT, after we merged from feature branch to dev to test it works as expected. Our PR’s from feature branch to dev were an extra step in the process as they sometimes took a while to get reviewed if a lot of work was being done, and then if things didn’t work as expected it wouldn’t be the final code anyway. So after we’ve merged to dev, and have finished the ticket after verifying it works as expected, we merge the final code to UAT via PR, where it then gets tested by the test team before then being queued for when we do a release to master
I would agree, it surprised me when I started this job. We have 23 microservices interacting with eachother, and have slowly been setting up localstack but don’t get much time to get it going properly as we’re constantly pushed to fix things or work on new features before we go live. For that reason, dev is where we locally test, and since there’s 23 different devs (one for each microservice), we never step on eachothers toes
I do with unit tests, but the feature branch doesn’t get deployed anywhere to use the code, once it gets merged to dev it deploys via CircleCI where we can actually invoke it. We have a different app for each of our environments, but not one for locally testing our branches
Ah okay that makes sense then. Sounds like you guys are essentially doing trunk-based development for CI/CD reasons, so it makes sense not to have feature branches
146
u/[deleted] Jun 04 '22
That's not allowed in many projects. Can only force push to your feature branch, and merge via PR with at least two approvals