[ANN] Metav: A lib helping versioning and releasing tools.deps projects, feedbacks welcome

clojure

#1

Hi there,

I’ve just released an alpha version of Metav, a library that help the release and versioning process of Clojure projects, particularly the one using tools.deps and a Monorepo style (see Rationale).
Feedbacks are welcome :slight_smile:

Jérémie.


#2

I think the problem is right! I don’t like the feeling when set my new version manually in a file, to build a new versioned artifact; and having to manually ensure that I keep VCS in sync with the artifact. Pulling that information directly from VCS seems like a better solution!


#3

Thanks for the feedback @teodorlu,
Deriving the version from git and being able to link an artifact to a SCM ref is an important concern for me. There are some solutions in the leiningen ecosystem like:

The monorepo concern is also a different one with solutions like:

I like tools.deps simplicity and composability and wanted to mix several tools.deps modules in one repo with a simple versioning and releasing process (like the release task of lein that I’m fond of), that was the inception of Metav.

Jérémie.


#4

Where is the version info stored?


#5

Huh, didn’t know about lein release. Thanks for the link! I can stop doing that manually, now.


#6

The version info is entirely deduced from git infos: partly from git tag and partly deduced from the git number of commits since that tag and the current state of the repo (dirty or not).
E.g.:

  • 1.5.2+f34b91-DIRTY -> 1.5.2 is the last tag, f34b91 the current commit’s SHA and -DIRTY because the repo has some uncommitted change.
  • 1.5.2 -> 1.5.2 is the last tag and no commits since then and no untracked or uncommitted file
  • 1.5.2+f34b91-> 1.5.2 is the last tag, f34b91 the current commit’s SHA (Metav don’t include the distance as the monorepo style may include commits not related to that module, hence that info is non pertinent) and no untracked or uncommitted file

A feature (not yet implemented but I’ll do in the near future) is the possibility of “spitting” metadata (version, path in the monorepo, timestamp, etc.) in a meta.edn file. The typical use-case would be to include that file in an artefact for the version infos to be published at runtime (in a webapp, in log, etc.), with some minor risk of desynchronisation between the real version and the one in the file, particularly during development.


#7

Please add this to the tools list at https://github.com/clojure/tools.deps.alpha/wiki/Tools when you get a chance!


#8

Sure @alexmiller, it’s done.


#9

Nice, that’s a pretty good versioning strategy actually. I like it. Good Job


#10

thanks very much, i’ve looked for it for a long time