this post was submitted on 15 May 2024
89 points (95.9% liked)

Programming

17025 readers
88 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

I've heard it thrown around in professional circles and how everybody's doing it wrong, so.. who actually does use it?

For smaller teams

"scaled" trunk based development

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 12 points 4 months ago (2 children)

Here there's main. You branch off. Do your work. Make a PR to main. Build passes and someone approves, merge to main. Production release is done by tagging main.

The branches are short lived because the units of work we select are small. You have like one pr for an endpoint. You don't wait until the entire feature with 20 endpoints is ready to merge.

Seems to work fine. I think this is different than trunk based development but honestly I'm not sure I understand trunk.

[–] [email protected] 1 points 4 months ago

This is enough for most projects.

[–] [email protected] 1 points 4 months ago

Seems to work fine. I think this is different than trunk based development but honestly I’m not sure I understand trunk.

Same. But it feels like you're doing it.

Anti Commercial-AI license

[–] [email protected] 5 points 4 months ago

We've used the "scaled" approach for a whilen and we make tags to release. Every time we have a long-lived branch that isn't main/master something gets fucked up or we spend an extra few days just to reconcile the conflicts. Luckily we're service based so supporting multiple versions of a product is very rare.

[–] [email protected] 2 points 4 months ago* (last edited 4 months ago) (1 children)

We don't have release branches, the commit is just tagged as being currently deployed in production.

People merge their feature branches to master during working hours (by merging CI validated PRs) and release when they get a chance. Normally do about 10-20 releases per day.

[–] [email protected] 3 points 4 months ago

For those of us that develop products that are sold to customers (and run on-premise), you will end up with customers on various releases. It is imperative that we can fix bugs in a release without requiring the customers to upgrade versions (major.minor).

[–] [email protected] 5 points 4 months ago

This actually seems like git flow, but easier while achieving the same objectives.

[–] [email protected] 10 points 4 months ago (1 children)

I haven't worked on any teams where all members committed "every 24 hours", and there have always been some branches that live longer than we'd like (usually just unfinished work that got deprioritized but still kept as an eventual "todo"), but most teams I've worked on have indeed followed the basic pattern of only one long-lived branch, reviews and CI required prior to merge, and all feature-branches being short-lived.

[–] [email protected] 15 points 4 months ago (1 children)

A hard timeline on commit strikes me as less than ideal.

People are people. They have issues, they screw up, but they still write good code.

Seems like a brutal metric that encourages minimal commits without real change.

[–] [email protected] 1 points 4 months ago

Yeah, agreed.

[–] [email protected] 3 points 4 months ago

We have hundred of individual repos and use git flow: short lived feature branches but also long lived develop, master and support branches (for LTS releases).

[–] [email protected] 0 points 4 months ago (1 children)

I guess we do scaled trunk development, if you want to call it that. We do allow direct commits, for trivial or safe stuff where reviews would be more noise and hindrance than value. (Code formatting etc.)

We only have one current release version though. (And at times a current test version that deviates from it.)

If there's a need to create a patch release for a tagged version when the trunk proceeded forward with something that shall not be included, I create only a temporary branch from the earlier tagged commit to tag (=create) that patch release.

What are the release branches supposed to be in your graphs? It says developers don't commit. Then who does?

[–] [email protected] 0 points 4 months ago

Those aren't my graphs, there are from the link in the post. I've only once worked with release branches and it was a nightmare.

Anti Commercial-AI license

[–] [email protected] 4 points 4 months ago

Scaled trunk based all year long, every year, every team.

Life is too short to tolerate long-lived branches.

[–] [email protected] 2 points 4 months ago

Scaled absolutely. Works really well. We have a pr ci pipeline. And cd set up on the trunk. Everything is PRed before being merged to the trunk.

[–] [email protected] 9 points 4 months ago* (last edited 4 months ago) (2 children)

Yes. We use SVN. I hate it. I'm trying to build a case to switch to git. We're a small team, but a growing team

[–] [email protected] 4 points 4 months ago* (last edited 4 months ago) (2 children)

Do you really need to make a case? Does your company not trust devs? Is there people leading that have no idea about technology? SVN is dead. Many devs won't touch it. It's best way to say to new candidates your company is backwards. Many would refuse to work in a company that uses a version control system that has been dead 7 years.

[–] [email protected] 2 points 4 months ago (1 children)

My company still uses SVN, but we have almost 20 years of history in the repository, not including the autogenerated commits from when we migrated from CVS.

My department would like for us to move to git (some sub projects have) but it's important for our process to retain the history and nobody has had the time to figure out if the migration would be clean then update all of our auto-testing infrastructure (which itself is over a decade old) to use git, all while not stopping active development.

[–] [email protected] 1 points 4 months ago

You can use a git client to connect to SVN repo, which is really neat if you have to deal with a SVN repo. Therefore I would assume git has no issues with migrating the history from SVN.

[–] [email protected] 3 points 4 months ago (1 children)

It's effort to switch, and we don't benefit from having separate copies of the repo bc we're so small. No one steps on eachother's toes, so distributed version control isn't necessary.

Now, the fact that most devs know git and SVN is dead is not lost on our CTO, but putting the effort to switch over doesn't provide direct value to the customer, so I have to make the case that switching to git would do enough from a productivity and maintenance standard to effect customers.

[–] [email protected] 0 points 4 months ago (1 children)

But just productivity and maintenance but if your devs start to leave or retire, you're not gonna get the best quality replacements for them if you're using outdated tech. No one wants to learn new skills that aren't going to help with their career growth.

[–] [email protected] 1 points 4 months ago

I'm a relatively new hire and we just hired another person 2 weeks ago

[–] [email protected] 17 points 4 months ago

Welcome time traveler. If you're able to return to your own timeline, buy some Apple stock.

/joking

But I hope your team does migrate. SVN is pretty bad, compared to git.

[–] [email protected] 5 points 4 months ago (1 children)

Only for repos where there are no code reviews or releases. E.g small single developer utilities, configuration repos, etc.

[–] [email protected] 1 points 4 months ago (1 children)

Were there at least tests (where possible) if there were no code reviews?

Anti Commercial-AI license

[–] [email protected] 1 points 4 months ago

In my experience if there are tests there are code reviews and branches.

[–] [email protected] 3 points 4 months ago (1 children)

Worked with both, both worked fine.

[–] [email protected] -2 points 4 months ago (1 children)
[–] [email protected] 1 points 4 months ago

Basically lower and upper end of sizes, yes. Team sizes too.

[–] [email protected] 3 points 4 months ago

Scaled trunk based development for sure, we're a two man team, I do backend the other guy does frontend, but still we use that.

[–] [email protected] 39 points 4 months ago* (last edited 4 months ago) (1 children)

Second diagram, yes absolutely.

Short lived (1-2 day) branches, and a strong CI systems to catch regressions.

Be warned, the strength in the CI lies in its capacity to detect when some functionality that previously worked doesn't work anymore. So, the flow must be green always, and it must evolve as the features evolve. Without good CI you're destined for failure.

[–] [email protected] 5 points 4 months ago

lies in its* capacity

[–] [email protected] 5 points 4 months ago (2 children)

I’ve been a fan of git-flow for a long time. It makes the master consistently stable and production ready, gives mechanisms for hotfixing, patching, releasing, tagging, and regular feature dev with a running develop branch. This tends to be more stable than Wild West commits into dev direct, since you work on a feature in isolation, and then merge the feature in when it’s ready, and keeps prod in its own lane so there’s no risk of a feature accidentally nuking something.

[–] [email protected] 1 points 4 months ago

I'm another git-flow fan. Have not encountered a situation that would motivate me to change workflow. We use submodules all over the place, too.

[–] [email protected] 1 points 4 months ago (1 children)

Doesn't the "scaled trunk-based development" do that too, with feature branches and merge requests? Trunk is your production-ready branch there.

[–] [email protected] 1 points 4 months ago

Yeah they’re similar in several ways

[–] [email protected] 2 points 4 months ago (3 children)

Not saying anything about good or bad, but trunk-based development doesn't work when the business requires you to have multiple releases under development concurrently.

[–] [email protected] 2 points 4 months ago* (last edited 4 months ago)

In TBD, it's not a "release" until its production ready. The methodology and philosophy doesn't prevent you from developing multiple feature branches at once or even deploying a work in progress feature branch to a dev environment.

All TBD requires in that case is once the feature branch is production ready, it's merged to the trunk. You may need to add a feature toggle if there are multiple release like for different architectures. And you also might benefit from using git tags and deploying to production from a git tag instead of the most recent commit on a branch.

Exactly what you need to do is going to depend on the project's exact needs but TBD is totally possible in that example.

[–] [email protected] 2 points 4 months ago (1 children)

I don't think anything works in that situation.

[–] [email protected] 1 points 4 months ago

What about long-term support releases?

load more comments
view more: next ›