Renovate is about to get a lot better for Elixir

If you’ve read me before, you know I’m an automation freak. I have a few posts already on the topic, including one about automating updates to the Elixir docker image with Renovate.

Since businesses are off for the holidays, I used the opportunity to power through some improvements I really felt were needed :tada:

Are any of you using Renovate or something similar, or even just enthusiastic about these kinds of automation? :eyes:

P.S. the draft PRs are ready to go as well, they’re just dependent on the previous ones.

6 Likes

You may be interested in something that we’re doing with igniter! We have a drop in replacement for mix deps.update that allows packages to provide update scripts that can intelligently update the users code base to adapt to changes in libraries. For example: igniter/lib/mix/tasks/igniter.upgrade_igniter.ex at v0.5.3 · ash-project/igniter · GitHub

When coupled with something like renovate or dependabot, it’s wildly useful!

5 Likes

So if you do mix igniter.upgrade … it will also make the suggested changes from the library’s upgrade code. There is a tool to do it in ci where you can specify the old version and the new version directly, so one commit to update deps, and another commit for any updates from the old version and the new version.

We use it in Ash’s CI: ash/.github/workflows/ash-ci.yml at 718ea604a3d3c6851d061900458f45d7a3673f26 · ash-project/ash · GitHub

1 Like

Definitely interested, this is great! I can’t believe you’re always working on something that interesting Zach :laughing:

I’ll be integrating it into my workflows, that’s going to make dependency management even easier. I assume it’s mainly used in Ash projects for now?

Found the “Limitations” section about committing, turns out I’m quite comfortable with the subject from working on Semantic Release, I’ll try to document my approach so we can integrate it in the docs if that can help.

Yes please! Someone else explained to me that it is possible, but I haven’t had the time to work it out and document it. At the moment Ash is the main user of igniter, but other libraries are adopting it as well, including a pretty large one that I will let make their own announcement about it :sunglasses:

3 Likes

Yes! I’m a big fan of renovate. And automation… Was waiting for lockfile maintenance for a while… :pray:

1 Like

If that can be helpful, I got a few Elixir + Renovate repos on GitHub:

I already got most repos equipped with renovate (e.g. GitHub - mruoss/kubereq: A Kubernetes Client for Elixir based on Req) but I will compare the config, thanks.

1 Like

I am super sure it will be Ecto with adapter and queries patching and we all go NoSQL in a wink of an eye. No doubt!

Renovate seems like a very interesting project! To bad I’m on a code free period :disappointed:

2 Likes

Don’t worry, it’ll still be around when you come back :grin: Enjoy the break!

The dependency type and range strategy PRs just got deployed to the Mend Renovate app! :rocket:

Here’s the update PR from the screenshot above:

Lockfile maintenance PR is still in review, unfortunately, but I’ll post here once it’s deployed as well :wink:

1 Like

Fun fact, it turns out I’ve fixed the update-lockfile strategy as a side effect of “fix Elixir’s special operator in list (#33325)” :tada:

Here’s some context for those who might not know Renovate well enough to get it:

  • the update-lockfile strategy is about updating a specific dependency in mix.lock if a new version satisfying the range from mix.exs is available
  • lockFileMaintenance will update all indirect dependencies directly in mix.lock

As an example for lockFileMaintenance, because ash requires decimal ~> 2.0, if your mix.lock had it locked to 2.2.0, it would update the locked version to 2.3.0).

This wasn’t working at all until right now, and I didn’t expect this change (I didn’t even think about it for some reason, but I’m pretty happy I fixed it “by mistake” :laughing:)

Here’s the PR that made me aware of this for reference: “build(deps): update dependency castore to v1.0.11 (#28) · sheerlox/nodelix”

@mruoss that might already be a very good step regarding your needs :tada:

3 Likes