DEV Community

Discussion on: Do you merge branches locally or create pull requests for personal projects?

Collapse
 
rogerzanoni profile image
Roger Zanoni

I usually create one branch for each fix or feature, working alone or in teams. If I'm working alone I just keep everything rebased with the remote master and when I decide to push something, I checkout master, rebase with the branch I was working on and push.

I was curious about why you sometimes push, create a PR and merge your own change by accepting your PR, but I saw that you answered in another comment that you use github actions; what kind of actions are you using?

Collapse
 
deciduously profile image
Ben Lovy

For the project I'm thinking about right now, I have two: an action that builds and runs my Rust unit tests and another that builds, tags, and pushes a container to DockerHub.

The Rust tests are something I generally run locally anyway, but it's nice to have as a commit hook, and the Docker one is actually really one I only need when pulling changes into master - it's not really necessary when reviewing a potential PR beyond a sanity check that the deploy will succeed. I'm not actually convinced that either of these are good enough reasons to stick with this workflow.

Collapse
 
rogerzanoni profile image
Roger Zanoni

I guess that's convenient because there's some ready-to-use actions out there and you can quickly setup them. At work I don't worry about this because there's a nice workflow using gerrit and jenkins, but if I wanted to setup something like it for my personal projects quickly I'd go for something like what you are doing, or setup some local actions for tests and deployment (I almost always use the second option in my projects)

Thread Thread
 
deciduously profile image
Ben Lovy

Exactly - I spent maybe seven minutes total customizing the pre-built YAML on both these actions, which is about how much time I want to spend on CI/CD for a hobby project.

For local actions, I've always just used a Makefile, or NPM scripts when relevant - how do you manage yours?

Thread Thread
 
rogerzanoni profile image
Roger Zanoni

I used to make a "scripts" folder in each project containing shell/python scripts to make my life easier, but since most of my workflow in personal projects (mostly written in c++) end up only in dealing with dependencies and running tests, I just create a conanfile for the dependencies and write tests using catch2. But github actions look cool, maybe I'll start experimenting with it as well or set some private ci workflow.

Thread Thread
 
deciduously profile image
Ben Lovy

Oh wow, first I've heard of conan - definitely going to explore this as I dig deeper with C++. I think GH actions can be used in concert with something like this, yes, I'm generally impressed with the UX.

Thank you!