Fork me on GitHub
#polylith
<
2024-01-24
>
tengstrand19:01:17

HI everyone! I just released https://github.com/polyfy/polylith/releases/tag/untagged-1d916a42090feed6fbcd. The documentation can be found https://cljdoc.org/d/polylith/clj-poly/0.2.19-SNAPSHOT/doc/readme. The biggest change is that we from 0.2.19 will store project and brick configuration in config.edn files in their directories. Another change is that the interface name now can be given when creating a project. To migrate your project, execute the https://cljdoc.org/d/polylith/clj-poly/0.2.19-SNAPSHOT/doc/reference/commands#migrate command. A complete list of the changes can be found https://github.com/polyfy/polylith/blob/master/next-release.txt. Please try it out (maybe in a separate branch) and if it seems to work, I will make a 0.2.19 release out of it.

seancorfield19:01:19

I see that it talks about the generated deps.edn containing:

:aliases  {:dev {:extra-paths ["development/src"]
Haven't we switched over to :extra-deps now? Or is this a special case?

seancorfield19:01:04

Also, the development project section doesn't mention the generated config.edn file that the workspace doc says is in that project.

seancorfield19:01:17

The component and base sections don't seem to mention config.edn either -- but the project section does.

seancorfield19:01:55

The project section has a file tree that has config.edn at the top level alongside workspace.edn but nothing seems to discuss that file -- is it just a mistake in the file tree "graphic"?

tengstrand20:01:41

Good feedback. The ./deps.edn file is the deps file of development and the extra-path includes its own source file, just the same way bricks specify their src directory. And then it also includes all the bricks that are included. Will probably be busy now for a few days, but will adress this as soon I have time. I would be good if more people could have a look also, and test the migrate command + check the documentation.

seancorfield20:01:43

> The ./deps.edn file is the deps file of development and the extra-path includes its own source file No, that's not the case here.

seancorfield20:01:06

This is on the workspace page and it's talking about the root deps.edn file -- and using :extra-paths instead of :extra-deps.

seancorfield20:01:00

(and then that same fragment is repeated on the development page)

seancorfield20:01:23

Also, this command does not work:

(~/clojure)-(!2001)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' \
>         -M -m  polylith.clj.core.poly-cli.core \
>         create workspace name:example top-ns:se.example :commit
  Couldn't open 'workspace.edn': /home/sean/clojure/workspace.edn (No such file or directory)
I think this is a known bug, that workspace.edn is checked for, before actually creating a new workspace? I retried with "LATEST" to use the snapshot version and that failed the same way, so I guess this isn't fixed yet?

tengstrand21:01:30

Will have a look.

seancorfield21:01:47

I think this update has broken the external test runner support? I migrated our project at work and it is no longer using our external test runner -- so I don't think it is picking up the global :test config from the workspace.edn file any more.

seancorfield21:01:16

Confirmed. So I tried adding the external test runner config to a project and that broke too:

sean@sean-win11-desk:~/workspace/wsmain$ dev.sh poly
                  _      _ + _   _
#####   _ __  ___| |_  _| |-| |_| |_
#####  | '_ \/ _ \ | || | | |  _| ' \
#####  | .__/\___/_|\_, |_|_|\__|_||_|
       |_|          |__/ poly 0.2.19-SNAPSHOT #1
wsmain$ test
Projects to run tests from: activator, api, auth, batch-jobs, campaign, cfml-affiliate, frankieee, login, match-reminders, migration, migration-data, preview, publisher, system, webpusher, wsadmin, wsbilling-admin, wsbilling-member, wsbilling-rebill, wsmessaging, wsphotoqueue, wsseogeo

Cannot invoke "clojure.lang.IFn.invoke(Object)" because "this.project_to_bricks_to_test" is null
wsmain$ 
That's with this projects/activator/config.edn:
{:alias "act"
 :test {:create-test-runner [org.corfield.external-test-runner.interface/create]
        :setup-fn ws.application-fixtures.interface/pre-test
        :teardown-fn ws.application-fixtures.interface/post-test}}

seancorfield21:01:14

OK, that's as far as I can get with 0.2.19 -- until the external test runner stuff is fixed.

👍 1
seancorfield22:01:35

> I think this is a known bug, that workspace.edn is checked for, before actually creating a new workspace? It turns out it's the presence of any deps.edn file that causes this to fail, not workspace.edn, for 0.2.18 (as well as 0.2.19-SNAPSHOT).

tengstrand20:01:04

> Also, the development project section doesn't mention the generated config.edn file that the workspace doc says is in that project. Fixed. > The component and base sections don't seem to mention config.edn either -- but the project section does. The config.edn files for bricks are only needed if we use :keep-lib-versions which is introduced in the Libraries section. > The project section has a file tree that has config.edn at the top level alongside workspace.edn but nothing seems to discuss that file -- is it just a mistake in the file tree "graphic"? Yes, it was a mistake. Good catch! > Haven't we switched over to :extra-deps now? Or is this a special case? > No, that's not the case here. Do you suggest that we should put another deps.edn file under development that specifies the development environment's src directory in :paths and then include development with a :local/root in ./deps.edn ? > Also, this command does not work: ... (bootstrapping a workspace) I executed it from an empty directory, and then i worked (on my Mac). @U04V70XH6 I did a new 0.2.19-SNAPSHOT #3 release. Left to do: • Add check and test to the poly-clj API. • Make the filename config.edn configurable. • Maybe some more.

seancorfield21:01:57

> Do you suggest that we should put another deps.edn file under development that specifies the development environment's src directory in :paths and then include development with a :local/root in ./deps.edn ? No... but this made me double-check how our repo is set up at work and, in addition to :dev having all the :extra-deps for bricks, we also have:

:extra-paths ["development/resources"
                 "development/src"]
So you can ignore that comment -- I'd just totally forgotten that's what you start with when you're creating a new workspace!

👍 1
seancorfield21:01:42

> I executed it from an empty directory, and then i worked (on my Mac). Put an empty deps.edn in a new folder and then run it: it will fail because there's logic in poly to detect the old v1 workspace format with deps.edn but no workspace.edn and it triggers "this is a v1 workspace" logic and then it fails to read workspace.edn elsewhere.

seancorfield21:01:33

Repro:

(~/clojure)-(!2011)-> mkdir poly-bug

Wed Jan 31 13:21:09
(~/clojure)-(!2012)-> cd poly-bug

Wed Jan 31 13:21:13
(~/clojure/poly-bug)-(!2013)-> echo '{}' > deps.edn

Wed Jan 31 13:21:18
(~/clojure/poly-bug)-(!2014)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' \
>          -M -m  polylith.clj.core.poly-cli.core \
>          create workspace name:example top-ns:se.example :commit
Downloading: org/clojure/clojure/maven-metadata.xml from central
Downloading: org/clojure/clojure/maven-metadata.xml from clojars
Downloading: org/clojure/clojure/maven-metadata.xml from sonatype
Downloading: polylith/clj-poly/maven-metadata.xml from clojars
  Couldn't open 'workspace.edn': /home/sean/clojure/poly-bug/workspace.edn (No such file or directory)

Wed Jan 31 13:22:18
(~/clojure/poly-bug)-(!2015)->

tengstrand21:01:48

Okay, I will have a look!

seancorfield20:01:23

Also, this command does not work:

(~/clojure)-(!2001)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' \
>         -M -m  polylith.clj.core.poly-cli.core \
>         create workspace name:example top-ns:se.example :commit
  Couldn't open 'workspace.edn': /home/sean/clojure/workspace.edn (No such file or directory)
I think this is a known bug, that workspace.edn is checked for, before actually creating a new workspace? I retried with "LATEST" to use the snapshot version and that failed the same way, so I guess this isn't fixed yet?

seancorfield21:01:14

☝️:skin-tone-2: Can anyone verify that the above command (from the docs) works or fails in a clean directory?

tengstrand06:01:39

This worked on my machine (Mac book air, M1): clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' -M -m polylith.clj.core.poly-cli.core create workspace name:example top-ns:se.example :commit

seancorfield06:01:36

The presence of a deps.edn -- even an empty one -- is what breaks it:

(~/clojure)-(!2006)-> mkdir j

Wed Jan 24 22:55:08
(~/clojure)-(!2007)-> cd j

Wed Jan 24 22:55:09
(~/clojure/j)-(!2008)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' -M -m  polylith.clj.core.poly-cli.core create workspace name:example top-ns:se.example :commit

Wed Jan 24 22:55:33
(~/clojure/j)-(!2009)-> ls
example

Wed Jan 24 22:55:36
(~/clojure/j)-(!2010)-> rm -rf example/

Wed Jan 24 22:55:40
(~/clojure/j)-(!2011)-> echo '{}' > deps.edn

Wed Jan 24 22:55:46
(~/clojure/j)-(!2012)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' -M -m  polylith.clj.core.poly-cli.core create workspace name:example top-ns:se.example :commit
  Couldn't open 'workspace.edn': /home/sean/clojure/j/workspace.edn (No such file or directory)

seancorfield06:01:23

I often have deps.edn files lying around in "scratch" directories and that's where I tried to run that command before.