Fork me on GitHub
#polylith
<
2022-05-24
>
Teemu Kaukoranta13:05:40

If I have a git SHA, can I use poly to tell me which projects were changed in that commit?

imre13:05:40

Subscribing to this as I also need this info. Have a workaround but not convinced it will work in all situations

Teemu Kaukoranta13:05:14

yeah, specifically what I'd like to do is show the commits between the previous and the new tag (= production release). Obviously just listing the commits is easy, but I don't want to list all the commits, just the ones that changed the project in question

imre14:05:56

(defn files-changed-in-commit [dir git-ref]
  (git dir "diff-tree" "--root" "--no-commit-id" "--name-only" "-r" git-ref))

imre14:05:34

Then pass the result of that to

(defn poly-changes [{:keys [paths] :as workspace} changed-files]
  (poly-change/changes
   workspace
   {:tag       "n/a"
    :since     "n/a"
    :since-sha "n/a"
    :files     changed-files}
   paths))

imre14:05:50

(require '[polylith.clj.core.change.core :as poly-change])

imre14:05:31

is what I do now (as I'm building out our main pipeline)

imre14:05:03

obviously, this isn't supported by polylith (I'm calling into an implementation ns there on top of all that)

Teemu Kaukoranta14:05:06

Thanks for sharing :thumbsup:

imre14:05:31

please do ping me if you have a better version or something more official 🙂

👍 1
Eugen13:05:24

We merged our polylith branch into our main development branch past week

poly  0.2.14-alpha
workspace$ info
  projects: 8   interfaces: 24
  bases:    7   components: 24

🎉 6