Fork me on GitHub
#polylith
<
2022-12-08
>
seancorfield01:12:53

Several examples of Polylith saving us money -- and saving my butt during deployment windows that went wrong 🙂

🚀 3
tengstrand06:12:58

Reading this blog post truly made my day! It’s so cool that the vision I had for Polylith, also works in practice! So thanks @U04V70XH6 for sharing this to the community!

🎉 1
seancorfield06:12:29

And works at scale!

seancorfield06:12:07

I should send you an updated ws.edn file. I'll try to remember next week when I'm back at work.

👍 1
furkan3ayraktar07:12:16

I totally agree with Joakim! It made my day :dancer:

Travis15:12:21

Awesome blog post

winsome03:12:47

I've got a small polylith workspace with 5 bricks, no bases, and just the dev project. I'd like to run the tests for all the bricks, but when I run poly test :all-bricks it reports that there are no tests to run. There are definitely tests for those bricks, so I'm not sure what I'm doing wrong.

seancorfield03:12:23

poly test :dev :all will run all the tests, in the context of the development project.

seancorfield03:12:02

Tests are always run in the context of a project -- either development or one of the projects.

seancorfield03:12:01

By default, it runs only from the non-`development` projects, so if there are no projects, it won't run any tests. That's why you need to specify :dev to trigger development project testing.

seancorfield03:12:10

(your :dev alias has dependencies on all five components yes?)

winsome03:12:02

poly test :dev :all doesn't seem to find anything to run, so maybe not? I've got all the bricks' src and resources directories specified as :dev extra-paths in the workspace deps.edn, is there another way to depend on them?

winsome03:12:25

The test paths are under the :test alias.

seancorfield03:12:42

Ah, you have paths not deps and :local/root? Are you using Cursive?

winsome03:12:08

I'm using emacs, but hopefully once this is working I can share it with coworkers who do use Cursive.

seancorfield03:12:14

You may need :all-bricks in addition to what I posted.

seancorfield03:12:27

poly test :dev :all :all-bricks should do it.

seancorfield03:12:41

I'm sorry you have to use the paths approach, that's a pain 😞

winsome03:12:48

I know, I'm rooting for cursive to catch up, the local/root way seems much nicer : )

winsome03:12:54

And that worked, thanks 👍

seancorfield03:12:53

The :local/root deps approach saves you from duplicating all the bricks' library deps into the :dev alias. That can get to be a real issue as your project grows. Pester the #C0744GXCJ folks about it 🙂

winsome04:12:29

I'm now subscribed to https://github.com/cursive-ide/cursive/issues/2554, it looks like there's a potential solution that just hasn't risen high enough on the priority queue yet

1
Eugen14:12:48

is there a way to know inside a CI (Jenkins) what polylith projects have changes ? I would like to run a CI job that runs a comon polylith job to check projects and run tests and then if all is OK, trigger jobs to build specific projects and docker images for them. I would like to do that only if projects had changes.

mynomoto14:12:30

The last Sean article has an example of how to do that: https://corfield.org/blog/2022/12/07/deps-edn-monorepo-10/, I think it is in the end of the article.

dangercoder14:12:40

I recommend using babashka for finding out which projects has changed and https://github.com/GoogleContainerTools/jib to build the images. Use that combo previously and it was great

Eugen15:12:08

thanks both for the feedback. will look into that

Eugen15:12:19

don't see a lot of benefits for jib in our case. will keep an eye out for the future.

Eugen15:12:29

@U05094X3J: I saw the changed-projects fn and looks like it is what I was looking for. Will try it out, thanks again

👍 1