News for hackers. Stuff that matters.
Re:A routine gem update ended up creating $73k worth of subs... by noneeeed on Friday January 07, 2022 @06:21PM (#29846369)
We use Mongoid. I treat every upgrade, no matter how small as its own piece of work involving going through the changelogs with a fine-tooth comb. This particular issue got flagged up when we last looked at upgrading. Currently Mongoid upgrades are stalled until we have the time to figure out the impact of some of their more egregious changes.

I have a generally low trust approach to all dependency upgrades, irrespective of how minor they are, I've been bitten by enough "minor" changes. But I treat Mongoid as an active adversary who is setting out to break things with every update.

It's the complete opposite approach to that of the Rails core team and those that work on ActiveRecord (as the nearest equivalent to Mongoid). Changes to Rails core are always well flagged with really good advance warning of upcoming breaking changes, frequently with deprecation warnings several versions in advance. There just seems to be a core culture of thought and care towards their users.

Re:A routine gem update ended up creating $73k worth of subs... by jrochkind1 on Friday January 07, 2022 @08:42PM (#29847637)
That sure doesn't seem to be an endorsement of mongoid.
Re:A routine gem update ended up creating $73k worth of subs... by dsjoerg on Friday January 07, 2022 @10:55PM (#29848480)
It wasn't meant to be. But in a way it is -- mongoid is so useful, that it's worth putting up with some of the flaws in its release/upgrade management. So, it's temperamental. Like owning a Jaguar.
Re:A routine gem update ended up creating $73k worth of subs... by noneeeed on Saturday January 08, 2022 @03:26PM (#29855812)
It isn't.

We have used Mongo for good reasons, it's been appropriate for our workload, and we have used Mongoid since the inception of the product long before I joined the company. Replacing Mongoid at this stage would be a massive piece of work.

I find Mongoid's documentation is vague and lacks important detail, and the API itself violates the principal of least surprise frequently enough to be a problem.

It really is the ugly stepchild of ActiveRecord, in whose image it was created, and which by comparison has been a pleasure to both use and to manage.

Re:A routine gem update ended up creating $73k worth of subs... by jacquesm on Friday January 07, 2022 @06:31PM (#29846460)
This is part of the TCO of any major software project, kudos for getting it right, that's a very mature process you have there.
Re:A routine gem update ended up creating $73k worth of subs... by nefitty on Friday January 07, 2022 @06:53PM (#29846688)
I feel spoiled having most of my experience in js, react and node. They like, try really hard not to totally break shit.
Re:A routine gem update ended up creating $73k worth of subs... by fouc on Friday January 07, 2022 @09:43PM (#29848077)
You would feel spoiled if you were a ruby developer too.

This type of library API breaking change on a minor version update basically never happens.

And if it can happen in ruby land, it can happen in JS land too.

Re:A routine gem update ended up creating $73k worth of subs... by weaksauce on Friday January 07, 2022 @10:52PM (#29848460)
i mean the whole lpad debacle was pretty egregious and that's directly in the javascript land
Re:A routine gem update ended up creating $73k worth of subs... by astrowilson on Saturday January 08, 2022 @03:56AM (#29849912)
> This type of library API breaking change on a minor version update basically never happens.

Literally happens all the time with Rails. To the point they decided to call their versioning schema “shifted semver” to afford themselves API changes on minor versions: https://guides.rubyonrails.org/maintenance_policy.html

Good luck if you are using Rails and ecosystem and you expect any sort of sensible versioning.

Re:A routine gem update ended up creating $73k worth of subs... by byroot on Saturday January 08, 2022 @04:38AM (#29850090)
Rails committer here.

First I get that people are used to SemVer, but it is unreasonable to assume all projects follow it. And yes in semver terms, you can simply assume that Rails X.Y is a major release.

Then, any breaking change in Rails must first emit deprecation warnings, so unless you are jumping one version, this kind of scenario shouldn't happen with Rails itself.

Also note that Ruby (MRI) itself more or less behave the same regarding versioning, deprecations and breaking changes. First emit warnings, then break.

Re:A routine gem update ended up creating $73k worth of subs... by flubflub on Saturday January 08, 2022 @07:43AM (#29851149)
I don't use Ruby.

Are packages that don't follow semver allowed to be released?

Haskell asks for PVP for example.

Re:A routine gem update ended up creating $73k worth of subs... by byroot on Saturday January 08, 2022 @10:40AM (#29852654)
Yes, you'd need an automated way to catch the API breakage, which would be particularly tricky.

And even with very strict typing, the breaking change showcased in the article wouldn't have been caught, the API stayed the same, it just behave differently. Not every backward incompatible change is as simple as a function signature change.

Re:A routine gem update ended up creating $73k worth of subs... by flubflub on Saturday January 08, 2022 @03:36PM (#29855914)
When I tried to submit a package to Hackage, I was asked if I was aware of the packaging guidelines. The person who I emailed to register also inspected my package and told me that my dependencies were wrong and not compliant.

I really don't think this is a scalable approach and was really surprised that someone took the time to check my dependencies personally. My experience may just be rare.

I meant more on the human side than automated. Haskell doesn't have that much to do with formal verification in usual use. I'm not sure what the best policy for a good yet vibrant package ecosystem is.

Re:A routine gem update ended up creating $73k worth of subs... by astrowilson on Saturday January 08, 2022 @05:31AM (#29850333)
That’s precisely my point. With Rails and Ruby breaking APIs on every new minor release, the only realistic expectation is that every minor release of anything may have breaking changes, because that’s the example being set. And it just makes the experience of updating any Rails project even worse than it already is.

The language and framework, by your own statement, are pushing breaking changes at a yearly rate. That’s a horrible developer experience.

Re:A routine gem update ended up creating $73k worth of subs... by byroot on Saturday January 08, 2022 @05:49AM (#29850462)
No the expectation is that users of projects stop assuming SemVer is followed by every projects.

> pushing breaking changes at a yearly rate. That’s a horrible developer experience.

That's your opinion. I much prefer these bite sized yearly changes to much bigger changes over longer periods. e.g. Ruby with this strategy never had the big divide Python 3 had with its much larger change.

Re:A routine gem update ended up creating $73k worth of subs... by astrowilson on Saturday January 08, 2022 @07:14AM (#29850948)
You may not believe this, but there are other ways of versioning software beyond breaking things every year and doing whatever Python 3 did.
Re:A routine gem update ended up creating $73k worth of subs... by byroot on Saturday January 08, 2022 @10:47AM (#29852723)
> You may not believe this

You may not need to be confrontational...

> there are other ways of versioning software

I'm sure there is. But some features and other improvements sometimes require to deprecate and remove some older features.

Each project will chose its own tradeoff between bringing the improvement faster vs keeping compatibility longer.

Re:A routine gem update ended up creating $73k worth of subs... by chucke on Saturday January 08, 2022 @04:15AM (#29849991)
Rails never was semver. Their yearly major-minor grand release always, always breaks API all around. It's inevitable. Any rails-only gem will as a result have a strong incentive not to follow several.
Re:A routine gem update ended up creating $73k worth of subs... by rgoulter on Saturday January 08, 2022 @01:12AM (#29849073)
Well, except for leftpad.